chore: rename providers

This commit is contained in:
Danish Arora 2025-09-24 19:05:52 +05:30
parent 367cb72834
commit de4acee1c1
No known key found for this signature in database
GPG Key ID: 1C6EF37CDAE1426E
3 changed files with 5 additions and 5 deletions

View File

@ -1,8 +1,8 @@
export { export {
OpChanProvider as ClientProvider , ClientProvider,
useClient , useClient,
} from './v1/context/ClientContext'; } from './v1/context/ClientContext';
export { OpChanProvider } from './v1/provider/OpChanProvider'; export { OpChanProvider } from './v1/provider/OpChanProvider';

View File

@ -9,7 +9,7 @@ const ClientContext = createContext<ClientContextValue | null>(null);
type ProviderProps = { client: OpChanClient; children: React.ReactNode }; type ProviderProps = { client: OpChanClient; children: React.ReactNode };
export function OpChanProvider({ client, children }: ProviderProps) { export function ClientProvider({ client, children }: ProviderProps) {
return ( return (
<ClientContext.Provider value={{ client }}> <ClientContext.Provider value={{ client }}>
{children} {children}
@ -19,7 +19,7 @@ export function OpChanProvider({ client, children }: ProviderProps) {
export function useClient(): OpChanClient { export function useClient(): OpChanClient {
const ctx = useContext(ClientContext); const ctx = useContext(ClientContext);
if (!ctx) throw new Error('useClient must be used within OpChanProvider'); if (!ctx) throw new Error('useClient must be used within ClientProvider');
return ctx.client; return ctx.client;
} }

View File

@ -1,6 +1,6 @@
import React from 'react'; import React from 'react';
import { OpChanClient, type OpChanClientConfig } from '@opchan/core'; import { OpChanClient, type OpChanClientConfig } from '@opchan/core';
import { OpChanProvider as ClientProvider } from '../context/ClientContext'; import { ClientProvider } from '../context/ClientContext';
import { StoreWiring } from './StoreWiring'; import { StoreWiring } from './StoreWiring';
import { setOpchanState } from '../store/opchanStore'; import { setOpchanState } from '../store/opchanStore';
import { EVerificationStatus } from '@opchan/core'; import { EVerificationStatus } from '@opchan/core';