chore: height on mobile

This commit is contained in:
Aslam H
2024-09-25 18:48:23 +07:00
parent 58ce33fed5
commit 223a4524ab
6 changed files with 11 additions and 40 deletions

View File

@@ -42,7 +42,7 @@ export const LinkHeader = React.memo(() => {
</ContentHeader>
{isTablet && (
<div className="flex min-h-10 flex-row items-start justify-between border-b px-6 pb-4 pt-2 max-lg:pl-4">
<div className="flex flex-row items-start justify-between border-b px-6 pb-4 pt-2 max-lg:pl-4">
<LearningTab />
</div>
)}

View File

@@ -152,7 +152,7 @@ export const LinkItem = React.forwardRef<HTMLDivElement, LinkItemProps>(
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}
</Link>

View File

@@ -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",