Skip to content

Commit

Permalink
Extract layout components
Browse files Browse the repository at this point in the history
  • Loading branch information
balintking committed Dec 12, 2024
1 parent dbd1413 commit d566741
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 38 deletions.
16 changes: 14 additions & 2 deletions apps/frontend/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ import './globals.css';
import { GeistSans } from 'geist/font/sans';
import type { Metadata } from 'next';

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: 'MMMK',
description: 'MMMK Rehearsal Room Booking Platform',
description: 'MMMK Homepage and Rehearsal Room Booking Platform',
};

export default function RootLayout({
Expand All @@ -19,7 +23,15 @@ export default function RootLayout({
<html lang='hu'>
<body className={`${GeistSans.className}`}>
<ThemeProvider attribute='class' defaultTheme='dark' enableSystem disableTransitionOnChange>
{children}
<div className='h-screen flex flex-col'>
<Header />
<div className='flex-1 flex overflow-hidden'>
<Sidebar />
{children}
<RightSidebar />
</div>
<Player />
</div>
</ThemeProvider>
</body>
</html>
Expand Down
16 changes: 1 addition & 15 deletions apps/frontend/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
import { Header } from '@/components/header';
import { MainContent } from '@/components/main-content';
import { Player } from '@/components/player';
import { RightSidebar } from '@/components/right-sidebar';
import { Sidebar } from '@/components/sidebar';

export default function Home() {
return (
<div className='h-screen flex flex-col'>
<Header />
<div className='flex-1 flex overflow-hidden'>
<Sidebar />
<MainContent />
<RightSidebar />
</div>
<Player />
</div>
);
return <MainContent />;
}
12 changes: 0 additions & 12 deletions apps/frontend/src/components/hello-world.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function Header() {

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

Expand All @@ -44,7 +44,7 @@ export function Header() {
</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuItem asChild>
<Link href='/'>Profile</Link>
<Link href='/apps/frontend/public'>Profile</Link>
</DropdownMenuItem>
<DropdownMenuItem>Log out</DropdownMenuItem>
</DropdownMenuContent>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ export function Sidebar() {
<div className='space-y-4'>
<div className='space-y-2'>
<Button variant='ghost' className='w-full justify-start' asChild>
<Link href='/'>
<Link href='/apps/frontend/public'>
<Radio className='mr-2 h-4 w-4' />
Feed
</Link>
</Button>
<Button variant='ghost' className='w-full justify-start' asChild>
<Link href='/'>
<Link href='/apps/frontend/public'>
<ListMusic className='mr-2 h-4 w-4' />
Bands
</Link>
Expand All @@ -26,13 +26,13 @@ export function Sidebar() {
<h2 className='text-xs uppercase text-zinc-400 font-bold mb-2'>About Us</h2>
<div className='space-y-2'>
<Button variant='ghost' className='w-full justify-start' asChild>
<Link href='/'>
<Link href='/apps/frontend/public'>
<Heart className='mr-2 h-4 w-4' />
MMMK
</Link>
</Button>
<Button variant='ghost' className='w-full justify-start' asChild>
<Link href='/'>
<Link href='/apps/frontend/public'>
<MicVocal className='mr-2 h-4 w-4' />
The Room
</Link>
Expand All @@ -44,13 +44,13 @@ export function Sidebar() {
<h2 className='text-xs uppercase text-zinc-400 font-bold mb-2'>For Members</h2>
<div className='space-y-2'>
<Button variant='ghost' className='w-full justify-start' asChild>
<Link href='/'>
<Link href='/apps/frontend/public'>
<CalendarPlus className='mr-2 h-4 w-4' />
New Reservations
</Link>
</Button>
<Button variant='ghost' className='w-full justify-start' asChild>
<Link href='/'>
<Link href='/apps/frontend/public'>
<BarChart3 className='mr-2 h-4 w-4' />
Statistics
</Link>
Expand All @@ -62,7 +62,7 @@ export function Sidebar() {
<h2 className='text-xs uppercase text-zinc-400 font-bold mb-2'>Admin</h2>
<div className='space-y-2'>
<Button variant='ghost' className='w-full justify-start' asChild>
<Link href='/'>
<Link href='/apps/frontend/public'>
<KeyboardMusic className='mr-2 h-4 w-4' />
Super View
</Link>
Expand Down

0 comments on commit d566741

Please sign in to comment.