-
Notifications
You must be signed in to change notification settings - Fork 1
[feat] add header and sidebar layout #2
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| { | ||
| "extends": [ | ||
| "next/core-web-vitals", | ||
| "next/typescript", | ||
| "plugin:prettier/recommended" | ||
| ], | ||
| "plugins": ["prettier"], | ||
| "rules": { | ||
| "prettier/prettier": ["error"], | ||
| "no-unused-vars": "off", | ||
| "@typescript-eslint/no-unused-vars": "off" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,4 +27,4 @@ jobs: | |
| run: npm install | ||
|
|
||
| - name: Run Next.js Lint | ||
| run: npm run lint | ||
| run: npm run lint:ci | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| .header { | ||
| color: yellowgreen; | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. variables.css ์ ์ ์๋์ง ์์ ์์์ ์ฌ์ฉํ์
จ๋๋ฐ
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ๋ต..! ์ ์ฉ ์๋๋์ง ํ์ธ์ฉ ์์์ ๋๋ค! |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| import { ReactNode } from 'react'; | ||
| import SideBar from '@/components/SideBar'; | ||
| import styles from './layout.module.css'; | ||
| import Header from '@/components/Header'; | ||
|
|
||
| export default function Layout({ children }: { children: ReactNode }) { | ||
| return ( | ||
| <> | ||
| <Header /> | ||
| <nav> | ||
| <SideBar /> | ||
| </nav> | ||
| <main>{children}</main> | ||
| </> | ||
| ); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| export default function Page() { | ||
| return <div>my page</div>; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| .header { | ||
| color: skyblue; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| 'use client'; | ||
| import { usePathname } from 'next/navigation'; | ||
| import styles from './Header.module.css'; | ||
|
|
||
| export default function Header() { | ||
| const pathname = usePathname(); | ||
|
|
||
| return <header className={styles.header}>ํค๋ {pathname}</header>; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| .active { | ||
| color: salmon; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| 'use client'; | ||
|
|
||
| import Link from 'next/link'; | ||
| import { usePathname } from 'next/navigation'; | ||
| import styles from './SideBar.module.css'; | ||
|
|
||
| export default function SideBar() { | ||
| const pathname = usePathname(); | ||
|
|
||
| return ( | ||
| <div> | ||
| <Link | ||
| href={'/dashboard/1'} | ||
| className={`link ${pathname === '/dashboard/1' ? styles.active : ''}`} | ||
| > | ||
| ๋์๋ณด๋1 | ||
| </Link> | ||
| <Link | ||
| href={'/dashboard/2'} | ||
| className={`link ${pathname === '/dashboard/2' ? styles.active : ''}`} | ||
| > | ||
| ๋์๋ณด๋2 | ||
| </Link> | ||
| </div> | ||
| ); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ด๋ ๊ฒ ํ์ผ์ ์๋ก ์์ฑํ๊ธฐ ๋ณด๋ค๋
์๋ฌ๋ฅผ ๊ฒฝ๊ณ ์์ค์ผ๋ก ๋ฎ์ถ๊ธฐ๋ง ํ๋ฉด ๋ค ํด๊ฒฐ๋ ๊ฒ ๊ฐ์๋ฐ ์ด๋ป๊ฒ ์๊ฐํ์ธ์?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@najitwo ์๊ฑฐ๋ ๋ก์ปฌ์์ํ ๋๋ ๋นจ๊ฐ๊ฒ ๋จ๊ฒ ํ๊ณ ์ถ์ด์ warn์ผ๋ก ์ํ๊ธดํ๊ฑฐ๋ ์
warn์ผ๋ก ํ ๊น์..?ใ ใ ใ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ ธ๋๊ฒ ๋จ๋๊น... warn์ผ๋ก ํ์์ฃ !