mirror of
https://github.com/logos-messaging/OpChan.git
synced 2026-01-03 21:33:09 +00:00
chore: rename providers
This commit is contained in:
parent
367cb72834
commit
de4acee1c1
@ -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';
|
||||||
|
|||||||
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -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';
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user