Skip to content

Commit

Permalink
feat: Migrated overview and buildings pages to runes
Browse files Browse the repository at this point in the history
  • Loading branch information
Knoblauchpilze committed Nov 2, 2024
1 parent da52eb6 commit b25a0b0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
import { invalidate } from '$app/navigation';
export let data;
let { data } = $props();
// https://stackoverflow.com/questions/75616911/sveltekit-fetching-on-the-server-and-updating-the-writable-store
heroImage.set(GAME_HERO_IMAGE);
heroContainer.set(GAME_HERO_CONTAINER_PROPS);
pageTitle.set(data.wepageTitle);
activeScreen.set('buildings');
$: anyBuildingActionRunning = data.buildingActions.length !== 0;
let anyBuildingActionRunning = $derived(data.buildingActions.length !== 0);
function onActionCompleted() {
invalidate('data:planet');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@
import { formatDate } from '$lib/time';
// https://svelte.dev/blog/zero-config-type-safety
export let data;
// https://svelte.dev/docs/kit/load#Page-data
let { data } = $props();
heroImage.set(GAME_HERO_IMAGE);
heroContainer.set(GAME_HERO_CONTAINER_PROPS);
pageTitle.set(data.wepageTitle);
activeScreen.set('overview');
$: colonizationDate = formatDate(data.planetCreationTime);
$: usedFields = data.buildings.reduce((used, building) => used + building.level, 0);
let colonizationDate = $derived(formatDate(data.planetCreationTime));
let usedFields = $derived(data.buildings.reduce((used, building) => used + building.level, 0));
function onActionCompleted() {
invalidate('data:planet');
Expand Down

0 comments on commit b25a0b0

Please sign in to comment.