Make settings layout

This commit is contained in:
rift 2024-07-24 23:22:05 -05:00
parent f8a6d2bc3d
commit e91a913b62
5 changed files with 37 additions and 5 deletions

View file

@ -31,7 +31,10 @@ const t = useTranslations(lang);
/* Astro won't let us pass the icon as a prop so it's going into the outlet here. */ /* Astro won't let us pass the icon as a prop so it's going into the outlet here. */
} }
</HeaderButton> </HeaderButton>
<HeaderButton text={t("header.settings")}> <HeaderButton
text={t("header.settings")}
route={`/${lang}/settings/appearance`}
>
<Icon <Icon
name="ph:wrench-fill" name="ph:wrench-fill"
class="h-6 w-6 text-text-color transition duration-500 group-hover:text-text-hover-color md:h-6 md:w-6" class="h-6 w-6 text-text-color transition duration-500 group-hover:text-text-hover-color md:h-6 md:w-6"

View file

@ -9,7 +9,7 @@ const t = useTranslations(lang);
<div <div
class="h-full mt-16 flex w-full flex-col justify-evenly md:flex-row bg-navbar-color m-auto" class="h-full mt-16 flex w-full flex-col justify-evenly md:flex-row bg-navbar-color m-auto"
id="mobileNavMenu" id="mobileNavMenu"
> >
<HeaderButton text={t("header.home")} route={`/${lang}/`}> <HeaderButton text={t("header.home")} route={`/${lang}/`}>
<Icon <Icon
name="ph:house-bold" name="ph:house-bold"
@ -22,7 +22,10 @@ const t = useTranslations(lang);
class="h-6 w-6 text-text-color transition duration-500 group-hover:text-text-hover-color md:h-6 md:w-6" class="h-6 w-6 text-text-color transition duration-500 group-hover:text-text-hover-color md:h-6 md:w-6"
/> />
</HeaderButton> </HeaderButton>
<HeaderButton text={t("header.settings")}> <HeaderButton
text={t("header.settings")}
route={`/${lang}/settings/appearance`}
>
<Icon <Icon
name="ph:wrench-fill" name="ph:wrench-fill"
class="h-6 w-6 text-text-color transition duration-500 group-hover:text-text-hover-color md:h-6 md:w-6" class="h-6 w-6 text-text-color transition duration-500 group-hover:text-text-hover-color md:h-6 md:w-6"

View file

@ -0,0 +1,9 @@
---
const { title } = Astro.props;
---
<div>
<p>Settings</p>
<p>{title}</p>
<slot />
</div>

View file

@ -0,0 +1,17 @@
---
import Layout from "../../../layouts/Layout.astro";
import SettingsLayout from "../../../layouts/SettingsLayout.astro";
export function getStaticPaths() {
const STATIC_PATHS = [
{ params: { lang: "en_US" } },
{ params: { lang: "jp" } },
];
return STATIC_PATHS;
}
---
<Layout title="Settings">
<SettingsLayout title="Appearance">
<p>Appearance settings here!</p>
</SettingsLayout>
</Layout>

View file

@ -4,9 +4,9 @@ import Card from "../components/Card.astro";
--- ---
loading... loading...
<script> <script is:inline>
let currentLang = localStorage.getItem("selectedLanguage"); let currentLang = localStorage.getItem("selectedLanguage");
const redirect = (loc: string) => (window.location.href = loc); const redirect = (loc) => (window.location.href = loc);
if (currentLang) { if (currentLang) {
try { try {
let parsed = JSON.parse(currentLang).value; let parsed = JSON.parse(currentLang).value;