mirror of
https://github.com/ClipFusion-org/clipfusion.git
synced 2025-08-05 18:15:08 +00:00
added custom title bar for pwa
This commit is contained in:
parent
b4dad36b89
commit
67cc20e35c
@ -131,4 +131,8 @@ body {
|
|||||||
body {
|
body {
|
||||||
@apply bg-background text-foreground;
|
@apply bg-background text-foreground;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@utility h-safe-area-inset-top {
|
||||||
|
height: env(safe-area-inset-top);
|
||||||
}
|
}
|
@ -48,7 +48,7 @@ export default async function RootLayout({
|
|||||||
<ThemeProvider>
|
<ThemeProvider>
|
||||||
<SidebarProvider>
|
<SidebarProvider>
|
||||||
<Dashboard/>
|
<Dashboard/>
|
||||||
<main className="w-full h-full">
|
<main className="w-full h-full relative">
|
||||||
<PersistenceProvider>
|
<PersistenceProvider>
|
||||||
{children}
|
{children}
|
||||||
</PersistenceProvider>
|
</PersistenceProvider>
|
||||||
|
104
src/app/page.tsx
104
src/app/page.tsx
@ -262,60 +262,66 @@ export default function Home(): ReactNode {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="p-5 w-full h-full">
|
<>
|
||||||
<div className="flex flex-row items-center gap-2 overscroll-none">
|
<div className="flex flex-row items-center gap-2 absolute top-0 left-0 p-5 z-40" tabIndex={1}>
|
||||||
<SidebarTrigger size="lg" />
|
<SidebarTrigger size="lg"/>
|
||||||
<h2 className="font-bold break-keep text-xl sm:text-2xl md:text-3xl lg:text-4xl leading-none">Project Library</h2>
|
<h2 className="font-bold break-keep text-xl sm:text-2xl md:text-3xl lg:text-4xl leading-none">Project Library</h2>
|
||||||
{projects && <Label className="text-muted-foreground text-sm">(Found {projects.length} projects)</Label>}
|
{projects && <Label className="text-muted-foreground text-sm">(Found {projects.length} projects)</Label>}
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-row items-center justify-between sticky top-safe bg-background gap-2 mt-3 pb-2 pt-2 w-full overscroll-none z-50">
|
<div className="p-5 w-full h-full">
|
||||||
<div className="flex flex-row items-center gap-2">
|
<div aria-hidden className="fixed top-0 left-0 w-full z-10">
|
||||||
<Dialog>
|
<div className="sticky top-0 left-0 w-full h-safe-area-inset-top bg-[#0a0a0a]" />
|
||||||
<DialogTrigger asChild>
|
|
||||||
<Button>
|
|
||||||
<PlusIcon /> {!isMobile && "New Project"}
|
|
||||||
</Button>
|
|
||||||
</DialogTrigger>
|
|
||||||
<DialogContent>
|
|
||||||
<DialogHeader>
|
|
||||||
<DialogTitle>
|
|
||||||
Create New Project
|
|
||||||
</DialogTitle>
|
|
||||||
<DialogDescription>
|
|
||||||
Fill in the information about your project. You can change it at any time later.
|
|
||||||
</DialogDescription>
|
|
||||||
</DialogHeader>
|
|
||||||
<Form {...newProjectForm}>
|
|
||||||
<form onSubmit={newProjectForm.handleSubmit(newProjectSubmit)} className="grid gap-3">
|
|
||||||
<ProjectInfoForm form={newProjectForm} />
|
|
||||||
<DialogFooter>
|
|
||||||
<DialogClose asChild>
|
|
||||||
<Button variant="outline">Cancel</Button>
|
|
||||||
</DialogClose>
|
|
||||||
<DialogClose asChild>
|
|
||||||
<Button type="submit">Create</Button>
|
|
||||||
</DialogClose>
|
|
||||||
</DialogFooter>
|
|
||||||
</form>
|
|
||||||
</Form>
|
|
||||||
</DialogContent>
|
|
||||||
</Dialog>
|
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-row items-center gap-2">
|
<div className="h-8" />
|
||||||
<Toggle variant="outline">
|
<div className="flex flex-row items-center justify-between sticky top-safe bg-background gap-2 mt-3 pb-2 pt-2 w-full z-40">
|
||||||
<ListCheckIcon /> {!isMobile && "Select Projects"}
|
<div className="flex flex-row items-center gap-2">
|
||||||
</Toggle>
|
<Dialog>
|
||||||
<Search placeholder="Search Projects" value={search} onChange={(e) => setSearch(e.target.value)} />
|
<DialogTrigger asChild>
|
||||||
|
<Button>
|
||||||
|
<PlusIcon /> {!isMobile && "New Project"}
|
||||||
|
</Button>
|
||||||
|
</DialogTrigger>
|
||||||
|
<DialogContent>
|
||||||
|
<DialogHeader>
|
||||||
|
<DialogTitle>
|
||||||
|
Create New Project
|
||||||
|
</DialogTitle>
|
||||||
|
<DialogDescription>
|
||||||
|
Fill in the information about your project. You can change it at any time later.
|
||||||
|
</DialogDescription>
|
||||||
|
</DialogHeader>
|
||||||
|
<Form {...newProjectForm}>
|
||||||
|
<form onSubmit={newProjectForm.handleSubmit(newProjectSubmit)} className="grid gap-3">
|
||||||
|
<ProjectInfoForm form={newProjectForm} />
|
||||||
|
<DialogFooter>
|
||||||
|
<DialogClose asChild>
|
||||||
|
<Button variant="outline">Cancel</Button>
|
||||||
|
</DialogClose>
|
||||||
|
<DialogClose asChild>
|
||||||
|
<Button type="submit">Create</Button>
|
||||||
|
</DialogClose>
|
||||||
|
</DialogFooter>
|
||||||
|
</form>
|
||||||
|
</Form>
|
||||||
|
</DialogContent>
|
||||||
|
</Dialog>
|
||||||
|
</div>
|
||||||
|
<div className="flex flex-row items-center gap-2">
|
||||||
|
<Toggle variant="outline">
|
||||||
|
<ListCheckIcon /> {!isMobile && "Select Projects"}
|
||||||
|
</Toggle>
|
||||||
|
<Search placeholder="Search Projects" value={search} onChange={(e) => setSearch(e.target.value)} />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4 mt-5">
|
||||||
|
{projects && projects.map((project) => <ProjectContainer key={project.uuid} project={project} />)}
|
||||||
|
</div>
|
||||||
|
{(projects != undefined && projects.length == 0) && (
|
||||||
|
<div className="w-full h-full flex justify-center items-center">
|
||||||
|
<Label className="text-muted-foreground">Nothing to Show</Label>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4 mt-5">
|
</>
|
||||||
{projects && projects.map((project) => <ProjectContainer key={project.uuid} project={project} />)}
|
|
||||||
</div>
|
|
||||||
{(projects != undefined && projects.length == 0) && (
|
|
||||||
<div className="w-full h-full flex justify-center items-center">
|
|
||||||
<Label className="text-muted-foreground">Nothing to Show</Label>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -32,7 +32,7 @@ const items: DashboardItem[] = [
|
|||||||
|
|
||||||
export const Dashboard = (): ReactNode => {
|
export const Dashboard = (): ReactNode => {
|
||||||
return (
|
return (
|
||||||
<Sidebar className="pl-safe">
|
<Sidebar className="pl-safe z-50">
|
||||||
<SidebarHeader className="flex justify-center items-center mt-safe-or-2">
|
<SidebarHeader className="flex justify-center items-center mt-safe-or-2">
|
||||||
<Link href="/">
|
<Link href="/">
|
||||||
<ClipFusionLogo width="30" height="30">
|
<ClipFusionLogo width="30" height="30">
|
||||||
|
@ -273,7 +273,7 @@ function SidebarTrigger({
|
|||||||
}}
|
}}
|
||||||
{...props}
|
{...props}
|
||||||
>
|
>
|
||||||
{open ? <PanelLeftOpenIcon/> : <PanelLeftCloseIcon/>}
|
{open ? <PanelLeftCloseIcon/> : <PanelLeftOpenIcon/>}
|
||||||
<span className="sr-only">Toggle Sidebar</span>
|
<span className="sr-only">Toggle Sidebar</span>
|
||||||
</Button>
|
</Button>
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user