From 1ae274a658d0a705b698a8873c286ec73403b1a6 Mon Sep 17 00:00:00 2001 From: polwex Date: Thu, 15 May 2025 12:17:54 +0700 Subject: m --- src/pages/index.tsx | 18 +++++------------- src/pages/login.tsx | 14 ++++++++------ 2 files changed, 13 insertions(+), 19 deletions(-) (limited to 'src/pages') diff --git a/src/pages/index.tsx b/src/pages/index.tsx index c008c4d..82ffd99 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,21 +1,13 @@ import { Link } from "waku"; import { Counter } from "../components/counter"; +import { getContextData } from "waku/middleware/context"; +import Main from "../components/Main"; export default async function HomePage() { - const data = await getData(); + const { user } = getContextData(); - return ( -
- {data.title} -

{data.headline}

-

{data.body}

- - - About page - -
- ); + return
; } const getData = async () => { @@ -30,6 +22,6 @@ const getData = async () => { export const getConfig = async () => { return { - render: "static", + render: "dynamic", } as const; }; diff --git a/src/pages/login.tsx b/src/pages/login.tsx index 2c9f643..13d3bd4 100644 --- a/src/pages/login.tsx +++ b/src/pages/login.tsx @@ -1,4 +1,5 @@ import AuthScreen from "@/components/Login2"; +import ProfileScreen from "@/components/Profile"; import { Link } from "waku"; import db from "@/lib/db"; import { getContextData } from "waku/middleware/context"; @@ -7,12 +8,13 @@ export default async function AuthPage() { const ctx = getContextData(); console.log({ ctx }); const data = await getData(); - - return ( -
- -
- ); + if (ctx.user) return ; + else + return ( +
+ +
+ ); } const getData = async () => { -- cgit v1.2.3