-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #162 from Donggrina/feature/middleware
Feat: middleware 작업 완료
- Loading branch information
Showing
8 changed files
with
22 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,5 +15,6 @@ export class MiddlewareData { | |
'/calendar/:path*', | ||
'/growth/:path*', | ||
'/story/:path*', | ||
'/mypage/:path*', | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,15 @@ | ||
import { NextRouter } from 'next/router'; | ||
|
||
export const isNav = (router: NextRouter) => { | ||
const navPaths = ['/calendar', '/family', '/diaries', '/growth', '/story']; | ||
console.log(navPaths.some((path) => router.pathname === path)); | ||
const navPaths = [ | ||
'/calendar', | ||
'/family', | ||
'/diaries', | ||
'/growth', | ||
'/story', | ||
'/mypage', | ||
'/mypage/pet', | ||
'/mypage/family-management', | ||
]; | ||
return navPaths.some((path) => router.pathname === path); | ||
}; |