mirror of
https://github.com/fallout2-ce/fallout2-ce.github.io.git
synced 2026-07-27 16:47:19 -07:00
apply locale to header and footer.
This commit is contained in:
+1
-1
@@ -4,7 +4,7 @@
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/x-icon" href="./fallout2-ce.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>fallout2-ce</title>
|
||||
<title>Fallout 2 Community Edition</title>
|
||||
</head>
|
||||
<body class="dark">
|
||||
<div id="root"></div>
|
||||
|
||||
+39
-34
@@ -1,41 +1,46 @@
|
||||
import useLang from "@/lib/hooks/useLang";
|
||||
import translations from "@/locale";
|
||||
import { SiDiscord, SiTelegram } from "react-icons/si";
|
||||
|
||||
// TODO: plz update the links
|
||||
|
||||
const Footer = () => (
|
||||
<footer className="w-full h-16 lg:h-12 shrink-0 flex items-center justify-center bg-background/10 sticky bottom-0 z-20 backdrop-blur-xs border-t-background">
|
||||
<div className="w-full max-w-4xl justify-between p-4 items-center flex flex-col lg:flex-row gap-2 my-2 text-sm">
|
||||
<div className="flex gap-6">
|
||||
<a
|
||||
href="https://discord.gg/"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="hover:scale-105"
|
||||
>
|
||||
<SiDiscord className="h-6 w-6" />
|
||||
</a>
|
||||
<a
|
||||
href="https://t.me/"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="hover:scale-105"
|
||||
>
|
||||
<SiTelegram className="h-6 w-6" />
|
||||
</a>
|
||||
const Footer = () => {
|
||||
const { currLang } = useLang();
|
||||
return (
|
||||
<footer className="w-full h-16 lg:h-12 shrink-0 flex items-center justify-center bg-background/10 sticky bottom-0 z-20 backdrop-blur-xs border-t-background">
|
||||
<div className="w-full max-w-4xl justify-between p-4 items-center flex flex-col lg:flex-row gap-2 my-2 text-sm">
|
||||
<div className="flex gap-6">
|
||||
<a
|
||||
href="https://discord.gg/"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="hover:scale-105"
|
||||
>
|
||||
<SiDiscord className="h-6 w-6" />
|
||||
</a>
|
||||
<a
|
||||
href="https://t.me/"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="hover:scale-105"
|
||||
>
|
||||
<SiTelegram className="h-6 w-6" />
|
||||
</a>
|
||||
</div>
|
||||
<div className="flex justify-center items-center text-xs gap-1">
|
||||
{translations[currLang].developedBy}{" "}
|
||||
<a
|
||||
href="https://github.com/fallout2-ce"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="underline hover:scale-101"
|
||||
>
|
||||
https://github.com/fallout2-ce
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex justify-center items-center text-xs gap-1">
|
||||
Developed with ❤️ by{" "}
|
||||
<a
|
||||
href="https://github.com/fallout2-ce"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="underline hover:scale-101"
|
||||
>
|
||||
https://github.com/fallout2-ce
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
);
|
||||
</footer>
|
||||
);
|
||||
};
|
||||
|
||||
export default Footer;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Link } from "react-router";
|
||||
import LangToggle from "./LangToggle";
|
||||
import LangToggle from "@/components/LangToggle";
|
||||
|
||||
const Header = () => (
|
||||
<header className="w-full h-16 shrink-0 flex items-center justify-center bg-background/20 sticky top-0 z-20 backdrop-blur-xs border-b-background">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { atomWithStorage } from "jotai/utils";
|
||||
|
||||
const SupportedLangs = ["sys", "en", "ru"] as const;
|
||||
const SupportedLangs = ["sys", "en"] as const;
|
||||
type LangWithSys = (typeof SupportedLangs)[number];
|
||||
type Lang = Exclude<LangWithSys, "sys">;
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import type { Lang } from "@/lib/stores/langStore";
|
||||
|
||||
type TranslationKey = "developedBy" | "title";
|
||||
|
||||
const translations: Record<Lang, Record<TranslationKey, string>> = {
|
||||
en: {
|
||||
developedBy: "Developed with ❤️ by",
|
||||
title: "Fallout 2 Community Edition",
|
||||
},
|
||||
};
|
||||
|
||||
export default translations;
|
||||
export type { TranslationKey };
|
||||
Reference in New Issue
Block a user