From 402f775e2c342b90b189cc69871a666e85fbd72d Mon Sep 17 00:00:00 2001 From: heejin Date: Fri, 15 Nov 2024 17:32:51 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=E2=9C=A8=20feat:=20add=20header=20and=20si?= =?UTF-8?q?debar=20layout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../(with-header-sidebar)/layout.module.css | 3 +++ src/app/(with-header-sidebar)/layout.tsx | 16 ++++++++++++ .../mydashboard/page.tsx | 3 +++ src/components/Header.module.css | 3 +++ src/components/Header.tsx | 9 +++++++ src/components/SideBar.module.css | 3 +++ src/components/SideBar.tsx | 26 +++++++++++++++++++ 7 files changed, 63 insertions(+) create mode 100644 src/app/(with-header-sidebar)/layout.module.css create mode 100644 src/app/(with-header-sidebar)/layout.tsx create mode 100644 src/app/(with-header-sidebar)/mydashboard/page.tsx create mode 100644 src/components/Header.module.css create mode 100644 src/components/Header.tsx create mode 100644 src/components/SideBar.module.css create mode 100644 src/components/SideBar.tsx diff --git a/src/app/(with-header-sidebar)/layout.module.css b/src/app/(with-header-sidebar)/layout.module.css new file mode 100644 index 0000000..1dfd0fb --- /dev/null +++ b/src/app/(with-header-sidebar)/layout.module.css @@ -0,0 +1,3 @@ +.header { + color: yellowgreen; +} diff --git a/src/app/(with-header-sidebar)/layout.tsx b/src/app/(with-header-sidebar)/layout.tsx new file mode 100644 index 0000000..c085669 --- /dev/null +++ b/src/app/(with-header-sidebar)/layout.tsx @@ -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 ( + <> +
+ +
{children}
+ + ); +} diff --git a/src/app/(with-header-sidebar)/mydashboard/page.tsx b/src/app/(with-header-sidebar)/mydashboard/page.tsx new file mode 100644 index 0000000..6540575 --- /dev/null +++ b/src/app/(with-header-sidebar)/mydashboard/page.tsx @@ -0,0 +1,3 @@ +export default function Page() { + return
my page
; +} diff --git a/src/components/Header.module.css b/src/components/Header.module.css new file mode 100644 index 0000000..034074a --- /dev/null +++ b/src/components/Header.module.css @@ -0,0 +1,3 @@ +.header { + color: skyblue; +} diff --git a/src/components/Header.tsx b/src/components/Header.tsx new file mode 100644 index 0000000..e4e0cf7 --- /dev/null +++ b/src/components/Header.tsx @@ -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
헤더 {pathname}
; +} diff --git a/src/components/SideBar.module.css b/src/components/SideBar.module.css new file mode 100644 index 0000000..4b8c8dd --- /dev/null +++ b/src/components/SideBar.module.css @@ -0,0 +1,3 @@ +.active { + color: salmon; +} diff --git a/src/components/SideBar.tsx b/src/components/SideBar.tsx new file mode 100644 index 0000000..fe709f6 --- /dev/null +++ b/src/components/SideBar.tsx @@ -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 ( +
+ + 대시보드1 + + + 대시보드2 + +
+ ); +} From 89b07497e588f690463f24676fee451bbf7e402a Mon Sep 17 00:00:00 2001 From: heejin Date: Fri, 15 Nov 2024 18:01:05 +0900 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=91=B7=20chore:=20add=20no-unused-var?= =?UTF-8?q?s=20off=20on=20ci=20lint?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.ci.json | 13 +++++++++++++ .github/workflows/lint.yml | 2 +- package.json | 3 ++- 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 .eslintrc.ci.json diff --git a/.eslintrc.ci.json b/.eslintrc.ci.json new file mode 100644 index 0000000..9d0157c --- /dev/null +++ b/.eslintrc.ci.json @@ -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" + } +} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a507465..4210aad 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -27,4 +27,4 @@ jobs: run: npm install - name: Run Next.js Lint - run: npm run lint + run: npm run lint:ci diff --git a/package.json b/package.json index bace2a1..a4eb0b3 100644 --- a/package.json +++ b/package.json @@ -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", From a4ee55c4b8e9112be087fac1edfb7679c1135c7a Mon Sep 17 00:00:00 2001 From: heejin Date: Fri, 15 Nov 2024 18:51:44 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=9A=80=20chore:=20make=20no-unused-va?= =?UTF-8?q?rs=20as=20warn?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.ci.json | 13 ------------- .eslintrc.json | 4 +++- .github/workflows/lint.yml | 2 +- 3 files changed, 4 insertions(+), 15 deletions(-) delete mode 100644 .eslintrc.ci.json diff --git a/.eslintrc.ci.json b/.eslintrc.ci.json deleted file mode 100644 index 9d0157c..0000000 --- a/.eslintrc.ci.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "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" - } -} diff --git a/.eslintrc.json b/.eslintrc.json index fc4b170..82d37c6 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -6,6 +6,8 @@ ], "plugins": ["prettier"], "rules": { - "prettier/prettier": ["error"] + "prettier/prettier": ["error"], + "no-unused-vars": "warn", + "@typescript-eslint/no-unused-vars": "warn" } } diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4210aad..a507465 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -27,4 +27,4 @@ jobs: run: npm install - name: Run Next.js Lint - run: npm run lint:ci + run: npm run lint