Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds a layout for the app route group #42

Open
wants to merge 28 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
8d2989a
refactor app header responsive and add tooltip to user avatar
golddydev Mar 6, 2025
729468a
export as default
golddydev Mar 6, 2025
31d755a
add sidebar to app layout
golddydev Mar 6, 2025
aa0a15c
fix conflicts
golddydev Mar 6, 2025
dea2668
adapt masumi logos
golddydev Mar 6, 2025
f246817
add agent gallery button
golddydev Mar 6, 2025
9a89039
add agent gallery button on mobile
golddydev Mar 6, 2025
aeac91e
fix preload warning
golddydev Mar 7, 2025
c125e9f
add sidebar and use-hooks-ts library
golddydev Mar 7, 2025
a2951c5
add test sidebar
golddydev Mar 7, 2025
3b5c485
make sidebar and update mobile nav bar
golddydev Mar 7, 2025
0e62747
add credit number
golddydev Mar 7, 2025
1644898
Merge branch 'dev' into feat/app-layout
golddydev Mar 7, 2025
12a6e00
merge from dev
golddydev Mar 8, 2025
233a8aa
extract nav menu from nav components
golddydev Mar 8, 2025
7a79aad
simplify agent group, add props to appheader and add doc to custom tr…
golddydev Mar 8, 2025
8fbb332
componentize nav menu
golddydev Mar 8, 2025
7734386
Rename AppHeader to Header and update layout import
mrgrauel Mar 9, 2025
57a2704
Rename app-sidebar folder to sidebar
mrgrauel Mar 9, 2025
b69487a
change app sidebar to sidebar
golddydev Mar 9, 2025
8aebea0
fix conflicts
golddydev Mar 9, 2025
127ca93
Remove tailwind.config.ts from .prettierignore
mrgrauel Mar 10, 2025
745ee9c
Bump @icons-pack/react-simple-icons and next-themes to latest versions
mrgrauel Mar 10, 2025
7708a44
Readd sidebar by shadcn/ui after updating to tailwind v4
mrgrauel Mar 10, 2025
d9431f5
remove tailwind config in component.json of shadcn
golddydev Mar 10, 2025
e729e80
update globals.css using oklch and move layout to theme
golddydev Mar 10, 2025
9e88dd6
change navigation components' name
golddydev Mar 10, 2025
7b84829
add custom theme color and utility in globals.css for landing page
golddydev Mar 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion web-app/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@
src/lib/api/generated/**

# Ignore UI components
src/components/ui/**
src/components/ui/**

tailwind.config.ts
82 changes: 82 additions & 0 deletions web-app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions web-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
"@radix-ui/react-dropdown-menu": "^2.1.6",
"@radix-ui/react-label": "^2.1.2",
"@radix-ui/react-scroll-area": "^1.2.3",
"@radix-ui/react-separator": "^1.1.2",
"@radix-ui/react-slot": "^1.1.2",
"@radix-ui/react-tooltip": "^1.1.8",
"@react-email/components": "^0.0.33",
"better-auth": "^1.2.0",
"better-auth-harmony": "^1.2.3",
Expand Down
5 changes: 5 additions & 0 deletions web-app/public/icons/sokosumi-icon-red.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 7 additions & 6 deletions web-app/src/app/(app)/components/app-header.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { UserAvatar } from "@/components/user-avatar";
import { MobileLeftPanel } from "./left-panel";
import MainNav from "./main-nav";
import MobileNav from "./mobile-nav";
import UserAvatar from "./user-avatar";

import { MainNav } from "./main-nav";
import { MobileNav } from "./mobile-nav";

export function AppHeader() {
export default function AppHeader() {
return (
<header className="border-grid sticky top-0 z-50 w-full border-b bg-background/95 px-4 py-3">
<header className="border-grid sticky top-0 z-50 flex h-[64px] w-full items-center border-b bg-background/95 px-4 py-3">
<div className="flex w-full items-center">
<MainNav />
<MobileLeftPanel />
<MobileNav />
<UserAvatar />
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { Plus } from "lucide-react";

import { SokosumiIcon } from "@/components/masumi-icons";
import { Button } from "@/components/ui/button";
import { cn } from "@/lib/utils";

interface AgentAddButtonProps {
className?: string;
}

export default function AgentAddButton({ className }: AgentAddButtonProps) {
return (
<div className={cn("flex items-center gap-2 bg-muted p-3", className)}>
<SokosumiIcon />
<div className="flex flex-1 flex-col">
<h2 className="text-base font-bold text-muted-foreground">
Agents Gallery
</h2>
<p className="text-sm text-muted-foreground">browse agents</p>
</div>
<Button variant="outline" size="icon">
<Plus />
</Button>
</div>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import { FolderClock, Pin } from "lucide-react";

import { ScrollArea } from "@/components/ui/scroll-area";
import { cn } from "@/lib/utils";

const pinnedAgents = Array.from(
{ length: 10 },
(_, index) => `Random Agent #${index + 1}`,
);
const recentlyUsedAgents = Array.from(
{ length: 10 },
(_, index) => `Random Agent #${index + 1}`,
);

interface AgentsListProps {
className?: string;
}

export default function AgentsList({ className = "h-full" }: AgentsListProps) {
return (
<ScrollArea className={cn("w-full bg-muted p-3", className)}>
<div className="mt-4 flex items-center gap-2 text-sm font-bold text-muted-foreground">
You Pinned Agents
<Pin />
</div>
<div className="mt-4">
{pinnedAgents.length > 0 ? (
<ul className="flex flex-col gap-3">
{pinnedAgents.map((agent) => (
<li key={agent} className="text-sm font-medium text-foreground">
{agent}
</li>
))}
</ul>
) : (
<div className="text-sm text-gray-400">no pinned agents</div>
)}
</div>

<div className="mt-12 flex items-center gap-2 text-sm font-medium text-muted-foreground">
Recently Used Agents
<FolderClock />
</div>
<div className="mt-4">
{recentlyUsedAgents.length > 0 ? (
<ul className="flex flex-col gap-3">
{recentlyUsedAgents.map((agent, index) => (
<li key={index} className="text-sm font-medium text-foreground">
{agent}
</li>
))}
</ul>
) : (
<div className="text-sm text-gray-400">no recently used agents</div>
)}
</div>
</ScrollArea>
);
}
2 changes: 2 additions & 0 deletions web-app/src/app/(app)/components/left-panel/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { default as MainLeftPanel } from "./main-left-panel";
export { default as MobileLeftPanel } from "./mobile-left-panel";
11 changes: 11 additions & 0 deletions web-app/src/app/(app)/components/left-panel/main-left-panel.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import AgentAddButton from "./components/agent-add-button";
import AgentsList from "./components/agents-list";

export default function MainLeftPanel() {
return (
<div className="hidden h-full w-64 flex-col md:flex">
<AgentsList className="flex-1" />
<AgentAddButton />
</div>
);
}
43 changes: 43 additions & 0 deletions web-app/src/app/(app)/components/left-panel/mobile-left-panel.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
"use client";

import { PanelLeftClose, PanelLeftOpen } from "lucide-react";
import * as React from "react";

import { Button } from "@/components/ui/button";
import {
Sheet,
SheetContent,
SheetDescription,
SheetHeader,
SheetTitle,
SheetTrigger,
} from "@/components/ui/sheet";

import AgentAddButton from "./components/agent-add-button";
import AgentsList from "./components/agents-list";

export default function MobileLeftPanel() {
const [open, setOpen] = React.useState(false);

return (
<Sheet open={open} onOpenChange={setOpen}>
<SheetTrigger asChild>
<div className="flex-1 md:hidden">
<Button variant="outline" size="icon">
{open ? <PanelLeftClose /> : <PanelLeftOpen />}
</Button>
</div>
</SheetTrigger>
<SheetContent className="h-svh w-full max-w-sm" side="left">
<SheetHeader>
<SheetTitle></SheetTitle>
<SheetDescription></SheetDescription>
</SheetHeader>
<div className="flex h-full flex-col">
<AgentsList className="mt-2 bg-background" />
<AgentAddButton className="bg-background" />
</div>
</SheetContent>
</Sheet>
);
}
16 changes: 6 additions & 10 deletions web-app/src/app/(app)/components/main-nav.tsx
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should componetize this

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this component simple using nav-menu and nav-link

Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,30 @@
import Link from "next/link";
import { usePathname } from "next/navigation";

import { siteConfig } from "@/configs/site";
import { SokosumiLogo } from "@/components/masumi-logos";
import { cn } from "@/lib/utils";

const navLinks = [
const navItems = [
{ href: "/dashboard", label: "Home" },
{ href: "/jobs", label: "Jobs" },
{ href: "/billing", label: "Billing" },
{ href: "/settings", label: "Settings" },
];

export function MainNav() {
export default function MainNav() {
const pathname = usePathname();

return (
<div className="mr-4 hidden w-full md:flex">
<Link href="/" className="mr-4 flex items-center gap-2 md:mr-6">
<span className="hidden font-bold md:inline-block">
{siteConfig.name}
</span>
</Link>
<SokosumiLogo />
<nav className="flex flex-1 items-center justify-end gap-4 text-sm xl:gap-6">
{navLinks.map((nav) => {
{navItems.map((nav) => {
const isActive = pathname.startsWith(nav.href);
return (
<Link
key={nav.label}
href={nav.href}
className={cn("transition-colors hover:text-foreground/80", {
className={cn("text-sm transition hover:text-foreground/80", {
"text-foreground underline": isActive,
"text-foreground/50": !isActive,
})}
Expand Down
Loading