Skip to content

Commit

Permalink
refactor: 폴더 구조 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
yougyung committed Feb 21, 2024
1 parent d3b9e5b commit f0e3675
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Template from '../ui/view/atom/template';
import Template from '../../ui/view/atom/template';

export default function Page() {
return (
Expand Down
17 changes: 4 additions & 13 deletions app/ui/view/template/layout.tsx → app/(template)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
'use client';
import { usePathname } from 'next/navigation';
import NavigationBar from '../molecule/navigation-bar';
import Image from 'next/image';

import NavigationBar from '../ui/view/molecule/navigation-bar';
interface LayoutProps {
children: React.ReactNode;
}

function Layout({ children }: LayoutProps) {
const pathname = usePathname();
const isMainPage = pathname === '/';

return isMainPage ? (
children
) : (
<div className="bg-white w-[100vw] h-[100vh]">
<NavigationBar />
return (
<>
<Image
src="/assets/background.png"
width={800}
Expand All @@ -24,7 +15,7 @@ function Layout({ children }: LayoutProps) {
alt="background"
/>
<div className="flex justify-center">{children}</div>
</div>
</>
);
}

Expand Down
7 changes: 5 additions & 2 deletions app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Metadata } from 'next';
import './globals.css';
import Layout from './ui/view/template/layout';
import NavigationBar from './ui/view/molecule/navigation-bar';

export const metadata: Metadata = {
title: 'Create Next App',
Expand All @@ -21,7 +21,10 @@ export default function RootLayout({
/>
</head>
<body>
<Layout>{children}</Layout>
<div className="bg-white w-[100vw] h-[100vh]">
<NavigationBar />
{children}
</div>
</body>
</html>
);
Expand Down

0 comments on commit f0e3675

Please sign in to comment.