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/(template)/file-upload/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import Template from '../../ui/view/atom/template';

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

function Layout({ children }: LayoutProps) {
return (
<>
<Image
src="/assets/background.png"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[request change]

  • local ์ด๋ฏธ์ง€๋‹ˆ๊นŒ next์˜ ์ปจ๋ฒค์…˜์„ ๋”ฐ๋ฅด๋Š”๊ฒŒ ์–ด๋–จ๊นŒ์š”?
  • src์— string๋ณด๋‹ค ์ด๋ฏธ์ง€๋ฅผ importํ•˜๊ณ  ๋„ฃ์–ด์ฃผ๋ฉด ์›๊ฒฉ ์ด๋ฏธ์ง€์™€ ๊ตฌ๋ถ„์ด ๋ช…ํ™•ํ•ด์งˆ ๊ฒƒ ๊ฐ™์•„์š”!
import Image from 'next/image'
import profilePic from './me.png'
 
export default function Page() {
  return (
    <Image
      src={profilePic}
      alt="Picture of the author"
      // width={500} automatically provided
      // height={500} automatically provided
      // blurDataURL="data:..." automatically provided
      // placeholder="blur" // Optional blur-up while loading
    />
  )
}

// ์ฐธ๊ณ 
https://nextjs.org/docs/app/building-your-application/optimizing/images#local-images

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/pretendard@v1.3.6/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/template.tsx
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[comment]

  • template ํŒŒ์ผ์ด ์ด ์œ„์น˜์— ์žˆ์–ด๋„ ์ ์šฉ์ด ๋˜๋‚˜์š”?
  • ์•„๋‹ˆ๋ฉด next๊ฐ€ ์ •์˜ํ•œ template์™€ ๋ณ„๊ฐœ์˜ template ์ปดํฌ๋„ŒํŠธ๋ฅผ ๋งŒ๋“ค๊ณ  ์‹ถ์—ˆ๋˜ ๊ฑด๊ฐ€์š”?

https://nextjs.org/docs/getting-started/project-structure#routing-files

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

content๋ฅผ ๋‹ด๋Š” box๋ฅผ ๋ณ„๊ฐœ์˜ ์ปดํฌ๋„ŒํŠธ๋กœ ์ƒ์„ฑํ•˜๋ ค๊ณ  ํ–ˆ์Šต๋‹ˆ๋‹ค.
๋‹ค๋งŒ, ๋„ค์ด๋ฐ์ด ์ ์ ˆํ•˜์ง€ ์•Š์€ ๊ฒƒ ๊ฐ™์•„์„œ ์ด๋ถ€๋ถ„์€ ContentContainer๋กœ ๋ณ€๊ฒฝํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { twMerge } from 'tailwind-merge';

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

export default function Template({ children, size = 'md', className }: TemplateProps) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Template๋ณด๋‹ค content layout์ด๋ผ๋Š” ์ด๋ฆ„์ด ๋” ์ ํ•ฉํ•˜์ง€ ์•Š์„๊นŒ์š”!? ๋˜ํ•œ atom ํด๋”์— ์žˆ๋Š” ๊ฒŒ ์ ํ•ฉํ•  ์ง€ ๋ชจ๋ฅด๊ฒ ์Šต๋‹ˆ๋‹ค!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

layout๋ณด๋‹ค๋Š” container์— ๊ฐ€๊น๋‹ค๋Š” ์ƒ๊ฐ์ด ๋“ค์–ด์„œ ContentContainer ํ•ด๋‹น ๋„ค์ด๋ฐ์œผ๋กœ ์ง„ํ–‰์„ ๊ณ„ํšํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค !
'๋” ์ด์ƒ ์ชผ๊ฐค ์ˆ˜ ์—†๋Š” ๋””์ž์ธ์˜ ์ตœ์†Œ ๋‹จ์œ„'๊ฐ€ ์šฐ๋ฆฌ๊ฐ€ ์ •์˜ํ•œ atom์˜ ๊ธฐ์ค€์ด์—ˆ๊ธฐ ๋•Œ๋ฌธ์— ํ•ด๋‹น ํด๋”์— ๋ถ„๋ฅ˜ํ•˜๋Š” ๊ฒƒ๋„ ๋ฌธ์ œ๊ฐ€ ๋˜์ง€ ์•Š๋Š”๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค. ํ˜น์‹œ ์ƒ๊ฐํ•˜์‹œ๋Š” ๋” ์ ํ•ฉํ•œ ๋ถ„๋ฅ˜๊ฐ€ ์žˆ๋‹ค๋ฉด, ์˜๊ฒฌ์„ ๋“ฃ๊ณ  ์‹ถ์Šต๋‹ˆ๋‹ค.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๊ณตํ†ต ์ปดํฌ๋„ŒํŠธ๋ณด๋‹ค layout ๊ฐœ๋…์— ๋” ๊ฐ€๊น์ง€ ์•Š์„๊นŒ ์ƒ๊ฐ์„ ํ–ˆ์—ˆ๋Š”๋ฐ ์ €ํฌ๊ฐ€ ์ •์˜ํ•œ atom ๋‹จ์œ„๊ฐ€ ๋” ์ด์ƒ ์ชผ๊ฐค ์ˆ˜ ์—†๋Š” ๋””์ž์ธ์˜ ์ตœ์†Œ ๋‹จ์œ„๋ผ๋ฉด ํฌ๊ฒŒ ์ƒ๊ด€ ์—†์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค~!

return (
<div
className={twMerge(
'absolute bg-white top-[7rem] z-10 rounded-xl p-[1.5rem] shadow-lg max-md:w-full',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

z-index๊ฐ€ ๋ฌด๋ถ„๋ณ„ํ•˜๊ฒŒ ์‚ฌ์šฉ๋  ์ˆ˜ ์žˆ๋Š” ๊ฑธ ๋ฐฉ์ง€ํ•˜๊ธฐ ์œ„ํ•ด ์ €๋Š” ์ข€ ์ •๋ฆฌํ•˜๋Š” ํŽธ์ธ๋ฐ tailwind config์— ์ด๋ ‡๊ฒŒ ์ •๋ฆฌํ•ด๋„ ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์š”~!

zIndex: {
      0: '1',
      1: '100', // Input
      2: '200', // Fixed bottom Bar, Sidebar, Tooltip
      3: '300', // Bottom bar, Top bar Backdrop
       ....
    },

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ข‹์€ ๋ฐฉ์‹์ธ ๊ฒƒ ๊ฐ™์•„์š” ์ ์šฉํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค ๐Ÿ‘

size === 'md' ? 'md:w-[70%]' : 'md:w-[80%]',
className,
)}
>
{children}
</div>
);
}
15 changes: 15 additions & 0 deletions app/ui/view/molecule/navigation-bar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import Image from 'next/image';

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="/assets/logo.svg"
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.
Loading