From bd69513117a162d2eb3defe1067524c799b0619b Mon Sep 17 00:00:00 2001 From: SeanCassiere <33615041+SeanCassiere@users.noreply.github.com> Date: Tue, 2 Jul 2024 16:39:11 +1200 Subject: [PATCH] refactor(ui): use viewTransition for revealing the sidebar content --- src/routers/app/hx-router.tsx | 4 ++-- src/routers/app/layouts/app-container.tsx | 21 +++++++++------------ 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/routers/app/hx-router.tsx b/src/routers/app/hx-router.tsx index 5f53b2f..90475b3 100644 --- a/src/routers/app/hx-router.tsx +++ b/src/routers/app/hx-router.tsx @@ -14,7 +14,7 @@ app.get("/sidebar-organizations", checkUserAuthed, async (c) => { // DO NOT USE THIS PARAMETER FOR AUTH // THIS IS PURELY BEING USED FOR STYLING - const workspace = c.req.query("current_workspace") || ""; + const style_workspace = c.req.query("style_current_workspace") || ""; const relationships = await db.query.usersToTenants.findMany({ where: (fields, { eq }) => eq(fields.userId, user.id), @@ -23,7 +23,7 @@ app.get("/sidebar-organizations", checkUserAuthed, async (c) => { const tenants = relationships.map((r) => r.tenant); - return c.html(); + return c.html(); }); export default app; diff --git a/src/routers/app/layouts/app-container.tsx b/src/routers/app/layouts/app-container.tsx index c516ee6..c3d74e6 100644 --- a/src/routers/app/layouts/app-container.tsx +++ b/src/routers/app/layouts/app-container.tsx @@ -1,5 +1,5 @@ import type { FC, PropsWithChildren } from "hono/jsx"; -import { User } from "lucia"; +import type { User } from "lucia"; export interface AppContainerProps { user: User; @@ -7,16 +7,14 @@ export interface AppContainerProps { mainClass?: string; } -export const AppContainer: FC> = (props) => { - const { user, children, mainClass } = props; - +export const AppContainer: FC> = ({ user, children, mainClass, workspace }) => { return (