|
@@ -12,10 +12,14 @@ import { IPageForPageDuplicateModal } from '~/stores/modal';
|
|
|
import { useSWRBookmarkInfo } from '../../stores/bookmark';
|
|
import { useSWRBookmarkInfo } from '../../stores/bookmark';
|
|
|
import { useSWRxPageInfo } from '../../stores/page';
|
|
import { useSWRxPageInfo } from '../../stores/page';
|
|
|
import { useSWRxUsersList } from '../../stores/user';
|
|
import { useSWRxUsersList } from '../../stores/user';
|
|
|
|
|
+import BookmarkButtons from '../BookmarkButtons';
|
|
|
import {
|
|
import {
|
|
|
- AdditionalMenuItemsRendererProps, ForceHideMenuItems, MenuItemType, PageItemControlProps,
|
|
|
|
|
|
|
+ AdditionalMenuItemsRendererProps, ForceHideMenuItems, MenuItemType,
|
|
|
|
|
+ PageItemControl,
|
|
|
} from '../Common/Dropdown/PageItemControl';
|
|
} from '../Common/Dropdown/PageItemControl';
|
|
|
-import { Skelton } from '../Skelton';
|
|
|
|
|
|
|
+import LikeButtons from '../LikeButtons';
|
|
|
|
|
+import SubscribeButton from '../SubscribeButton';
|
|
|
|
|
+import SeenUserInfo from '../User/SeenUserInfo';
|
|
|
|
|
|
|
|
|
|
|
|
|
type CommonProps = {
|
|
type CommonProps = {
|
|
@@ -51,20 +55,6 @@ const SubNavButtonsSubstance = (props: SubNavButtonsSubstanceProps): JSX.Element
|
|
|
|
|
|
|
|
const { data: bookmarkInfo, mutate: mutateBookmarkInfo } = useSWRBookmarkInfo(pageId);
|
|
const { data: bookmarkInfo, mutate: mutateBookmarkInfo } = useSWRBookmarkInfo(pageId);
|
|
|
|
|
|
|
|
- // dynamic import for show skelton
|
|
|
|
|
- const SubscribeButton = dynamic(() => import('../SubscribeButton'), { ssr: false, loading: () => <Skelton width={37} additionalClass='btn-subscribe'/> });
|
|
|
|
|
- const LikeButtons = dynamic(() => import('../LikeButtons'), { ssr: false, loading: () => <Skelton width={57.48} additionalClass='btn-like'/> });
|
|
|
|
|
- const BookmarkButtons = dynamic(() => import('../BookmarkButtons'), {
|
|
|
|
|
- ssr: false,
|
|
|
|
|
- loading: () => <Skelton width={53.48} additionalClass='total-bookmarks'/>,
|
|
|
|
|
- });
|
|
|
|
|
- const SeenUserInfo = dynamic(() => import('../User/SeenUserInfo'), { ssr: false, loading: () => <Skelton width={58.98} additionalClass='btn-seen-user'/> });
|
|
|
|
|
- const PageItemControl = dynamic<PageItemControlProps>(() => import('../Common/Dropdown/PageItemControl').then(mod => mod.PageItemControl), {
|
|
|
|
|
- ssr: false,
|
|
|
|
|
- loading: () => <Skelton width={37} additionalClass='btn-page-item-control'/>,
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
const likerIds = isIPageInfoForEntity(pageInfo) ? (pageInfo.likerIds ?? []).slice(0, 15) : [];
|
|
const likerIds = isIPageInfoForEntity(pageInfo) ? (pageInfo.likerIds ?? []).slice(0, 15) : [];
|
|
|
const seenUserIds = isIPageInfoForEntity(pageInfo) ? (pageInfo.seenUserIds ?? []).slice(0, 15) : [];
|
|
const seenUserIds = isIPageInfoForEntity(pageInfo) ? (pageInfo.seenUserIds ?? []).slice(0, 15) : [];
|
|
|
|
|
|
|
@@ -215,7 +205,7 @@ const SubNavButtonsSubstance = (props: SubNavButtonsSubstanceProps): JSX.Element
|
|
|
);
|
|
);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-type SubNavButtonsProps= CommonProps & {
|
|
|
|
|
|
|
+export type SubNavButtonsProps = CommonProps & {
|
|
|
pageId: string,
|
|
pageId: string,
|
|
|
shareLinkId?: string | null,
|
|
shareLinkId?: string | null,
|
|
|
revisionId?: string | null,
|
|
revisionId?: string | null,
|