Skip to content

Commit

Permalink
fix(app): biome fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
cor committed May 31, 2024
1 parent 346463d commit e28dba2
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 19 deletions.
18 changes: 8 additions & 10 deletions app/src/routes/explorer/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ import { cn } from "$lib/utilities/shadcn.ts"
import * as Resizable from "$lib/components/ui/resizable"
import GripVerticalIcon from "virtual:icons/tabler/grip-vertical"
import { ScrollArea } from "$lib/components/ui/scroll-area/index.ts"
import { page } from "$app/stores";
import { derived } from "svelte/store";
import { onNavigate } from "$app/navigation";
import { page } from "$app/stores"
import { derived } from "svelte/store"
import { onNavigate } from "$app/navigation"
export let data: LayoutData
// Pane collapse on resize has been disabled because it was throwing console errors.
// let windowSize = { width: window.innerWidth, height: window.innerHeight }
Expand Down Expand Up @@ -41,7 +40,6 @@ let isCollapsed = false
let leftPane: Resizable.PaneAPI
$: [leftSize, rightSize] = [14, 88]
const onLayoutChange: Resizable.PaneGroupProps["onLayoutChange"] = sizes => {
document.cookie = `PaneForge:layout=${JSON.stringify(sizes)}`
}
Expand All @@ -56,13 +54,13 @@ const onExpand: Resizable.PaneProps["onExpand"] = () => {
document.cookie = `PaneForge:collapsed=${false}`
}
let explorerRoute = $page.route.id?.split("/").at(-1);
$: explorerPageDescription = data.tables.filter(t => t.route === explorerRoute)[0].description;
let explorerRoute = $page.route.id?.split("/").at(-1)
$: explorerPageDescription = data.tables.filter(t => t.route === explorerRoute)[0].description
onNavigate(navigation => {
if (navigation.to?.route.id?.split("/").at(1) === 'explorer') {
explorerRoute = navigation.to?.route.id?.split("/").at(2);
if (navigation.to?.route.id?.split("/").at(1) === "explorer") {
explorerRoute = navigation.to?.route.id?.split("/").at(2)
}
});
})
</script>

<main class="flex flex-row flex-1 overflow-y-hidden">
Expand Down
20 changes: 16 additions & 4 deletions app/src/routes/explorer/+layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const tables = ["blocks", "packets", "channels", "connections"] as const

export interface Table {
route: (typeof tables)[number]
icon: typeof SvelteComponent,
icon: typeof SvelteComponent
description: string
}

Expand All @@ -23,12 +23,24 @@ export const load = (loadEvent => {

return {
tables: [
{ route: "blocks", icon: BlocksIcon, description: "Blocks from all chains indexed by Hubble" },
{
route: "blocks",
icon: BlocksIcon,
description: "Blocks from all chains indexed by Hubble"
},
{ route: "connections", icon: ConnectionIcon, description: "Open IBC Connections" },
{ route: "channels", icon: TvIcon, description: "Open IBC Channels" },
{ route: "packets", icon: SendHorizontalIcon, description: "Packets sent through Union" },
{ route: "voyager-queue", icon: RocketIcon, description: "Voyager Relayer VM Operations Queue" },
{ route: "index-status", icon: DatabaseIcon, description: "Statuses of Hubble indices for connected chains" }
{
route: "voyager-queue",
icon: RocketIcon,
description: "Voyager Relayer VM Operations Queue"
},
{
route: "index-status",
icon: DatabaseIcon,
description: "Statuses of Hubble indices for connected chains"
}
] as Array<Table>
}
}) satisfies LayoutLoad
8 changes: 3 additions & 5 deletions app/src/routes/explorer/index-status/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { voyagerQueueQuery} from "$lib/graphql/documents/voyager-queue.ts"
import { voyagerQueueQuery } from "$lib/graphql/documents/voyager-queue.ts"
import { createQuery } from "@tanstack/svelte-query"
import { URLS } from "$lib/constants"
Expand All @@ -9,12 +9,10 @@ $: indexStatus = createQuery({
// enabled: false,
queryFn: async () => {
const response = await fetch(`${URLS.GRAPHQL_REST}/index_status`)
const json = await response.json() as { v0_index_status: unknown } ;
return json.v0_index_status;
const json = (await response.json()) as { v0_index_status: unknown }
return json.v0_index_status
}
})
</script>

<h1>Index Status</h1>
Expand Down

0 comments on commit e28dba2

Please sign in to comment.