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

Dashboard design skeleton #14

Merged
merged 12 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 9 additions & 5 deletions apps/frontend/components.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "default",
"style": "new-york",
"rsc": true,
"tsx": true,
"tailwind": {
"config": "tailwind.config.ts",
"css": "src/app/globals.css",
"baseColor": "slate",
"cssVariables": false,
"baseColor": "zinc",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils"
}
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
},
"iconLibrary": "lucide"
}
20 changes: 14 additions & 6 deletions apps/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,30 @@
"lint": "next lint"
},
"dependencies": {
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.0",
"lucide-react": "^0.372.0",
"@radix-ui/react-avatar": "^1.1.1",
"@radix-ui/react-dropdown-menu": "^2.1.2",
"@radix-ui/react-slider": "^1.2.1",
"@radix-ui/react-slot": "^1.1.0",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"framer-motion": "^11.14.4",
"geist": "^1.3.1",
"lucide-react": "^0.468.0",
"next": "14.2.13",
"next-themes": "^0.4.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"tailwind-merge": "^2.3.0",
"tailwind-merge": "^2.5.5",
"tailwindcss-animate": "^1.0.7"
},
"devDependencies": {
"@shadcn/ui": "^0.0.4",
"@types/node": "^20.12.7",
"@types/react": "^18.2.79",
"@types/react-dom": "^18.2.25",
"eslint-plugin-react": "^7.34.1",
"postcss": "^8.4.38",
"tailwindcss": "^3.4.3",
"typescript": "^5.4.5",
"eslint-plugin-react": "^7.34.1"
"typescript": "^5.4.5"
}
}
66 changes: 64 additions & 2 deletions apps/frontend/src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,68 @@
@tailwind components;
@tailwind utilities;

