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 {
OpChanProvider as ClientProvider ,
useClient ,
ClientProvider,
useClient,
} from './v1/context/ClientContext';
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 };
export function OpChanProvider({ client, children }: ProviderProps) {
export function ClientProvider({ client, children }: ProviderProps) {
return (
<ClientContext.Provider value={{ client }}>
{children}
@ -19,7 +19,7 @@ export function OpChanProvider({ client, children }: ProviderProps) {
export function useClient(): OpChanClient {
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;
}

View File

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