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 13 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
104 changes: 104 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.

3 changes: 3 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 All @@ -44,6 +46,7 @@
"sonner": "^2.0.1",
"tailwind-merge": "^3.0.2",
"tailwindcss-animate": "^1.0.7",
"usehooks-ts": "^3.1.1",
"vaul": "^1.1.2",
"zod": "^3.24.2"
},
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,12 +1,13 @@
import { UserAvatar } from "@/components/user-avatar";
import CustomTrigger from "./app-sidebar/components/custom-trigger";
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">
<CustomTrigger when="invisible" />
<MainNav />
<MobileNav />
<UserAvatar />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Plus } from "lucide-react";

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

export default function AgentAddButton() {
return (
<div className="flex items-center gap-2 p-3">
<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,56 @@
import {
SidebarGroup,
SidebarGroupContent,
SidebarGroupLabel,
SidebarMenu,
SidebarMenuButton,
SidebarMenuItem,
} from "@/components/ui/sidebar";

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

export default function AgentsList() {
return (
<>
<SidebarGroup>
<SidebarGroupLabel className="text-base">
Pinned Agents
</SidebarGroupLabel>
<SidebarGroupContent className="mt-2">
<SidebarMenu>
{pinnedAgents.map((agent) => (
<SidebarMenuItem key={agent}>
<SidebarMenuButton asChild>
<span>{agent}</span>
</SidebarMenuButton>
</SidebarMenuItem>
))}
</SidebarMenu>
</SidebarGroupContent>
</SidebarGroup>
<SidebarGroup>
<SidebarGroupLabel className="text-base">
Recently Hired Agents
</SidebarGroupLabel>
<SidebarGroupContent className="mt-2">
<SidebarMenu>
{recentlyUsedAgents.map((agent) => (
<SidebarMenuItem key={agent}>
<SidebarMenuButton asChild>
<span>{agent}</span>
</SidebarMenuButton>
</SidebarMenuItem>
))}
</SidebarMenu>
</SidebarGroupContent>
</SidebarGroup>
</>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"use client";

import { ArrowLeftFromLine, ArrowRightFromLine } from "lucide-react";

import { Button } from "@/components/ui/button";
import { useSidebar } from "@/components/ui/sidebar";
import { cn } from "@/lib/utils";

interface CustomTriggerProps {
when?: "visible" | "invisible" | "always";
}

export default function CustomTrigger({ when = "always" }: CustomTriggerProps) {
const { open, openMobile, isMobile, toggleSidebar } = useSidebar();
const isVisible = isMobile ? openMobile : open;

return (
<Button
variant="outline"
size="icon"
onClick={toggleSidebar}
className={cn("hidden", {
flex:
when === "always" || (when === "visible" ? isVisible : !isVisible),
})}
>
{isVisible ? <ArrowLeftFromLine /> : <ArrowRightFromLine />}
</Button>
);
}
33 changes: 33 additions & 0 deletions web-app/src/app/(app)/components/app-sidebar/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { SokosumiLogo } from "@/components/masumi-logos";
import { ScrollArea } from "@/components/ui/scroll-area";
import {
Sidebar,
SidebarContent,
SidebarFooter,
SidebarHeader,
} from "@/components/ui/sidebar";

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

export default function AppSidebar() {
return (
<Sidebar>
<SidebarHeader>
<div className="flex items-center gap-2 p-2">
<CustomTrigger />
<SokosumiLogo />
</div>
</SidebarHeader>
<SidebarContent>
<ScrollArea>
<AgentsList />
</ScrollArea>
</SidebarContent>
<SidebarFooter>
<AgentAddButton />
</SidebarFooter>
</Sidebar>
);
}
Loading