mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
chore(deps): migrate from pkc-react-hooks to bitsocial-react-hooks
This commit is contained in:
+2
-2
@@ -1,7 +1,7 @@
|
||||
import { lazy, Suspense, useEffect } from 'react';
|
||||
import { Navigate, Outlet, Route, Routes, useLocation, useParams } from 'react-router-dom';
|
||||
import { useAccount, useAccountComment, useSubplebbit } from '@bitsocialhq/pkc-react-hooks';
|
||||
import useAccountsStore from '@bitsocialhq/pkc-react-hooks/dist/stores/accounts';
|
||||
import { useAccount, useAccountComment, useSubplebbit } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import useAccountsStore from '@bitsocialhq/bitsocial-react-hooks/dist/stores/accounts';
|
||||
import { initSnow, removeSnow } from './lib/snow';
|
||||
import { isAllView, isCatalogView, isModView, isSubscriptionsView } from './lib/utils/view-utils';
|
||||
import { preloadThemeAssets } from './lib/utils/preload-utils';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Link, useLocation, useNavigate, useParams } from 'react-router-dom';
|
||||
import { useAccountComment, useComment, useSubscribe } from '@bitsocialhq/pkc-react-hooks';
|
||||
import { useAccountComment, useComment, useSubscribe } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import { isAllView, isCatalogView, isModView, isModQueueView, isPendingPostView, isPostPageView, isSubscriptionsView } from '../../lib/utils/view-utils';
|
||||
import { usePostPageNumber } from '../../hooks/use-post-page-number';
|
||||
import { useDirectories, useDirectoryByAddress } from '../../hooks/use-directories';
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useLocation, useParams, useNavigate } from 'react-router-dom';
|
||||
import { useAccountComment } from '@bitsocialhq/pkc-react-hooks';
|
||||
import useAccountsStore from '@bitsocialhq/pkc-react-hooks/dist/stores/accounts';
|
||||
import useSubplebbitsStore from '@bitsocialhq/pkc-react-hooks/dist/stores/subplebbits';
|
||||
import { useAccountComment } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import useAccountsStore from '@bitsocialhq/bitsocial-react-hooks/dist/stores/accounts';
|
||||
import useSubplebbitsStore from '@bitsocialhq/bitsocial-react-hooks/dist/stores/subplebbits';
|
||||
import getShortAddress from '../../lib/get-short-address';
|
||||
import { useStableSubplebbit } from '../../hooks/use-stable-subplebbit';
|
||||
import { isAllView, isSubscriptionsView, isModView } from '../../lib/utils/view-utils';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useState, useMemo } from 'react';
|
||||
import { Link, useLocation } from 'react-router-dom';
|
||||
import { useAccount } from '@bitsocialhq/pkc-react-hooks';
|
||||
import { useAccount } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import useBoardsBarEditModalStore from '../../stores/use-boards-bar-edit-modal-store';
|
||||
import useBoardsBarVisibilityStore from '../../stores/use-boards-bar-visibility-store';
|
||||
import { getAllBoardCodes } from '../../constants/board-codes';
|
||||
|
||||
@@ -2,8 +2,8 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { Link, useLocation, useNavigate, useParams } from 'react-router-dom';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import getShortAddress from '../../lib/get-short-address';
|
||||
import { useAccountComment } from '@bitsocialhq/pkc-react-hooks';
|
||||
import useAccountsStore from '@bitsocialhq/pkc-react-hooks/dist/stores/accounts';
|
||||
import { useAccountComment } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import useAccountsStore from '@bitsocialhq/bitsocial-react-hooks/dist/stores/accounts';
|
||||
import { isAllView, isCatalogView, isModView, isSubscriptionsView } from '../../lib/utils/view-utils';
|
||||
import { useDirectories, useDirectoriesMetadata, DirectoryCommunity } from '../../hooks/use-directories';
|
||||
import { useBoardPath, useResolvedSubplebbitAddress } from '../../hooks/use-resolved-subplebbit-address';
|
||||
|
||||
@@ -3,7 +3,7 @@ import { createPortal } from 'react-dom';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Link, useLocation, useParams } from 'react-router-dom';
|
||||
import { useFloating, offset, size, Placement } from '@floating-ui/react';
|
||||
import { Comment, useReplies } from '@bitsocialhq/pkc-react-hooks';
|
||||
import { Comment, useReplies } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import getShortAddress from '../../lib/get-short-address';
|
||||
import { shouldShowSnow } from '../../lib/snow';
|
||||
import { getHasThumbnail } from '../../lib/utils/media-utils';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useRef, useState, useEffect, useCallback } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Challenge as ChallengeType, useAccount, useComment } from '@bitsocialhq/pkc-react-hooks';
|
||||
import { Challenge as ChallengeType, useAccount, useComment } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import { getPublicationPreview, getPublicationType, getVotePreview } from '../../lib/utils/challenge-utils';
|
||||
import useIsMobile from '../../hooks/use-is-mobile';
|
||||
import useChallengesStore from '../../stores/use-challenges-store';
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Fragment, useMemo, useState } from 'react';
|
||||
import { useLocation, useParams } from 'react-router-dom';
|
||||
import { Trans, useTranslation } from 'react-i18next';
|
||||
import { Comment, useComment } from '@bitsocialhq/pkc-react-hooks';
|
||||
import useSubplebbitsPagesStore from '@bitsocialhq/pkc-react-hooks/dist/stores/subplebbits-pages';
|
||||
import { Comment, useComment } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import useSubplebbitsPagesStore from '@bitsocialhq/bitsocial-react-hooks/dist/stores/subplebbits-pages';
|
||||
import usePostNumberStore from '../../stores/use-post-number-store';
|
||||
import getShortAddress from '../../lib/get-short-address';
|
||||
import { getFormattedDate, getFormattedTimeAgo } from '../../lib/utils/time-utils';
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
usePublishCommentEdit,
|
||||
usePublishCommentModeration,
|
||||
PublishCommentModerationOptions,
|
||||
} from '@bitsocialhq/pkc-react-hooks';
|
||||
} from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import styles from './edit-menu.module.css';
|
||||
import { alertChallengeVerificationFailed } from '../../lib/utils/challenge-utils';
|
||||
import useChallengesStore from '../../stores/use-challenges-store';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useLocation, useParams } from 'react-router-dom';
|
||||
import { useComment } from '@bitsocialhq/pkc-react-hooks';
|
||||
import { useComment } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import BoardsBar from '../boards-bar';
|
||||
import SiteLegalMeta from '../site-legal-meta';
|
||||
import StyleSelector from '../style-selector/style-selector';
|
||||
|
||||
@@ -11,8 +11,8 @@ import { Link, useLocation, useParams } from 'react-router-dom';
|
||||
import { canEmbed } from '../embed';
|
||||
import { is5chanLink, transform5chanLinkToInternal, isValidCrossboardPattern } from '../../lib/utils/url-utils';
|
||||
import usePostNumberStore from '../../stores/use-post-number-store';
|
||||
import useSubplebbitsPagesStore from '@bitsocialhq/pkc-react-hooks/dist/stores/subplebbits-pages';
|
||||
import { useComment } from '@bitsocialhq/pkc-react-hooks';
|
||||
import useSubplebbitsPagesStore from '@bitsocialhq/bitsocial-react-hooks/dist/stores/subplebbits-pages';
|
||||
import { useComment } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import ReplyQuotePreview from '../reply-quote-preview';
|
||||
|
||||
const safeParseUrl = (href: string): URL | null => {
|
||||
|
||||
@@ -2,7 +2,7 @@ import { useEffect, useRef, useState, useCallback } from 'react';
|
||||
import { Trans, useTranslation } from 'react-i18next';
|
||||
import { Link, useLocation, useNavigationType, useParams } from 'react-router-dom';
|
||||
import { Virtuoso, VirtuosoHandle, StateSnapshot } from 'react-virtuoso';
|
||||
import { Comment, useEditedComment, useReplies, useAccount, useAccountComment } from '@bitsocialhq/pkc-react-hooks';
|
||||
import { Comment, useEditedComment, useReplies, useAccount, useAccountComment } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import getShortAddress from '../../lib/get-short-address';
|
||||
import styles from '../../views/post/post.module.css';
|
||||
import { CommentMediaInfo, getDisplayMediaInfoType, getHasThumbnail, getMediaDimensions } from '../../lib/utils/media-utils';
|
||||
@@ -42,7 +42,7 @@ import useChallengesStore from '../../stores/use-challenges-store';
|
||||
import useFeedResetStore from '../../stores/use-feed-reset-store';
|
||||
import usePostNumberStore from '../../stores/use-post-number-store';
|
||||
import { alertChallengeVerificationFailed } from '../../lib/utils/challenge-utils';
|
||||
import { usePublishCommentModeration } from '@bitsocialhq/pkc-react-hooks';
|
||||
import { usePublishCommentModeration } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import useQuotedByMap from '../../hooks/use-quoted-by-map';
|
||||
import useProgressiveRender from '../../hooks/use-progressive-render';
|
||||
import { BOARD_REPLIES_PREVIEW_FETCH_SIZE, BOARD_REPLIES_PREVIEW_VISIBLE_COUNT, REPLIES_PER_PAGE } from '../../lib/constants';
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useLocation, useNavigate, useParams } from 'react-router-dom';
|
||||
import { Comment, setAccount, useAccount, useAccountComment, useAccountSubplebbits, useEditedComment } from '@bitsocialhq/pkc-react-hooks';
|
||||
import { Comment, setAccount, useAccount, useAccountComment, useAccountSubplebbits, useEditedComment } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import getShortAddress from '../../lib/get-short-address';
|
||||
import useSubplebbitsStore from '@bitsocialhq/pkc-react-hooks/dist/stores/subplebbits';
|
||||
import useSubplebbitsPagesStore from '@bitsocialhq/pkc-react-hooks/dist/stores/subplebbits-pages';
|
||||
import useSubplebbitsStore from '@bitsocialhq/bitsocial-react-hooks/dist/stores/subplebbits';
|
||||
import useSubplebbitsPagesStore from '@bitsocialhq/bitsocial-react-hooks/dist/stores/subplebbits-pages';
|
||||
import { getLinkMediaInfo } from '../../lib/utils/media-utils';
|
||||
import { isValidURL } from '../../lib/utils/url-utils';
|
||||
import { isAllView, isCatalogView, isModQueueView, isModView, isPostPageView, isSubscriptionsView } from '../../lib/utils/view-utils';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { memo, useState } from 'react';
|
||||
import { createPortal } from 'react-dom';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Comment } from '@bitsocialhq/pkc-react-hooks';
|
||||
import { Comment } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import { autoUpdate, flip, FloatingFocusManager, offset, shift, useClick, useDismiss, useFloating, useId, useInteractions, useRole } from '@floating-ui/react';
|
||||
import styles from './post-menu-mobile.module.css';
|
||||
import { getCommentMediaInfo } from '../../../lib/utils/media-utils';
|
||||
|
||||
@@ -2,7 +2,7 @@ import { useEffect, useRef, useState, useCallback } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Link, useLocation, useNavigationType, useParams } from 'react-router-dom';
|
||||
import { Virtuoso, VirtuosoHandle, StateSnapshot } from 'react-virtuoso';
|
||||
import { Comment, useEditedComment, useReplies, useAccount, usePublishCommentModeration, useAccountComment } from '@bitsocialhq/pkc-react-hooks';
|
||||
import { Comment, useEditedComment, useReplies, useAccount, usePublishCommentModeration, useAccountComment } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import getShortAddress from '../../lib/get-short-address';
|
||||
import styles from '../../views/post/post.module.css';
|
||||
import { shouldShowSnow } from '../../lib/snow';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import { useLocation, useParams } from 'react-router-dom';
|
||||
import { Trans, useTranslation } from 'react-i18next';
|
||||
import { setAccount, useAccount } from '@bitsocialhq/pkc-react-hooks';
|
||||
import { setAccount, useAccount } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import { useSubplebbitField } from '../../hooks/use-stable-subplebbit';
|
||||
import { getFormattedTimeAgo } from '../../lib/utils/time-utils';
|
||||
import { isValidURL } from '../../lib/utils/url-utils';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import { createPortal } from 'react-dom';
|
||||
import { Link, useLocation, useNavigate } from 'react-router-dom';
|
||||
import { Comment, useAccount } from '@bitsocialhq/pkc-react-hooks';
|
||||
import { Comment, useAccount } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import { useFloating, offset, shift, size, autoUpdate, Placement } from '@floating-ui/react';
|
||||
import { useDirectories } from '../../hooks/use-directories';
|
||||
import { getBoardPath } from '../../lib/utils/route-utils';
|
||||
|
||||
@@ -15,7 +15,7 @@ vi.mock('react-i18next', () => ({
|
||||
}),
|
||||
}));
|
||||
|
||||
vi.mock('@bitsocialhq/pkc-react-hooks', () => ({
|
||||
vi.mock('@bitsocialhq/bitsocial-react-hooks', () => ({
|
||||
useAccount: () => ({ id: 'test-id', name: 'Account 1', author: { address: '0x123', shortAddress: '0x1...3' } }),
|
||||
useAccounts: () => ({ accounts: [{ id: 'test-id', name: 'Account 1', author: { shortAddress: '0x1...3' } }] }),
|
||||
deleteAccount: vi.fn(),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { memo } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { deleteAccount, exportAccount, importAccount, setActiveAccount, useAccount, useAccounts } from '@bitsocialhq/pkc-react-hooks';
|
||||
import { deleteAccount, exportAccount, importAccount, setActiveAccount, useAccount, useAccounts } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import styles from './account-settings.module.css';
|
||||
import { Capacitor } from '@capacitor/core';
|
||||
import { useLocation, useNavigate } from 'react-router-dom';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { memo, RefObject, useRef, useState } from 'react';
|
||||
import { setAccount, useAccount, usePlebbitRpcSettings } from '@bitsocialhq/pkc-react-hooks';
|
||||
import { setAccount, useAccount, usePlebbitRpcSettings } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import styles from './advanced-settings.module.css';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { memo, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useAccount, setAccount, useResolvedAuthorAddress } from '@bitsocialhq/pkc-react-hooks';
|
||||
import { useAccount, setAccount, useResolvedAuthorAddress } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import styles from './crypto-address-setting.module.css';
|
||||
|
||||
const withErrorHandling = async <T,>(fn: () => Promise<T>, onError: (e: unknown) => void): Promise<T | undefined> => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { memo, useState } from 'react';
|
||||
import { Account, setAccount, useAccount } from '@bitsocialhq/pkc-react-hooks';
|
||||
import { Account, setAccount, useAccount } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import styles from './crypto-wallets-setting.module.css';
|
||||
import { Trans, useTranslation } from 'react-i18next';
|
||||
import capitalize from 'lodash/capitalize';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { setAccount, useAccount, useSubscribe } from '@bitsocialhq/pkc-react-hooks';
|
||||
import { setAccount, useAccount, useSubscribe } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import getShortAddress from '../../../lib/get-short-address';
|
||||
import styles from './subscriptions-setting.module.css';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import useAccountsStore from '@bitsocialhq/pkc-react-hooks/dist/stores/accounts';
|
||||
import useAccountsStore from '@bitsocialhq/bitsocial-react-hooks/dist/stores/accounts';
|
||||
import { DirectoryCommunity } from './use-directories';
|
||||
|
||||
export const useAccountSubplebbitsWithMetadata = (): DirectoryCommunity[] => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useMemo } from 'react';
|
||||
import { useAccount } from '@bitsocialhq/pkc-react-hooks';
|
||||
import { useAccount } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import { useSubplebbitField } from './use-stable-subplebbit';
|
||||
|
||||
interface AuthorPrivilegesProps {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useMemo } from 'react';
|
||||
import { useAccountComments, Subplebbit } from '@bitsocialhq/pkc-react-hooks';
|
||||
import { useAccountComments, Subplebbit } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
const useCatalogFeedRows = (columnCount: number, feed: any, isFeedLoaded: boolean, subplebbit: Subplebbit) => {
|
||||
const { address } = subplebbit || {};
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useMemo } from 'react';
|
||||
import { Comment } from '@bitsocialhq/pkc-react-hooks';
|
||||
import { flattenCommentsPages } from '@bitsocialhq/pkc-react-hooks/dist/lib/utils';
|
||||
import { Comment } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import { flattenCommentsPages } from '@bitsocialhq/bitsocial-react-hooks/dist/lib/utils';
|
||||
|
||||
const useCountLinksInReplies = (comment: Comment, firstXReplies?: number) => {
|
||||
let linkCount = 0;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import localForageLru from '@bitsocialhq/pkc-react-hooks/dist/lib/localforage-lru/index.js';
|
||||
import localForageLru from '@bitsocialhq/bitsocial-react-hooks/dist/lib/localforage-lru/index.js';
|
||||
|
||||
const gifFrameDb = localForageLru.createInstance({ name: '5chanGifFrames', size: 500 });
|
||||
const failedUrls = new Set<string>();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useCallback, useMemo } from 'react';
|
||||
import { create } from 'zustand';
|
||||
import localForageLru from '@bitsocialhq/pkc-react-hooks/dist/lib/localforage-lru/index.js';
|
||||
import localForageLru from '@bitsocialhq/bitsocial-react-hooks/dist/lib/localforage-lru/index.js';
|
||||
|
||||
interface HideStoreState {
|
||||
hiddenCids: { [key: string]: boolean };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useEffect } from 'react';
|
||||
import { Subplebbit } from '@bitsocialhq/pkc-react-hooks';
|
||||
import { Subplebbit } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import { getFormattedTimeAgo } from '../lib/utils/time-utils';
|
||||
import useSubplebbitOfflineStore from '../stores/use-subplebbit-offline-store';
|
||||
import useSubplebbitsLoadingStartTimestamps from '../stores/use-subplebbits-loading-start-timestamps-store';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useMemo, useRef } from 'react';
|
||||
import { Comment, Subplebbit } from '@bitsocialhq/pkc-react-hooks';
|
||||
import { Comment, Subplebbit } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import { getCommentMediaInfo, getHasThumbnail } from '../lib/utils/media-utils';
|
||||
|
||||
const MAX_POSTS = 8;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useMemo } from 'react';
|
||||
import { useFeed } from '@bitsocialhq/pkc-react-hooks';
|
||||
import useFeedsStore from '@bitsocialhq/pkc-react-hooks/dist/stores/feeds';
|
||||
import { useFeed } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import useFeedsStore from '@bitsocialhq/bitsocial-react-hooks/dist/stores/feeds';
|
||||
import { useDirectoryByAddress } from './use-directories';
|
||||
import { useBoardFeedPageSize } from './use-board-feed-page-size';
|
||||
import { findPostPageInFeed, findPostPageInLoadedBoardFeeds, type FeedsOptionsLike, type LoadedFeedsLike } from '../lib/utils/post-page-resolution';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useCallback } from 'react';
|
||||
import { Comment, usePublishComment } from '@bitsocialhq/pkc-react-hooks';
|
||||
import { Comment, usePublishComment } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import usePublishPostStore from '../stores/use-publish-post-store';
|
||||
|
||||
const usePublishPost = ({ subplebbitAddress }: { subplebbitAddress?: string }) => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useCallback, useMemo } from 'react';
|
||||
import { Comment, usePublishComment } from '@bitsocialhq/pkc-react-hooks';
|
||||
import { Comment, usePublishComment } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import usePublishReplyStore from '../stores/use-publish-reply-store';
|
||||
import usePostNumberStore from '../stores/use-post-number-store';
|
||||
import { getQuotedCidsFromContent, mergeQuotedCids } from '../lib/utils/reply-quote-utils';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useCallback, useMemo, useRef } from 'react';
|
||||
import { Comment } from '@bitsocialhq/pkc-react-hooks';
|
||||
import { Comment } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import { QUOTE_NUMBER_REGEX } from '../lib/utils/url-utils';
|
||||
import usePostNumberStore from '../stores/use-post-number-store';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import useSubplebbitsStore from '@bitsocialhq/pkc-react-hooks/dist/stores/subplebbits';
|
||||
import useSubplebbitsStore from '@bitsocialhq/bitsocial-react-hooks/dist/stores/subplebbits';
|
||||
|
||||
/**
|
||||
* Shallow compare two objects by keys and values.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useMemo } from 'react';
|
||||
import { useClientsStates, useSubplebbit, useSubplebbitsStates } from '@bitsocialhq/pkc-react-hooks';
|
||||
import { useClientsStates, useSubplebbit, useSubplebbitsStates } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import debounce from 'lodash/debounce';
|
||||
|
||||
interface CommentOrSubplebbit {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useEffect } from 'react';
|
||||
import { useSubplebbitStats } from '@bitsocialhq/pkc-react-hooks';
|
||||
import { useSubplebbitStats } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import { create } from 'zustand';
|
||||
|
||||
export type SubplebbitsStatsState = {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { isAllView, isSubscriptionsView, isModView } from '../lib/utils/view-uti
|
||||
import useThemeStore from '../stores/use-theme-store';
|
||||
import { useDirectories } from './use-directories';
|
||||
import { useResolvedSubplebbitAddress } from './use-resolved-subplebbit-address';
|
||||
import { useAccountComment } from '@bitsocialhq/pkc-react-hooks';
|
||||
import { useAccountComment } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import useSpecialThemeStore from '../stores/use-special-theme-store';
|
||||
import { isChristmas } from '../lib/utils/time-utils';
|
||||
import { updateFavicon, isSfwBoard } from '../lib/update-favicon';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ChallengeVerification } from '@bitsocialhq/pkc-react-hooks';
|
||||
import { ChallengeVerification } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import directoriesData from '../../data/5chan-directories.json';
|
||||
import { getBoardPath } from './route-utils';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import localForageLru from '@bitsocialhq/pkc-react-hooks/dist/lib/localforage-lru/index.js';
|
||||
import localForageLru from '@bitsocialhq/bitsocial-react-hooks/dist/lib/localforage-lru/index.js';
|
||||
import { canEmbed } from '../../components/embed';
|
||||
import memoize from 'memoizee';
|
||||
import { isValidURL } from './url-utils';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Comment } from '@bitsocialhq/pkc-react-hooks';
|
||||
import useSubplebbitsStore from '@bitsocialhq/pkc-react-hooks/dist/stores/subplebbits';
|
||||
import { Comment } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import useSubplebbitsStore from '@bitsocialhq/bitsocial-react-hooks/dist/stores/subplebbits';
|
||||
|
||||
/**
|
||||
* Checks if a text matches a pattern according to various pattern matching rules:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Comment } from '@bitsocialhq/pkc-react-hooks';
|
||||
import { Comment } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
|
||||
export type PostMenuProps = {
|
||||
cid?: string;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { create } from 'zustand';
|
||||
import { persist } from 'zustand/middleware';
|
||||
import { Comment } from '@bitsocialhq/pkc-react-hooks';
|
||||
import { Comment } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import { commentMatchesPattern } from '../lib/utils/pattern-utils';
|
||||
|
||||
interface FilterItem {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { create } from 'zustand';
|
||||
import { Challenge } from '@bitsocialhq/pkc-react-hooks';
|
||||
import { Challenge } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
|
||||
let nextChallengeId = 0;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { create } from 'zustand';
|
||||
import type { Comment } from '@bitsocialhq/pkc-react-hooks';
|
||||
import type { Comment } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
|
||||
interface PostNumberState {
|
||||
// Post numbers are only unique within a subplebbit, so scope by address
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ChallengeVerification, Comment, PublishCommentOptions } from '@bitsocialhq/pkc-react-hooks';
|
||||
import { ChallengeVerification, Comment, PublishCommentOptions } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import { create } from 'zustand';
|
||||
import { alertChallengeVerificationFailed } from '../lib/utils/challenge-utils';
|
||||
import useChallengesStore from './use-challenges-store';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ChallengeVerification, Comment, PublishCommentOptions } from '@bitsocialhq/pkc-react-hooks';
|
||||
import { ChallengeVerification, Comment, PublishCommentOptions } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import { create } from 'zustand';
|
||||
import { alertChallengeVerificationFailed } from '../lib/utils/challenge-utils';
|
||||
import useChallengesStore from './use-challenges-store';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { create, StoreApi } from 'zustand';
|
||||
import localForageLru from '@bitsocialhq/pkc-react-hooks/dist/lib/localforage-lru/index.js';
|
||||
import localForageLru from '@bitsocialhq/bitsocial-react-hooks/dist/lib/localforage-lru/index.js';
|
||||
|
||||
interface ThemeState {
|
||||
themes: {
|
||||
|
||||
@@ -28,7 +28,7 @@ vi.mock('../../../lib/utils/account-editor-utils', () => ({
|
||||
buildSavePayload: vi.fn((parsed: { account: Record<string, unknown> }, id: string) => ({ ...parsed.account, id })),
|
||||
}));
|
||||
|
||||
vi.mock('@bitsocialhq/pkc-react-hooks', () => ({
|
||||
vi.mock('@bitsocialhq/bitsocial-react-hooks', () => ({
|
||||
useAccount: () => ({ id: 'test-id', name: 'Account 1', author: { address: '0x123', shortAddress: '0x1...3' } }),
|
||||
setAccount: vi.fn(),
|
||||
}));
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useLocation, useNavigate } from 'react-router-dom';
|
||||
import { setAccount, useAccount } from '@bitsocialhq/pkc-react-hooks';
|
||||
import { setAccount, useAccount } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import { buildEditableAccountJson, safeParseAccountJson, buildSavePayload } from '../../lib/utils/account-editor-utils';
|
||||
import styles from './account-data-editor.module.css';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useCallback, useEffect, useMemo, useRef } from 'react';
|
||||
import { Link, useLocation, useNavigate, useNavigationType, useParams } from 'react-router-dom';
|
||||
import { Comment, useAccount, useAccountComments, useAccountSubplebbits, useFeed, useSubplebbit } from '@bitsocialhq/pkc-react-hooks';
|
||||
import { Comment, useAccount, useAccountComments, useAccountSubplebbits, useFeed, useSubplebbit } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import { useSubplebbitField } from '../../hooks/use-stable-subplebbit';
|
||||
import { Virtuoso, VirtuosoHandle, StateSnapshot } from 'react-virtuoso';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useEffect, useMemo, useRef, useState, useCallback } from 'react';
|
||||
import { useLocation, useNavigate, useNavigationType, useParams } from 'react-router-dom';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Comment, useAccount, useFeed, useSubplebbit, useAccountComments } from '@bitsocialhq/pkc-react-hooks';
|
||||
import { Comment, useAccount, useFeed, useSubplebbit, useAccountComments } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import { Virtuoso, VirtuosoHandle, StateSnapshot } from 'react-virtuoso';
|
||||
import useCatalogFeedRows from '../../hooks/use-catalog-feed-rows';
|
||||
import { useDirectories, useDirectoryByAddress } from '../../hooks/use-directories';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Link, useNavigate } from 'react-router-dom';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import useAccountsStore from '@bitsocialhq/pkc-react-hooks/dist/stores/accounts';
|
||||
import useAccountsStore from '@bitsocialhq/bitsocial-react-hooks/dist/stores/accounts';
|
||||
import { useDirectoriesState, useDirectories, DirectoryCommunity } from '../../../hooks/use-directories';
|
||||
import { getBoardPath } from '../../../lib/utils/route-utils';
|
||||
import useDisclaimerModalStore from '../../../stores/use-disclaimer-modal-store';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useEffect, useMemo, useRef, FormEvent } from 'react';
|
||||
import { Link, useNavigate } from 'react-router-dom';
|
||||
import { Trans, useTranslation } from 'react-i18next';
|
||||
import { useSubplebbits } from '@bitsocialhq/pkc-react-hooks';
|
||||
import { useSubplebbits } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import styles from './home.module.css';
|
||||
import { useDirectories, useDirectoryAddresses } from '../../hooks/use-directories';
|
||||
import { SubplebbitStatsCollector, useSubplebbitsStatsStore } from '../../hooks/use-subplebbits-stats';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { memo, useMemo } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Comment, Subplebbit } from '@bitsocialhq/pkc-react-hooks';
|
||||
import { Comment, Subplebbit } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import styles from '../home.module.css';
|
||||
import usePopularPosts from '../../../hooks/use-popular-posts';
|
||||
import usePopularThreadsOptionsStore from '../../../stores/use-popular-threads-options-store';
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import React, { useMemo, useState, useEffect, useCallback, memo } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useParams, Link } from 'react-router-dom';
|
||||
import { useFeed, Comment, usePublishCommentModeration, useEditedComment, useSubplebbit, useComment } from '@bitsocialhq/pkc-react-hooks';
|
||||
import useAccountsStore from '@bitsocialhq/pkc-react-hooks/dist/stores/accounts';
|
||||
import { useFeed, Comment, usePublishCommentModeration, useEditedComment, useSubplebbit, useComment } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import useAccountsStore from '@bitsocialhq/bitsocial-react-hooks/dist/stores/accounts';
|
||||
import { Virtuoso } from 'react-virtuoso';
|
||||
import styles from './mod-queue.module.css';
|
||||
import useModQueueStore from '../../stores/use-mod-queue-store';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useEffect } from 'react';
|
||||
import { useNavigate, useParams } from 'react-router-dom';
|
||||
import { useAccountComment, useAccountComments } from '@bitsocialhq/pkc-react-hooks';
|
||||
import { useAccountComment, useAccountComments } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import { useDirectories } from '../../hooks/use-directories';
|
||||
import { getBoardPath } from '../../lib/utils/route-utils';
|
||||
import { Post } from '../post';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { memo, useEffect, useMemo } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Comment, Role, useComment, useEditedComment, useSubplebbit } from '@bitsocialhq/pkc-react-hooks';
|
||||
import useSubplebbitsPagesStore from '@bitsocialhq/pkc-react-hooks/dist/stores/subplebbits-pages';
|
||||
import { Comment, Role, useComment, useEditedComment, useSubplebbit } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import useSubplebbitsPagesStore from '@bitsocialhq/bitsocial-react-hooks/dist/stores/subplebbits-pages';
|
||||
import { useSubplebbitField } from '../../hooks/use-stable-subplebbit';
|
||||
import { useLocation, useNavigate, useParams } from 'react-router-dom';
|
||||
import { isAllView } from '../../lib/utils/view-utils';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useEffect, useState, FormEvent } from 'react';
|
||||
import { useNavigate, useParams } from 'react-router-dom';
|
||||
import { useSubplebbit } from '@bitsocialhq/pkc-react-hooks';
|
||||
import { useSubplebbit } from '@bitsocialhq/bitsocial-react-hooks';
|
||||
import { Footer, HomeLogo } from '../home';
|
||||
import { useDirectories, DirectoryCommunity } from '../../hooks/use-directories';
|
||||
import { getSubplebbitAddress, getBoardPath } from '../../lib/utils/route-utils';
|
||||
|
||||
Reference in New Issue
Block a user