Skip to content

Commit

Permalink
feat: next ui
Browse files Browse the repository at this point in the history
  • Loading branch information
rharkor committed Nov 18, 2023
1 parent 259e755 commit c681b24
Show file tree
Hide file tree
Showing 75 changed files with 3,570 additions and 2,878 deletions.
17 changes: 16 additions & 1 deletion i18n-config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
export const localesDetailed = {
en: {
name: "English",
nativeName: "English",
country: "GB",
flag: "https://flagcdn.com/gb.svg",
},
fr: {
name: "French",
nativeName: "Français",
country: "FR",
flag: "https://flagcdn.com/fr.svg",
},
} as const

export const i18n = {
defaultLocale: "en",
locales: ["en", "fr"],
locales: Object.keys(localesDetailed) as Array<keyof typeof localesDetailed>,
} as const

export type Locale = (typeof i18n)["locales"][number]
30 changes: 30 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,36 @@ const config = {
{ source: "/api/ping", destination: "/api/health" },
]
},
redirects() {
//? Permanent redirects only in prod env
return [
{ source: "/signin", destination: "/sign-in", permanent: process.env.ENV === "production" ? true : false },
{ source: "/login", destination: "/sign-in", permanent: process.env.ENV === "production" ? true : false },
{ source: "/signup", destination: "/sign-up", permanent: process.env.ENV === "production" ? true : false },
{ source: "/register", destination: "/sign-up", permanent: process.env.ENV === "production" ? true : false },

{
source: "/:lang/signin",
destination: "/:lang/sign-in",
permanent: process.env.ENV === "production" ? true : false,
},
{
source: "/:lang/login",
destination: "/:lang/sign-in",
permanent: process.env.ENV === "production" ? true : false,
},
{
source: "/:lang/signup",
destination: "/:lang/sign-up",
permanent: process.env.ENV === "production" ? true : false,
},
{
source: "/:lang/register",
destination: "/:lang/sign-up",
permanent: process.env.ENV === "production" ? true : false,
},
]
},
}

export default config
Loading

0 comments on commit c681b24

Please sign in to comment.