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. */
}
</HeaderButton>
<HeaderButton text={t("header.settings")}>
<HeaderButton
text={t("header.settings")}
route={`/${lang}/settings/appearance`}
>
<Icon
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"

View file

@ -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"
/>
</HeaderButton>
<HeaderButton text={t("header.settings")}>
<HeaderButton
text={t("header.settings")}
route={`/${lang}/settings/appearance`}
>
<Icon
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"

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...
<script>
<script is:inline>
let currentLang = localStorage.getItem("selectedLanguage");
const redirect = (loc: string) => (window.location.href = loc);
const redirect = (loc) => (window.location.href = loc);
if (currentLang) {
try {
let parsed = JSON.parse(currentLang).value;