body {
@apply bg-slate-100;
@layer base {
:root {
--background: 0 0% 100%;
--foreground: 20 14.3% 4.1%;
--card: 0 0% 100%;
--card-foreground: 20 14.3% 4.1%;
--popover: 0 0% 100%;
--popover-foreground: 20 14.3% 4.1%;
--primary: 24.6 95% 53.1%;
--primary-foreground: 60 9.1% 97.8%;
--secondary: 60 4.8% 95.9%;
--secondary-foreground: 24 9.8% 10%;
--muted: 60 4.8% 95.9%;
--muted-foreground: 25 5.3% 44.7%;
--accent: 60 4.8% 95.9%;
--accent-foreground: 24 9.8% 10%;
--destructive: 0 84.2% 60.2%;
--destructive-foreground: 60 9.1% 97.8%;
--border: 20 5.9% 90%;
--input: 20 5.9% 90%;
--ring: 24.6 95% 53.1%;
--radius: 0.75rem;
--chart-1: 12 76% 61%;
--chart-2: 173 58% 39%;
--chart-3: 197 37% 24%;
--chart-4: 43 74% 66%;
--chart-5: 27 87% 67%;
}

.dark {
--background: 20 14.3% 4.1%;
--foreground: 60 9.1% 97.8%;
--card: 20 14.3% 4.1%;
--card-foreground: 60 9.1% 97.8%;
--popover: 20 14.3% 4.1%;
--popover-foreground: 60 9.1% 97.8%;
--primary: 20.5 90.2% 48.2%;
--primary-foreground: 60 9.1% 97.8%;
--secondary: 12 6.5% 15.1%;
--secondary-foreground: 60 9.1% 97.8%;
--muted: 12 6.5% 15.1%;
--muted-foreground: 24 5.4% 63.9%;
--accent: 12 6.5% 15.1%;
--accent-foreground: 60 9.1% 97.8%;
--destructive: 0 72.2% 50.6%;
--destructive-foreground: 60 9.1% 97.8%;
--border: 12 6.5% 15.1%;
--input: 12 6.5% 15.1%;
--ring: 20.5 90.2% 48.2%;
--chart-1: 220 70% 50%;
--chart-2: 160 60% 45%;
--chart-3: 30 80% 55%;
--chart-4: 280 65% 60%;
--chart-5: 340 75% 55%;
}
}

@layer base {
* {
@apply border-border;
}
body {
@apply bg-background text-foreground;
}
}
26 changes: 21 additions & 5 deletions apps/frontend/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import './globals.css';

import { GeistSans } from 'geist/font/sans';
import type { Metadata } from 'next';
import { Inter } from 'next/font/google';

const inter = Inter({ subsets: ['latin'] });
import { Header } from '@/components/layout/header';
import { Player } from '@/components/layout/player';
import { RightSidebar } from '@/components/layout/right-sidebar';
import { Sidebar } from '@/components/layout/sidebar';
import { ThemeProvider } from '@/components/theme-provider';

export const metadata: Metadata = {
title: 'NextJS Frontend',
description: 'Generated by create next app',
title: 'MMMK',
description: 'MMMK Homepage and Rehearsal Room Booking Platform',
};

export default function RootLayout({
Expand All @@ -17,7 +21,19 @@ export default function RootLayout({
}>) {
return (
<html lang='hu'>
<body className={inter.className}>{children}</body>
<body className={`${GeistSans.className}`}>
<ThemeProvider attribute='class' defaultTheme='dark' enableSystem>
<div className='h-screen flex flex-col'>
<Header />
<div className='flex-1 flex overflow-hidden'>
<Sidebar />
{children}
<RightSidebar />
</div>
<Player />
</div>
</ThemeProvider>
</body>
</html>
);
}
8 changes: 2 additions & 6 deletions apps/frontend/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import { HelloWorld } from '@/components/hello-world';
import { MainContent } from '@/components/main-content';

export default function Home() {
return (
<main className='flex items-center justify-center'>
<HelloWorld className='mt-10' />
</main>
);
return <MainContent />;
}
12 changes: 0 additions & 12 deletions apps/frontend/src/components/hello-world.tsx

This file was deleted.

73 changes: 73 additions & 0 deletions apps/frontend/src/components/layout/header.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
'use client';

import { GeistSans } from 'geist/font/sans';
import { ChevronRight } from 'lucide-react';
import Link from 'next/link';

import { ThemeToggle } from '@/components/layout/theme-toggle';
import ActionButton from '@/components/ui/action-button';
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';
import { Button } from '@/components/ui/button';
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuSeparator,
DropdownMenuTrigger,
} from '@/components/ui/dropdown-menu';

export function Header() {
const isLoggedIn = true;
const user = {
name: 'John Doe',
email: '[email protected]',
image: '/placeholder.svg',
};

return (
<header className='px-4 py-4 flex items-center justify-between'>
<Link href='/' className='flex items-center space-x-2'>
<span className={`${GeistSans.className} text-2xl font-bold tracking-tighter`}>MMMK</span>
</Link>

<div className='w-80 pl-8 flex items-center justify-between'>
<ActionButton
text='My Bands'
icon={<ChevronRight />}
variant='outline'
className='h-10 rounded-full font-light hover:bg-transparent'
/>

<div className='flex gap-3 items-center'>
<ThemeToggle />

{isLoggedIn ? (
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button variant='outline' className='relative h-10 w-10 rounded-full'>
<Avatar className='h-8 w-8'>
<AvatarImage src={user.image} alt={user.name} />
<AvatarFallback>{user.name.charAt(0)}</AvatarFallback>
</Avatar>
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent className='w-56' align='end' forceMount>
<DropdownMenuItem className='flex flex-col items-start'>
<div className='font-medium'>{user.name}</div>
<div className='text-sm text-zinc-500'>{user.email}</div>
</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuItem asChild>
<Link href='/'>Profile</Link>
</DropdownMenuItem>
<DropdownMenuItem>Log out</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
) : (
<Button variant='outline'>Log in</Button>
)}
</div>
</div>
</header>
);
}
76 changes: 76 additions & 0 deletions apps/frontend/src/components/layout/player.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import {
Heart,
ListMusic,
Mic2,
MoreHorizontal,
Play,
Repeat,
Shuffle,
SkipBack,
SkipForward,
Volume2,
} from 'lucide-react';
import Image from 'next/image';

import { Button } from '@/components/ui/button';
import { Slider } from '@/components/ui/slider';

export function Player() {
FearsomeRover marked this conversation as resolved.
Show resolved Hide resolved
return (
<div className='h-20 border-t border-zinc-800 p-4 flex items-center justify-between'>
<div className='flex items-center space-x-4'>
<Image src='/placeholder.svg' alt='Album cover' width={48} height={48} className='rounded' />
<div>
<h3 className='font-medium'>Welcome To Horrorwood</h3>
<p className='text-sm text-zinc-400'>Ice Nine Kills</p>
</div>
<Button size='icon' variant='ghost'>
<Heart className='h-4 w-4' />
</Button>
</div>

<div className='flex flex-col items-center'>
<div className='flex items-center space-x-4'>
<Button size='icon' variant='ghost'>
<Shuffle className='h-4 w-4' />
</Button>
<Button size='icon' variant='ghost'>
<SkipBack className='h-4 w-4' />
</Button>
<Button size='icon' className='h-8 w-8 bg-orange-500 hover:bg-orange-600'>
<Play className='h-4 w-4' />
</Button>
<Button size='icon' variant='ghost'>
<SkipForward className='h-4 w-4' />
</Button>
<Button size='icon' variant='ghost'>
<Repeat className='h-4 w-4' />
</Button>
</div>
<div className='flex items-center space-x-2 text-sm text-zinc-400'>
<span>1:55</span>
<div className='w-96 h-1 bg-zinc-800 rounded-full'>
<div className='w-1/3 h-full bg-orange-500 rounded-full' />
</div>
<span>3:47</span>
</div>
</div>

<div className='flex items-center space-x-4'>
<Button size='icon' variant='ghost'>
<Mic2 className='h-4 w-4' />
</Button>
<Button size='icon' variant='ghost'>
<ListMusic className='h-4 w-4' />
</Button>
<div className='flex items-center space-x-2'>
<Volume2 className='h-4 w-4' />
<Slider defaultValue={[66]} max={100} step={1} className='w-24' />
</div>
<Button size='icon' variant='ghost'>
<MoreHorizontal className='h-4 w-4' />
</Button>
</div>
</div>
);
}
Loading
Loading