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

layout/#31 #32

Merged
merged 9 commits into from
Feb 23, 2024
10 changes: 10 additions & 0 deletions app/(sub-page)/file-upload/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import ContentContainer from '../../ui/view/atom/content-container';

export default function Page() {
return (
<ContentContainer className="flex flex-col items-center gap-8">
<div>์š”์†Œ1</div>
<div>์š”์†Œ2</div>
</ContentContainer>
);
}
17 changes: 17 additions & 0 deletions app/(sub-page)/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Image from 'next/image';
import background from '../../public/assets/background.png';
import NavigationBar from '../ui/view/molecule/navigation-bar';
interface LayoutProps {
children: React.ReactNode;
}

function Layout({ children }: LayoutProps) {
return (
<>
<Image src={background} width={800} height={288} className="w-full bg-white h-[18rem]" alt="background" />
<div className="flex justify-center">{children}</div>
</>
);
}

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

export const metadata: Metadata = {
title: 'Create Next App',
Expand All @@ -12,14 +13,19 @@ export default function RootLayout({
children: React.ReactNode;
}>) {
return (
<html lang="en">
<html lang="ko">
<head>
<link
href="https://cdn.jsdelivr.net/gh/orioncactus/[email protected]/dist/web/static/pretendard.css"
rel="stylesheet"
/>
</head>
<body>{children}</body>
<body>
<div className="bg-white w-[100vw] h-[100vh]">
<NavigationBar />
{children}
</div>
</body>
</html>
);
}
21 changes: 21 additions & 0 deletions app/ui/view/atom/content-container.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { twMerge } from 'tailwind-merge';

interface ContentContainerProps {
children: React.ReactNode;
size?: 'md' | 'lg';
className?: string;
}

export default function ContentContainer({ children, size = 'md', className }: ContentContainerProps) {
return (
<div
className={twMerge(
'absolute bg-white top-[7rem] zIndex-1 rounded-xl p-[1.5rem] shadow-lg max-md:w-full',
size === 'md' ? 'md:w-[70%]' : 'md:w-[80%]',
className,
)}
>
{children}
</div>
);
}
10 changes: 10 additions & 0 deletions app/ui/view/molecule/navigation-bar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import Image from 'next/image';
import logo from '../../../../public/assets/logo.svg';

export default function NavigationBar() {
return (
<div className="absolute p-4 border-b-[1px] w-full">
<Image className="md:h-10 h-7 w-[110px] md:w-[150px]" width={150} height={100} src={logo} alt="main-logo" />
</div>
);
}
Binary file added public/assets/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 51 additions & 0 deletions public/assets/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ const config: Config = {
red: '#FF6D6D',
'white-hover': '#f3f4f6',
},
zIndex: {
1: '100', // upper layout
2: '200', // upper content
3: '300', // upper all
},
},
},
plugins: [headlessui],
Expand Down
Loading