1
1
<script lang =" ts" >
2
2
import " ../app.css"
3
- import { onMount } from " svelte"
3
+ import { onMount , type Snippet } from " svelte"
4
4
import { Effect , Fiber , Option } from " effect"
5
5
import { chainsQuery } from " $lib/queries/chains.svelte"
6
6
import Sidebar from " $lib/components/layout/Sidebar/index.svelte"
@@ -19,8 +19,14 @@ import { runFork } from "$lib/utils/effect.svelte"
19
19
import { keyboardShortcuts } from " $lib/stores/shortcuts.svelte"
20
20
import Seo from " $lib/components/Seo.svelte"
21
21
import { interceptLogos } from " $lib/utils/intercept-logos.ts"
22
+ import type { PageData } from " ./$types.ts"
22
23
23
- let { children } = $props ()
24
+ interface Props {
25
+ children: Snippet
26
+ data: PageData
27
+ }
28
+
29
+ let { children, data }: Props = $props ()
24
30
25
31
/* Hack to be able to JSON.stringify BigInt */
26
32
interface BigInt {
@@ -31,21 +37,8 @@ BigInt["prototype"].toJSON = function () {
31
37
return this .toString ()
32
38
}
33
39
34
- $effect (() => {
35
- const hostname = page .url .hostname
36
- // Clear any existing override when hostname changes
37
- uiStore .overrideEdition = null
38
-
39
- if (hostname .startsWith (" btc." ) || hostname .startsWith (" staging.btc." )) {
40
- uiStore .edition = " btc"
41
- } else if (hostname .startsWith (" app." ) || hostname .startsWith (" staging.app." )) {
42
- uiStore .edition = " app"
43
- } else {
44
- uiStore .edition = " app"
45
- }
46
- })
47
-
48
40
onMount (() => {
41
+ uiStore .edition = data .edition
49
42
interceptLogos ()
50
43
runExample ()
51
44
runFork (chainsQuery (ENV ()))
0 commit comments