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:
Tommaso Casaburi
2026-03-13 13:25:10 +08:00
committed by GitHub
parent 9dc4d96d27
commit d7703953fb
105 changed files with 2659 additions and 1491 deletions
@@ -27,8 +27,8 @@ vi.mock('react-i18next', () => ({
vi.mock('@bitsocialnet/bitsocial-react-hooks', () => ({
useAccount: () => accountState.value,
useSubscribe: ({ subplebbitAddress }: { subplebbitAddress: string }) =>
subscriptionMocks.byAddress.get(subplebbitAddress) ?? {
useSubscribe: ({ communityAddress }: { communityAddress: string }) =>
subscriptionMocks.byAddress.get(communityAddress) ?? {
subscribed: false,
subscribe: vi.fn(),
unsubscribe: vi.fn(),
@@ -6,7 +6,7 @@ import { memo, useState } from 'react';
const SubscriptionButton = ({ address }: { address: string }) => {
const { t } = useTranslation();
const { subscribed, subscribe, unsubscribe } = useSubscribe({ subplebbitAddress: address });
const { subscribed, subscribe, unsubscribe } = useSubscribe({ communityAddress: address });
const [recentlyUnsubscribed, setRecentlyUnsubscribed] = useState(false);
const handleClick = () => {