diff --git a/.gitignore b/.gitignore index a6ffe12c..ff3186f4 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ generated/ test-results/ tsconfig.tsbuildinfo .eslintcache +server.js # IDE Specific .idea diff --git a/src/app/(home)/layout.tsx b/src/app/(home)/layout.tsx index 61bb94f2..67179e45 100644 --- a/src/app/(home)/layout.tsx +++ b/src/app/(home)/layout.tsx @@ -13,7 +13,7 @@ export default async function HomeLayout({ }) { return ( <> -
+
new Date() + ) { + notFound() + } + + const dehydratedState = dehydrate(queryClient) + + return ( + +
+
+
+ {page?.metadata?.content?.tags?.includes("post") ? ( +

+ {page.metadata?.content?.title} +

+ ) : ( +

+ {page?.metadata?.content?.title} +

+ )} + {page?.metadata?.content?.tags?.includes("post") && ( + + )} +
+ +
+ + {page?.metadata && ( + + )} + +
+
+ ) +} diff --git a/src/app/@modal/default.ts b/src/app/@modal/default.ts new file mode 100644 index 00000000..86b9e9a3 --- /dev/null +++ b/src/app/@modal/default.ts @@ -0,0 +1,3 @@ +export default function Default() { + return null +} diff --git a/src/app/default.ts b/src/app/default.ts new file mode 100644 index 00000000..86b9e9a3 --- /dev/null +++ b/src/app/default.ts @@ -0,0 +1,3 @@ +export default function Default() { + return null +} diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 4f883472..503e4550 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -76,8 +76,10 @@ export const metadata: Metadata = { export default function RootLayout({ children, + modal, }: { children: React.ReactNode + modal: React.ReactNode }) { const lang = useAcceptLang() const colorScheme = getColorScheme() @@ -95,7 +97,10 @@ export default function RootLayout({ return ( - {children} + + {modal} + {children} + diff --git a/src/components/common/Comment.tsx b/src/components/common/Comment.tsx index 65aba941..7cd1f651 100644 --- a/src/components/common/Comment.tsx +++ b/src/components/common/Comment.tsx @@ -1,5 +1,6 @@ "use client" +import { useState } from "react" // TODO import { Virtuoso } from "react-virtuoso" @@ -13,9 +14,11 @@ import { useGetComments } from "~/queries/page" const Comment = ({ page, className, + fixHeight, }: { page?: ExpandedNote className?: string + fixHeight?: boolean }) => { const comments = useGetComments({ characterId: page?.characterId, @@ -27,6 +30,8 @@ const Comment = ({ (page) => (page?.list?.length ?? 0) > 0, ) + const [totalListHeight, setTotalListHeight] = useState(10) + return (
{ + setTotalListHeight(height + 71) + }} data={data} endReached={() => comments.hasNextPage && comments.fetchNextPage()} components={{ diff --git a/src/components/home/HomeFeed.tsx b/src/components/home/HomeFeed.tsx index cf210e7c..9d13246d 100644 --- a/src/components/home/HomeFeed.tsx +++ b/src/components/home/HomeFeed.tsx @@ -43,8 +43,7 @@ const PostCard = ({ return ( { + setOpen(true) + }, []) + + return ( + router.back()} + > + {children} + + ) +} diff --git a/src/components/site/PostFooter.tsx b/src/components/site/PostFooter.tsx index 694ee46c..8018c14b 100644 --- a/src/components/site/PostFooter.tsx +++ b/src/components/site/PostFooter.tsx @@ -51,9 +51,11 @@ export const usePostFooterInView = () => { export const PostFooter = ({ page, site, + fixHeight, }: { page?: ExpandedNote site?: ExpandedCharacter + fixHeight?: boolean }) => { const actionElRef = useRef(null) const [isInView] = useInViewport(actionElRef) @@ -87,7 +89,7 @@ export const PostFooter = ({
{inited || isInView ? ( - + ) : ( )} diff --git a/src/components/ui/Modal.tsx b/src/components/ui/Modal.tsx index 84dba0e1..c3eb43ad 100644 --- a/src/components/ui/Modal.tsx +++ b/src/components/ui/Modal.tsx @@ -1,7 +1,8 @@ -import clsx from "clsx" -import React, { forwardRef } from "react" +"use client" -import { Dialog } from "@headlessui/react" +import React, { Fragment, forwardRef } from "react" + +import { Dialog, Transition } from "@headlessui/react" import { cn } from "~/lib/utils" @@ -13,56 +14,92 @@ interface ModalProps { titleIcon?: React.ReactNode size?: "md" | "lg" | "sm" zIndex?: number + panelClassName?: string } export const Modal = forwardRef( - ({ open, setOpen, children, title, titleIcon, size = "md", zIndex }, ref) => { + ( + { + open, + setOpen, + children, + title, + titleIcon, + size = "md", + zIndex, + panelClassName, + }, + ref, + ) => { return ( - setOpen(false)} - className={clsx("relative", zIndex ? `z-${zIndex}` : "z-10")} - > - {/* The backdrop, rendered as a fixed sibling to the panel container */} -
- - {/* Full-screen container to center the panel */} -
+ setOpen(false)} + className="relative" + style={{ + zIndex: zIndex ? zIndex : 10, + }} > - {/* The actual dialog panel */} - - {title && ( - - {titleIcon && {titleIcon}} - - {title} - - setOpen(false)} - > - - - - )} - {children} - -
-
+
+ + +
+ + {/* The actual dialog panel */} + + {title && ( + + {titleIcon && {titleIcon}} + + {title} + + setOpen(false)} + > + + + + )} + {children} + + +
+ + ) }, )