refactor: switch from <Page /> component to layout file

This commit is contained in:
madkarmaa 2025-05-02 09:16:33 +02:00
parent 88dcf4d19e
commit 9547519ec7
9 changed files with 32 additions and 49 deletions

View File

@ -0,0 +1,10 @@
<script lang="ts">
type Props = { title?: string };
let { title }: Props = $props();
const pageTitle = title ? `ReVanced - ${title.trim()}` : 'ReVanced';
</script>
<svelte:head>
<title>{pageTitle}</title>
</svelte:head>

View File

@ -1,20 +0,0 @@
<script lang="ts">
import type { Snippet } from 'svelte';
import NavBar from '$components/organisms/NavBar.svelte';
import Footer from '$components/organisms/Footer.svelte';
type Props = { title?: string; children: Snippet };
let { title, children }: Props = $props();
const pageTitle = title ? `ReVanced - ${title.trim()}` : 'ReVanced';
</script>
<svelte:head>
<title>{pageTitle}</title>
</svelte:head>
<main>
<NavBar />
{@render children()}
<Footer />
</main>

View File

@ -1,6 +1,10 @@
<script lang="ts">
import { theme } from '$stores';
import type { Snippet } from 'svelte';
import { theme } from '$stores';
import Footer from '$components/organisms/Footer.svelte';
import NavBar from '$components/organisms/NavBar.svelte';
import Head from '$components/molecules/Head.svelte';
type Props = { children: Snippet };
let { children }: Props = $props();
@ -10,4 +14,10 @@
});
</script>
<Head />
<NavBar />
<main>
{@render children()}
</main>
<Footer />

View File

@ -1,7 +0,0 @@
<script lang="ts">
import Page from '$components/templates/Page.svelte';
</script>
<Page>
<h1>Home</h1>
</Page>

View File

@ -1,7 +1,5 @@
<script lang="ts">
import Page from '$components/templates/Page.svelte';
import Head from '$components/molecules/Head.svelte';
</script>
<Page title="Announcements">
<h1>Announcements</h1>
</Page>
<Head title="Announcements" />

View File

@ -1,7 +1,5 @@
<script lang="ts">
import Page from '$components/templates/Page.svelte';
import Head from '$components/molecules/Head.svelte';
</script>
<Page title="Contributors of ReVanced">
<h1>Contributors</h1>
</Page>
<Head title="Contributors of ReVanced" />

View File

@ -1,7 +1,5 @@
<script lang="ts">
import Page from '$components/templates/Page.svelte';
import Head from '$components/molecules/Head.svelte';
</script>
<Page title="Donate to ReVanced">
<h1>Donate</h1>
</Page>
<Head title="Donate to ReVanced" />

View File

@ -1,7 +1,5 @@
<script lang="ts">
import Page from '$components/templates/Page.svelte';
import Head from '$components/molecules/Head.svelte';
</script>
<Page title="Download ReVanced">
<h1>Download</h1>
</Page>
<Head title="Download ReVanced" />

View File

@ -1,7 +1,5 @@
<script lang="ts">
import Page from '$components/templates/Page.svelte';
import Head from '$components/molecules/Head.svelte';
</script>
<Page title="Patches for ReVanced">
<h1>Patches</h1>
</Page>
<Head title="Patches for ReVanced" />