From cc2fa06c72e36c6e8579b7cd8523e18e212a1ef5 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Wed, 7 Feb 2024 23:06:27 +0800 Subject: [PATCH] :lipstick: Optimized styles --- pkg/view/src/layouts/RootLayout.tsx | 20 ++++++++++++--- pkg/view/src/pages/auth/callback.tsx | 4 +-- pkg/view/src/pages/auth/connect.tsx | 4 +-- pkg/view/src/pages/auth/login.tsx | 37 +++++++++++++++++----------- pkg/view/src/pages/auth/register.tsx | 4 +-- pkg/view/src/pages/users/confirm.tsx | 4 +-- 6 files changed, 47 insertions(+), 26 deletions(-) diff --git a/pkg/view/src/layouts/RootLayout.tsx b/pkg/view/src/layouts/RootLayout.tsx index a9c8c28..9d28731 100644 --- a/pkg/view/src/layouts/RootLayout.tsx +++ b/pkg/view/src/layouts/RootLayout.tsx @@ -1,8 +1,8 @@ import Navbar from "./shared/Navbar.tsx"; import { readProfiles, useUserinfo } from "../stores/userinfo.tsx"; -import { createEffect, createSignal, Show } from "solid-js"; +import { createEffect, createMemo, createSignal, Show } from "solid-js"; import { readWellKnown } from "../stores/wellKnown.tsx"; -import { BeforeLeaveEventArgs, useLocation, useNavigate } from "@solidjs/router"; +import { BeforeLeaveEventArgs, useLocation, useNavigate, useSearchParams } from "@solidjs/router"; export default function RootLayout(props: any) { const [ready, setReady] = createSignal(false); @@ -13,6 +13,7 @@ export default function RootLayout(props: any) { const userinfo = useUserinfo(); const location = useLocation(); + const [searchParams] = useSearchParams(); createEffect(() => { if (ready()) { @@ -30,6 +31,14 @@ export default function RootLayout(props: any) { } } + const mainContentStyles = createMemo(() => { + if (searchParams["embedded"]) { + return "h-screen"; + } else { + return "h-[calc(100vh-64px)] mt-[64px]"; + } + }); + return ( @@ -38,8 +47,11 @@ export default function RootLayout(props: any) { }> - -
{props.children}
+ + + + +
{props.children}
); } \ No newline at end of file diff --git a/pkg/view/src/pages/auth/callback.tsx b/pkg/view/src/pages/auth/callback.tsx index 5caf411..a682c66 100644 --- a/pkg/view/src/pages/auth/callback.tsx +++ b/pkg/view/src/pages/auth/callback.tsx @@ -4,8 +4,8 @@ export default function DefaultCallbackPage() { const [searchParams] = useSearchParams(); return ( -
-
+
+