mirror of
https://github.com/logos-messaging/OpChan.git
synced 2026-01-02 12:53:10 +00:00
chore: rename providers
This commit is contained in:
parent
367cb72834
commit
de4acee1c1
@ -1,8 +1,8 @@
|
||||
|
||||
|
||||
export {
|
||||
OpChanProvider as ClientProvider ,
|
||||
useClient ,
|
||||
ClientProvider,
|
||||
useClient,
|
||||
} from './v1/context/ClientContext';
|
||||
|
||||
export { OpChanProvider } from './v1/provider/OpChanProvider';
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user