-
-
Notifications
You must be signed in to change notification settings - Fork 789
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
382 additions
and
34 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
49 changes: 49 additions & 0 deletions
49
src/app/(dashboard)/app/_components/create-plus-dropdown-menu.tsx
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,49 @@ | ||
import { Button } from '@/primitives/button'; | ||
import { | ||
DropdownMenu, | ||
DropdownMenuContent, | ||
DropdownMenuItem, | ||
DropdownMenuSeparator, | ||
DropdownMenuTrigger, | ||
} from '@/primitives/dropdown-menu'; | ||
import { | ||
PlusIcon, | ||
ChevronDownIcon, | ||
PuzzleIcon, | ||
PenLineIcon, | ||
ListChecksIcon, | ||
DiamondIcon, | ||
} from 'lucide-react'; | ||
|
||
export function CreatePlusDropdownMenu() { | ||
return ( | ||
<DropdownMenu> | ||
<DropdownMenuTrigger asChild> | ||
<Button variant="outline" size="sm" className="gap-2 p-2"> | ||
<PlusIcon size={15} /> | ||
<ChevronDownIcon size={13} strokeWidth={1.5} /> | ||
</Button> | ||
</DropdownMenuTrigger> | ||
|
||
<DropdownMenuContent className="w-48"> | ||
<DropdownMenuItem> | ||
<PuzzleIcon size={15} className="mr-2" /> | ||
<span>New Module</span> | ||
</DropdownMenuItem> | ||
<DropdownMenuItem> | ||
<PenLineIcon size={15} className="mr-2" /> | ||
<span>New Notebook</span> | ||
</DropdownMenuItem> | ||
<DropdownMenuSeparator /> | ||
<DropdownMenuItem> | ||
<ListChecksIcon size={15} className="mr-2" /> | ||
<span>New Task</span> | ||
</DropdownMenuItem> | ||
<DropdownMenuItem> | ||
<DiamondIcon size={15} className="mr-2" /> | ||
<span>New Flashcard</span> | ||
</DropdownMenuItem> | ||
</DropdownMenuContent> | ||
</DropdownMenu> | ||
); | ||
} |
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 |
---|---|---|
@@ -1,13 +1,21 @@ | ||
import { | ||
BellIcon, | ||
CircleHelpIcon, | ||
DiamondIcon, | ||
FolderIcon, | ||
HomeIcon, | ||
ListChecksIcon, | ||
MessageSquareMore, | ||
PanelLeftCloseIcon, | ||
PenLineIcon, | ||
PuzzleIcon, | ||
} from 'lucide-react'; | ||
import Image from 'next/image'; | ||
import type { PropsWithChildren } from 'react'; | ||
import { ActiveButton } from './_components/active-button'; | ||
import { CreatePlusDropdownMenu } from './_components/create-plus-dropdown-menu'; | ||
import { Button } from '@/primitives/button'; | ||
import { UserButton } from '@clerk/nextjs'; | ||
|
||
const iconSize = 15; | ||
|
||
|
@@ -41,22 +49,76 @@ const sideMenuStaticLinks = [ | |
|
||
export default function AppLayout({ children }: PropsWithChildren) { | ||
return ( | ||
<main className="flex min-h-dvh gap-8 p-4"> | ||
<aside className="w-[220px]"> | ||
<div className="flex items-center gap-3 pl-3 pt-4"> | ||
<Image src="/logo.svg" width={35} height={35} alt="Noodle Logo" /> | ||
<span>Noodle</span> | ||
<main className="flex min-h-dvh gap-4 p-4"> | ||
<aside className="flex w-[200px] flex-col justify-between"> | ||
<div> | ||
<div className="flex items-center gap-3 pl-3 pt-4"> | ||
<Image src="/logo.svg" width={35} height={35} alt="Noodle Logo" /> | ||
<span>Noodle</span> | ||
</div> | ||
|
||
<ul className="mt-8 flex flex-col"> | ||
{sideMenuStaticLinks.map(({ icon, label, href }) => ( | ||
<li key={label} className="flex flex-1 flex-col"> | ||
<ActiveButton icon={icon} label={label} href={href} /> | ||
</li> | ||
))} | ||
</ul> | ||
|
||
<div className="mt-6 space-y-2"> | ||
<h3 className="pl-4 text-xs text-gray">Modules</h3> | ||
<ul className="flex flex-col"> | ||
<li className="flex flex-1 flex-col"> | ||
<ActiveButton | ||
href="/modules/ai" | ||
icon={<FolderIcon size={15} strokeWidth={1.5} />} | ||
label="Artificial Intelligence" | ||
/> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
|
||
<ul className="mt-8"> | ||
{sideMenuStaticLinks.map(({ icon, label, href }) => ( | ||
<li key={label}> | ||
<ActiveButton icon={icon} label={label} href={href} /> | ||
</li> | ||
))} | ||
</ul> | ||
<div className="mb-6 flex flex-col"> | ||
<Button | ||
variant="ghost" | ||
className="justify-start gap-3 font-normal" | ||
asChild | ||
> | ||
<a href="mailto:[email protected]"> | ||
<MessageSquareMore size={15} strokeWidth={1.5} /> Feedback | ||
</a> | ||
</Button> | ||
<Button | ||
variant="ghost" | ||
className="justify-start gap-3 font-normal" | ||
asChild | ||
> | ||
<a href="mailto:[email protected]"> | ||
<CircleHelpIcon size={15} strokeWidth={1.5} /> Help & Support | ||
</a> | ||
</Button> | ||
</div> | ||
</aside> | ||
<div className="flex-1 rounded-lg border p-6">{children}</div> | ||
|
||
<div className="flex flex-1 flex-col rounded-xl border px-6 pb-6 pt-4"> | ||
<nav className="mb-6 flex items-center justify-between"> | ||
<div> | ||
<Button variant="ghost" size="icon" className="-ml-2"> | ||
<PanelLeftCloseIcon strokeWidth={1.5} size={18} /> | ||
</Button> | ||
</div> | ||
<div className="flex items-center gap-4"> | ||
<CreatePlusDropdownMenu /> | ||
<Button variant="ghost" size="icon"> | ||
<BellIcon size={18} /> | ||
</Button> | ||
<UserButton /> | ||
</div> | ||
</nav> | ||
|
||
{children} | ||
</div> | ||
</main> | ||
); | ||
} |
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 |
---|---|---|
@@ -1,14 +1,18 @@ | ||
import { SignOutButton } from '@clerk/nextjs'; | ||
|
||
/** | ||
* This is the main page for the dashboard. | ||
* @returns A Next.js RSC page component. | ||
*/ | ||
export default function DashboardHome() { | ||
return ( | ||
<div> | ||
<h1>Hello World</h1> | ||
<SignOutButton /> | ||
<div className="flex flex-1"> | ||
<div className="flex-1"> | ||
<div className="space-y-3"> | ||
<h1 className="text-4xl font-semibold">Good afternoon, Ahmed!</h1> | ||
<p className="max-w-prose text-balance text-sm leading-6 text-foreground-muted"> | ||
“The final wisdom of life requires not the annulment of incongruity | ||
but the achievement of serenity within and above it.” - Reinhold | ||
Niebuhr | ||
</p> | ||
</div> | ||
<div>More content</div> | ||
</div> | ||
<div className="min-w-[280px] rounded-lg border p-4">Right side</div> | ||
</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
Oops, something went wrong.