Skip to content

Commit

Permalink
fix for build
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtemkaDev committed Jun 2, 2024
1 parent 084d746 commit 5568fc9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
3 changes: 1 addition & 2 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ const supportedLanguages = ['en', 'ru', 'ua'];

export default function RootPage() {
useEffect(() => {
const userLang = navigator.language || navigator.userLanguage ;
const langPrefix = userLang.split('-')[0];
const langPrefix = navigator.language .split('-')[0];

if (supportedLanguages.includes(langPrefix)) {
redirect(`/${langPrefix}`);
Expand Down
8 changes: 4 additions & 4 deletions src/components/footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ const CustomFooter = () => {
useEffect(() => {
const loadStyles = async () => {
if (isMobile) {
const module = await import("./mobile.module.css");
setStyles(module);
const style_mobile = await import('./mobile.module.css');
setStyles(style_mobile);
} else {
const module = await import("./desktop.module.css");
setStyles(module);
const style_pc = await import('./desktop.module.css');
setStyles(style_pc);
}
};
loadStyles();
Expand Down
9 changes: 4 additions & 5 deletions src/components/language/LanguageSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,14 @@ const LanguageSwitcher = () => {
window.removeEventListener("resize", handleResize);
};
}, []);

useEffect(() => {
const loadStyles = async () => {
if (isMobile) {
const module = await import('./mobile.module.css');
setStyles(module);
const style_mobile = await import('./mobile.module.css');
setStyles(style_mobile);
} else {
const module = await import('./desktop.module.css');
setStyles(module);
const style_pc = await import('./desktop.module.css');
setStyles(style_pc);
}
};
loadStyles();
Expand Down

0 comments on commit 5568fc9

Please sign in to comment.