Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
],
"plugins": ["prettier"],
"rules": {
"prettier/prettier": ["error"]
"prettier/prettier": ["error"],
"no-unused-vars": "warn",
"@typescript-eslint/no-unused-vars": "warn"
}
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
"lint": "next lint",
"lint:ci": "next lint --config .eslintrc.ci.json"
},
"dependencies": {
"axios": "^1.7.7",
Expand Down
3 changes: 3 additions & 0 deletions src/app/(with-header-sidebar)/layout.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.header {
color: yellowgreen;
Copy link
Owner

Choose a reason for hiding this comment

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

variables.css ์— ์ •์˜๋˜์ง€ ์•Š์€ ์ƒ‰์ƒ์„ ์‚ฌ์šฉํ•˜์…จ๋Š”๋ฐ
์ž„์‹œ๋กœ ์„ค์ •ํ•˜์‹ ๊ฑด๊ฐ€์š”?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

๋„ต..! ์ ์šฉ ์ž˜๋˜๋Š”์ง€ ํ™•์ธ์šฉ ์ž„์‹œ์ž…๋‹ˆ๋‹ค!

}
16 changes: 16 additions & 0 deletions src/app/(with-header-sidebar)/layout.tsx
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>
</>
);
}
3 changes: 3 additions & 0 deletions src/app/(with-header-sidebar)/mydashboard/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function Page() {
return <div>my page</div>;
}
3 changes: 3 additions & 0 deletions src/components/Header.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.header {
color: skyblue;
}
9 changes: 9 additions & 0 deletions src/components/Header.tsx
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>;
}
3 changes: 3 additions & 0 deletions src/components/SideBar.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.active {
color: salmon;
}
26 changes: 26 additions & 0 deletions src/components/SideBar.tsx
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>
);
}
Loading