generated from OLILHR/sveltekit-static-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: render the app an SPA and discard dynamic routing approaches (
#145) * Discard slugs * Remove `ebd-form-header` component * Add SVG integration to `ebd page` * Add forms to `header` component * Disable prerendering of dynamic routes * Disable export button as long as no ebd is selected * Move `role-select` into header * Use URL query parameter * Handle URL parameters and state management on client side * Update docstrings
- Loading branch information
Showing
14 changed files
with
265 additions
and
364 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,75 @@ | ||
<script> | ||
<script lang="ts"> | ||
import { base } from "$app/paths"; | ||
import { IconLogo } from "$lib/components"; | ||
import { | ||
EbdInput, | ||
EbdNavigation, | ||
FilterRoleSelect, | ||
FormatVersionSelect, | ||
IconLogo, | ||
} from "$lib/components"; | ||
import type { EbdNameExtended } from "$lib/types/metadata"; | ||
export let formatVersions: Array<{ | ||
code: string; | ||
detailedFormatVersion: string; | ||
}> = []; | ||
export let selectedFormatVersion: string = ""; | ||
export let onFormatVersionSelect: (version: string) => void; | ||
export let ebdList: EbdNameExtended[] = []; | ||
export let selectedEbd: string = ""; | ||
export let onEbdSelect: (ebdCode: string) => void; | ||
export let roles: Record<string, string[]> = {}; | ||
export let selectedRoles: string[] = []; | ||
export let onRoleSelect: (roles: string[]) => void; | ||
</script> | ||
|
||
<header class="bg-primary"> | ||
<nav class="mx-auto flex items-center px-6 py-4" aria-label="Global"> | ||
<a href="{base}/" title="landingpage" class="flex-none items-center"> | ||
<IconLogo /> | ||
</a> | ||
<span class="text-xl text-white flex items-center me-14" | ||
>EBD.HOCHFREQUENZ.DE</span | ||
<div class="mx-auto"> | ||
<nav | ||
class="flex items-center justify-between px-6 py-4 border-b border-white/10" | ||
aria-label="Global" | ||
> | ||
</nav> | ||
<div class="flex items-center w-4/5"> | ||
<a href="{base}/" title="landingpage" class="flex-none items-center"> | ||
<IconLogo /> | ||
</a> | ||
<span class="text-xl text-white">EBD.HOCHFREQUENZ.DE</span> | ||
<div class="-mt-2 pl-10 w-1/5"> | ||
<FormatVersionSelect | ||
{formatVersions} | ||
selectedVersion={selectedFormatVersion} | ||
onSelect={onFormatVersionSelect} | ||
/> | ||
</div> | ||
<div class="-mt-2 pl-5 w-1/5"> | ||
<FilterRoleSelect | ||
isDisabled={!selectedFormatVersion} | ||
formatVersion={selectedFormatVersion} | ||
{roles} | ||
onSelect={onRoleSelect} | ||
initialRoles={selectedRoles} | ||
/> | ||
</div> | ||
<div class="-mt-2 pl-5 w-1/3 mr-1"> | ||
<EbdInput | ||
ebds={ebdList} | ||
disabled={!selectedFormatVersion} | ||
selectedEbdCode={selectedEbd} | ||
formatVersionChanged={false} | ||
onSelect={onEbdSelect} | ||
/> | ||
</div> | ||
<EbdNavigation | ||
currentEbds={ebdList} | ||
selectedEbdCode={selectedEbd} | ||
currentFormatVersion={selectedFormatVersion} | ||
onSelect={onEbdSelect} | ||
isDisabled={!selectedFormatVersion || !selectedEbd} | ||
/> | ||
</div> | ||
<div class="ml-auto"> | ||
<slot name="actions" /> | ||
</div> | ||
</nav> | ||
</div> | ||
</header> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
export const prerender = true; // requires all possible entries of [dynamic routes] to be known at build time (see src/server/prerender-entries.ts) | ||
export const prerender = true; | ||
export const trailingSlash = "always"; | ||
|
||
export const ssr = true; | ||
export const ssr = false; | ||
export const csr = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.