-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
finish. missing: page transition - required: Layout
- Loading branch information
1 parent
d8cdb1f
commit fac4c51
Showing
8 changed files
with
123 additions
and
101 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { chakra, shouldForwardProp } from "@chakra-ui/react"; | ||
import NextLink from "next/link"; | ||
import { NextRouter } from "next/router"; | ||
|
||
export const NextLinkHelper = chakra(NextLink, { | ||
shouldForwardProp: (prop) => { | ||
// don't forward Chakra's props | ||
const isChakraProp = !shouldForwardProp(prop); | ||
if (isChakraProp) return false; | ||
|
||
// else, only forward `sample` prop | ||
return [ | ||
"href", | ||
"as", | ||
"replace", | ||
"scroll", | ||
"shallow", | ||
"passHref", | ||
"prefetch", | ||
"locale", | ||
].includes(prop); | ||
}, | ||
}); | ||
|
||
// https://stackoverflow.com/questions/43335962/purpose-of-declare-keyword-in-typescript | ||
// Summary: declare fix loi bien nay da khai bao roi --> khai bao lai | ||
declare type Url = URL | string; | ||
|
||
/** | ||
* Strengthen original router.push() | ||
* @param router Component's current using router | ||
* @param url | ||
* @returns `router.push(url, undefined, { shallow: true })` | ||
*/ | ||
export function routerShallowPush(router: NextRouter, url: Url) { | ||
return router.push(url, undefined, { shallow: true }); | ||
} |
This file was deleted.
Oops, something went wrong.
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,3 +1,3 @@ | ||
export * from "./NextLinkHelper" | ||
export * from "./NextHelper" | ||
export * from "./FramerMotionHelper" | ||
export * from "./DynamicStyle" |
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