diff --git a/client/app/(auth)/head.tsx b/client/app/(auth)/head.tsx
index cea829b8..6a70b7ad 100644
--- a/client/app/(auth)/head.tsx
+++ b/client/app/(auth)/head.tsx
@@ -1,5 +1,5 @@
-import PageSeo from "@components/head"
+import PageSeo from "@components/page-seo"
export default function AuthHead() {
- return
+ return
}
diff --git a/client/components/home/home.module.css b/client/app/(home)/home.module.css
similarity index 100%
rename from client/components/home/home.module.css
rename to client/app/(home)/home.module.css
diff --git a/client/components/home/index.tsx b/client/app/(home)/home.tsx
similarity index 99%
rename from client/components/home/index.tsx
rename to client/app/(home)/home.tsx
index 332f8839..42bbbd6e 100644
--- a/client/components/home/index.tsx
+++ b/client/app/(home)/home.tsx
@@ -1,3 +1,4 @@
+"use client"
import ShiftBy from "@components/shift-by"
import { Spacer, Tabs, Card, Textarea, Text } from "@geist-ui/core/dist"
import Image from "next/image"
diff --git a/client/app/page.tsx b/client/app/(home)/page.tsx
similarity index 55%
rename from client/app/page.tsx
rename to client/app/(home)/page.tsx
index 56c3c4d7..7fa37be4 100644
--- a/client/app/page.tsx
+++ b/client/app/(home)/page.tsx
@@ -1,4 +1,5 @@
import { getWelcomeContent } from "pages/api/welcome"
+import Home from "./home"
const getWelcomeData = async () => {
const welcomeContent = await getWelcomeContent()
@@ -6,7 +7,7 @@ const getWelcomeData = async () => {
}
export default async function Page() {
- const welcomeData = await getWelcomeData()
-
- return
{JSON.stringify(welcomeData)}
+ const { content, rendered, title } = await getWelcomeData()
+
+ return
}
diff --git a/client/app/(posts)/expired/page.tsx b/client/app/(posts)/expired/page.tsx
new file mode 100644
index 00000000..f19719e4
--- /dev/null
+++ b/client/app/(posts)/expired/page.tsx
@@ -0,0 +1,11 @@
+"use client"
+
+import { Note, Text } from "@geist-ui/core/dist"
+
+export default function ExpiredPage() {
+ return (
+
+ Error: The Drift you're trying to view has expired.
+
+ )
+}
diff --git a/client/app/(posts)/new/from/[id]/page.tsx b/client/app/(posts)/new/from/[id]/page.tsx
index e520fe66..6db2aa28 100644
--- a/client/app/(posts)/new/from/[id]/page.tsx
+++ b/client/app/(posts)/new/from/[id]/page.tsx
@@ -4,6 +4,7 @@ import { cookies } from "next/headers"
import { TOKEN_COOKIE_NAME } from "@lib/constants"
import { getPostWithFiles } from "app/prisma"
import { useRedirectIfNotAuthed } from "@lib/server/hooks/use-redirect-if-not-authed"
+
const NewFromExisting = async ({
params
}: {
diff --git a/client/app/(posts)/new/layout.tsx b/client/app/(posts)/new/layout.tsx
index 479eb04b..35dfebc7 100644
--- a/client/app/(posts)/new/layout.tsx
+++ b/client/app/(posts)/new/layout.tsx
@@ -1,4 +1,4 @@
export default function NewLayout({ children }: { children: React.ReactNode }) {
- // useRedirectIfNotAuthed()
- return <>{children}>;
+ // useRedirectIfNotAuthed()
+ return <>{children}>
}
diff --git a/client/app/(posts)/new/page.tsx b/client/app/(posts)/new/page.tsx
index aa0621a3..4bb5e812 100644
--- a/client/app/(posts)/new/page.tsx
+++ b/client/app/(posts)/new/page.tsx
@@ -1,5 +1,5 @@
import NewPost from "@components/new-post"
-import '@styles/react-datepicker.css'
+import "@styles/react-datepicker.css"
const New = () =>
diff --git a/client/app/(profiles)/mine/head.tsx b/client/app/(profiles)/mine/head.tsx
new file mode 100644
index 00000000..8b9fc207
--- /dev/null
+++ b/client/app/(profiles)/mine/head.tsx
@@ -0,0 +1,5 @@
+import PageSeo from "@components/page-seo"
+
+export default function Head() {
+ return
+}
diff --git a/client/app/(profiles)/mine/page.tsx b/client/app/(profiles)/mine/page.tsx
new file mode 100644
index 00000000..36440abc
--- /dev/null
+++ b/client/app/(profiles)/mine/page.tsx
@@ -0,0 +1,18 @@
+import { USER_COOKIE_NAME } from "@lib/constants"
+import { notFound, useRouter } from "next/navigation"
+import { cookies } from "next/headers"
+import { getPostsByUser } from "app/prisma"
+import PostList from "@components/post-list"
+export default async function Mine() {
+ // TODO: fix router usage
+ // const router = useRouter()
+ const userId = cookies().get(USER_COOKIE_NAME)?.value
+ if (!userId) {
+ // return router.push("/signin")
+ return notFound()
+ }
+
+ const posts = await getPostsByUser(userId, true)
+ const hasMore = false
+ return
+}
diff --git a/client/app/(profiles)/settings/head.tsx b/client/app/(profiles)/settings/head.tsx
new file mode 100644
index 00000000..6404a743
--- /dev/null
+++ b/client/app/(profiles)/settings/head.tsx
@@ -0,0 +1,5 @@
+import PageSeo from "@components/page-seo"
+
+export default function Head() {
+ return
+}
diff --git a/client/app/(profiles)/settings/page.tsx b/client/app/(profiles)/settings/page.tsx
new file mode 100644
index 00000000..ce14b34f
--- /dev/null
+++ b/client/app/(profiles)/settings/page.tsx
@@ -0,0 +1,5 @@
+import SettingsPage from "@components/settings"
+
+const Settings = () =>
+
+export default Settings
diff --git a/client/app/admin/page.tsx b/client/app/admin/page.tsx
new file mode 100644
index 00000000..3f3b36bb
--- /dev/null
+++ b/client/app/admin/page.tsx
@@ -0,0 +1,22 @@
+import Admin from "@components/admin"
+import { TOKEN_COOKIE_NAME } from "@lib/constants"
+import { isUserAdmin } from "app/prisma"
+import { cookies } from "next/headers"
+import { notFound } from "next/navigation"
+
+const AdminPage = async () => {
+ const driftToken = cookies().get(TOKEN_COOKIE_NAME)?.value
+ if (!driftToken) {
+ return notFound()
+ }
+
+ const isAdmin = await isUserAdmin(driftToken)
+
+ if (!isAdmin) {
+ return notFound()
+ }
+
+ return
+}
+
+export default AdminPage
diff --git a/client/app/layout.tsx b/client/app/layout.tsx
index 8bc39b88..2d4794af 100644
--- a/client/app/layout.tsx
+++ b/client/app/layout.tsx
@@ -49,7 +49,9 @@ export default function RootLayout({ children }: RootLayoutProps) {
Drift
- {children}
+
+ {children}
+