diff --git a/src/components/board-buttons/board-buttons.module.css b/src/components/board-buttons/board-buttons.module.css index 36a20ac2..68e2416b 100644 --- a/src/components/board-buttons/board-buttons.module.css +++ b/src/components/board-buttons/board-buttons.module.css @@ -32,6 +32,7 @@ display: flex; align-items: center; justify-content: space-between; /* Ensure elements are spaced out properly */ + padding-right: 5px; } .desktopBoardButtons::after { diff --git a/src/components/board-buttons/board-buttons.tsx b/src/components/board-buttons/board-buttons.tsx index fbcc9be4..f23db435 100644 --- a/src/components/board-buttons/board-buttons.tsx +++ b/src/components/board-buttons/board-buttons.tsx @@ -1,13 +1,18 @@ +import { useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { Link, useLocation, useNavigate, useParams } from 'react-router-dom'; -import { useAccountComment, useSubscribe } from '@plebbit/plebbit-react-hooks'; -import { isAllView, isCatalogView, isPendingPostView, isPostPageView, isSubscriptionsView } from '../../lib/utils/view-utils'; +import { useAccountComment, useComment, useSubscribe } from '@plebbit/plebbit-react-hooks'; +import { flattenCommentsPages } from '@plebbit/plebbit-react-hooks/dist/lib/utils'; +import { isAllView, isCatalogView, isDescriptionView, isPendingPostView, isPostPageView, isRulesView, isSubscriptionsView } from '../../lib/utils/view-utils'; import useCatalogStyleStore from '../../stores/use-catalog-style-store'; import useFeedResetStore from '../../stores/use-feed-reset-store'; import useSortingStore from '../../stores/use-sorting-store'; import useTimeFilter from '../../hooks/use-time-filter'; import CatalogFilters from '../../views/catalog/catalog-filters/'; import styles from './board-buttons.module.css'; +import Tooltip from '../tooltip'; +import useCountLinksInReplies from '../../hooks/use-count-links-in-replies'; +import useReplyCount from '../../hooks/use-reply-count'; interface BoardButtonsProps { address?: string | undefined; @@ -220,6 +225,27 @@ export const MobileBoardButtons = () => { ); }; +const PostPageStats = () => { + const params = useParams(); + const location = useLocation(); + const isInDescriptionView = isDescriptionView(location.pathname, params); + const isInRulesView = isRulesView(location.pathname, params); + + const comment = useComment({ commentCid: params?.commentCid }); + const { closed, pinned } = comment || {}; + + const linkCount = useCountLinksInReplies(comment); + const replyCount = useReplyCount(comment); + + return ( + + {(pinned || isInDescriptionView || isInRulesView) && 'Sticky / '} + {(closed || isInDescriptionView || isInRulesView) && 'Closed / '} + / + + ); +}; + export const DesktopBoardButtons = () => { const params = useParams(); const location = useLocation(); @@ -243,8 +269,7 @@ export const DesktopBoardButtons = () => { ] {isInPostView && ( - [ - ] + )}