-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(ui): use a shared layout across the pages (#40)
* feat: working on the basic restructure * feat: workspace pages * feat: better failed middleware redirection * feat: more consistency stuff * feat: service pages * feat: let the aside not be ugly when in light mode * feat: breakpoint on mobile * feat: some mobile relevant fixes * chore: stuff for the vscode config * chore: one more item for the vscode config * chore: bump package.json version
- Loading branch information
1 parent
65625e1
commit 6bfafd5
Showing
14 changed files
with
172 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import type { FC, PropsWithChildren } from "hono/jsx"; | ||
import { User } from "lucia"; | ||
|
||
import type { TenantRecord } from "@/types/db.mjs"; | ||
|
||
export interface AppContainerProps { | ||
user: User; | ||
tenant: TenantRecord | null; | ||
tenants: Array<TenantRecord>; | ||
mainClass?: string; | ||
} | ||
|
||
export const AppContainer: FC<PropsWithChildren<AppContainerProps>> = ({ | ||
user, | ||
tenant, | ||
tenants, | ||
children, | ||
mainClass, | ||
}) => { | ||
return ( | ||
<div className="flex flex-col md:grid md:grid-cols-4 lg:grid-cols-5 min-h-full"> | ||
<aside class="h-[250px] border-b flex flex-col bg-gray-100 dark:bg-gray-800 md:h-auto md:col-span-1 md:border-r md:border-b-none"> | ||
<div class="flex-grow p-2"> | ||
<p class="pb-2">Hello {user.username}!</p> | ||
<p class="pb-2 border-b">Your organizations</p> | ||
{tenants.length > 0 ? ( | ||
<ul> | ||
{tenants.map((item) => ( | ||
<li> | ||
<a | ||
href={`/app/${item.workspace}`} | ||
class='block py-1 data-[active-tenant="true"]:text-blue-500' | ||
data-active-tenant={tenant ? item.id === tenant.id : false} | ||
> | ||
{item.name} | ||
</a> | ||
</li> | ||
))} | ||
</ul> | ||
) : ( | ||
<p>😞 You have no organizations.</p> | ||
)} | ||
<span class="border-t" /> | ||
</div> | ||
<div class="p-2"> | ||
<a href="/app/logout">👋🏼 Logout</a> | ||
</div> | ||
</aside> | ||
<main className={["md:col-span-3 lg:col-span-4", mainClass].filter(Boolean).join(" ")}>{children}</main> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import type { FC } from "hono/jsx"; | ||
|
||
import { RootDocument } from "../layouts/root-document.js"; | ||
import { AppContainer, type AppContainerProps } from "../layouts/app-container.js"; | ||
|
||
export const DashboardLandingPage: FC<{} & Omit<AppContainerProps, "tenant">> = ({ user, tenants }) => { | ||
return ( | ||
<RootDocument title="Simple Logging Server"> | ||
<AppContainer user={user} tenants={tenants} tenant={null} mainClass="p-2 md:p-4"> | ||
<p>There is no content on this page</p> | ||
</AppContainer> | ||
</RootDocument> | ||
); | ||
}; |
File renamed without changes.
Oops, something went wrong.