-
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.
Update next next-i18next, delete sass plugin
- Loading branch information
Santeri Rusila
committed
Oct 12, 2020
1 parent
30b3684
commit 749cc69
Showing
8 changed files
with
1,508 additions
and
995 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
const withSass = require('@zeit/next-sass'); | ||
const { nextI18NextRewrites } = require('next-i18next/rewrites'); | ||
|
||
module.exports = withSass({ | ||
cssModules: true, | ||
cssLoaderOptions: { | ||
importLoaders: 1, | ||
localIdentName: '[local]___[hash:base64:5]', | ||
}, | ||
}); | ||
const localeSubpaths = { | ||
This comment has been minimized.
Sorry, something went wrong. |
||
fi: 'fi', | ||
en: 'en', | ||
sv: 'sv', | ||
}; | ||
|
||
module.exports = { | ||
rewrites: async () => nextI18NextRewrites(localeSubpaths), | ||
}; |
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 |
---|---|---|
|
@@ -6,6 +6,9 @@ import useKeyboardNavigation from '../../../hooks/useDropdownKeyboardNavigation' | |
import { Language } from '../../../types'; | ||
import styles from './menuDropdown.module.scss'; | ||
|
||
const useIsomorphicLayoutEffect = | ||
typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect; | ||
This comment has been minimized.
Sorry, something went wrong.
jorilindell
Contributor
|
||
|
||
export type MenuItem = { | ||
icon?: React.ReactElement; | ||
language?: Language; | ||
|
@@ -170,7 +173,7 @@ const MenuDropdown: React.FC<MenuDropdownProps> = ({ | |
} | ||
}; | ||
|
||
React.useLayoutEffect(() => { | ||
useIsomorphicLayoutEffect(() => { | ||
setupKeyboardNav(); | ||
document.addEventListener('click', onDocumentClick); | ||
document.addEventListener('focusin', onDocumentFocusin); | ||
|
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
Oops, something went wrong.
We could define localeSubpaths only once. Now they are also defined at src/i18n.ts