mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
refactor: migrate 5chan to the community hooks API (#1073)
* refactor(community-api): migrate 5chan to community hooks * fix(review): address PR feedback * fix(review): preserve legacy board context fallbacks * fix(review): address latest bot feedback * fix(review): use communityAddress in edit menu privileges
This commit is contained in:
@@ -25,7 +25,7 @@ const testState = vi.hoisted(() => ({
|
||||
|
||||
vi.mock('@bitsocialnet/bitsocial-react-hooks', () => ({
|
||||
useAccount: () => testState.account,
|
||||
useAccountSubplebbits: () => ({ accountSubplebbits: testState.accountSubplebbits }),
|
||||
useAccountCommunities: () => ({ accountCommunities: testState.accountSubplebbits }),
|
||||
}));
|
||||
|
||||
vi.mock('@bitsocialnet/bitsocial-react-hooks/dist/lib/utils', () => ({
|
||||
@@ -37,8 +37,8 @@ vi.mock('../use-directories', () => ({
|
||||
useDirectoryByAddress: (address: string | undefined) => (address ? testState.directoryLookup[address] : undefined),
|
||||
}));
|
||||
|
||||
vi.mock('../use-stable-subplebbit', () => ({
|
||||
useSubplebbitField: (_address: string | undefined, selector: (subplebbit: unknown) => unknown) => selector(testState.subplebbitSnapshot),
|
||||
vi.mock('../use-stable-community', () => ({
|
||||
useCommunityField: (_address: string | undefined, selector: (community: unknown) => unknown) => selector(testState.subplebbitSnapshot),
|
||||
}));
|
||||
|
||||
let latestValue: unknown;
|
||||
|
||||
Reference in New Issue
Block a user