diff --git a/web/components/custom/sidebar/partial/link-section.tsx b/web/components/custom/sidebar/partial/link-section.tsx index 0b568943..44e94eaf 100644 --- a/web/components/custom/sidebar/partial/link-section.tsx +++ b/web/components/custom/sidebar/partial/link-section.tsx @@ -47,7 +47,7 @@ const LinkSectionHeader: React.FC = ({ linkCount }) => { return (
@@ -55,7 +55,7 @@ const LinkSectionHeader: React.FC = ({ linkCount }) => { href="/links" className="flex flex-1 items-center justify-start rounded-md px-2 py-1 focus-visible:outline-none focus-visible:ring-0" > -

+

Links {linkCount > 0 && {linkCount}}

@@ -112,7 +112,7 @@ const ListItem: React.FC = ({ label, href, count, isActive }) => diff --git a/web/components/custom/sidebar/partial/page-section.tsx b/web/components/custom/sidebar/partial/page-section.tsx index de2304b0..652aaf31 100644 --- a/web/components/custom/sidebar/partial/page-section.tsx +++ b/web/components/custom/sidebar/partial/page-section.tsx @@ -77,12 +77,12 @@ interface PageSectionHeaderProps { const PageSectionHeader: React.FC = ({ pageCount, isActive }) => (
-

+

Pages {pageCount > 0 && {pageCount}}

@@ -165,7 +165,7 @@ const PageListItem: React.FC = ({ page, isActive }) => ( diff --git a/web/components/custom/sidebar/partial/topic-section.tsx b/web/components/custom/sidebar/partial/topic-section.tsx index 62b01d70..d814dff5 100644 --- a/web/components/custom/sidebar/partial/topic-section.tsx +++ b/web/components/custom/sidebar/partial/topic-section.tsx @@ -45,12 +45,12 @@ interface TopicSectionHeaderProps { const TopicSectionHeader: React.FC = ({ topicCount, isActive }) => (
-

+

Topics {topicCount > 0 && {topicCount}}

@@ -116,7 +116,7 @@ const ListItem: React.FC = ({ label, value, href, count, isActive { {isTablet && ( -
+
)} diff --git a/web/components/routes/link/partials/link-item.tsx b/web/components/routes/link/partials/link-item.tsx index 9eab3b6f..ec99e691 100644 --- a/web/components/routes/link/partials/link-item.tsx +++ b/web/components/routes/link/partials/link-item.tsx @@ -152,7 +152,7 @@ export const LinkItem = React.forwardRef( prefetch={false} target="_blank" onClick={e => e.stopPropagation()} - className="hover:text-primary truncate text-xs" + className="hover:text-primary mr-1 truncate text-xs" > {personalLink.url} diff --git a/web/components/routes/page/detail/PageDetailRoute.tsx b/web/components/routes/page/detail/PageDetailRoute.tsx index d819e7d8..7a7bc32e 100644 --- a/web/components/routes/page/detail/PageDetailRoute.tsx +++ b/web/components/routes/page/detail/PageDetailRoute.tsx @@ -23,33 +23,6 @@ import { usePageActions } from "../hooks/use-page-actions" const TITLE_PLACEHOLDER = "Untitled" -const isPageEmpty = (page: PersonalPage): boolean => { - return (!page.title || page.title.trim() === "") && (!page.content || Object.keys(page.content).length === 0) -} - -const useDeleteEmptyPage = (currentPageId: string | null) => { - const router = useRouter() - const { me } = useAccount({ - root: { - personalPages: [] - } - }) - - useEffect(() => { - return () => { - if (!currentPageId || !me?.root?.personalPages) return - - const currentPage = me.root.personalPages.find(page => page?.id === currentPageId) - if (currentPage && isPageEmpty(currentPage)) { - const index = me.root.personalPages.findIndex(page => page?.id === currentPageId) - if (index !== -1) { - me.root.personalPages.splice(index, 1) - } - } - } - }, [currentPageId, me, router]) -} - export function PageDetailRoute({ pageId }: { pageId: string }) { const { me } = useAccount({ root: { personalLinks: [] } }) const isMobile = useMedia("(max-width: 770px)") @@ -58,8 +31,6 @@ export function PageDetailRoute({ pageId }: { pageId: string }) { const { deletePage } = usePageActions() const confirm = useConfirm() - // useDeleteEmptyPage(pageId) - const handleDelete = useCallback(async () => { const result = await confirm({ title: "Delete page",