Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtemkaDev committed Jun 2, 2024
1 parent 09ba14f commit e333a77
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
'use client';
import { useEffect } from "react";
import { redirect } from "next/navigation";

const supportedLanguages = ['en', 'ru', 'ua'];

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

if (supportedLanguages.includes(langPrefix)) {
redirect(`/${langPrefix}`);
} else {
redirect('/en');
}
}, []);

return null;
redirect("/en");
}

0 comments on commit e333a77

Please sign in to comment.