Skip to content

Commit

Permalink
feat: make explorer path land on blocks by default
Browse files Browse the repository at this point in the history
  • Loading branch information
o-az authored and cor committed May 30, 2024
1 parent cd07159 commit cb51595
Show file tree
Hide file tree
Showing 24 changed files with 49 additions and 696 deletions.
2 changes: 0 additions & 2 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"formsnap": "^1.0.0",
"gql.tada": "^1.7.5",
"graphql-request": "^7.0.1",
"lucide-svelte": "^0.379.0",
"mode-watcher": "^0.3.0",
"paneforge": "^0.0.4",
"svelte-french-toast": "^1.2.0",
Expand Down Expand Up @@ -83,7 +82,6 @@
"rollup-plugin-visualizer": "^5.12.0",
"svelte": "^4.2.17",
"svelte-check": "^3.8.0",
"svelte-headless-table": "^0.18.2",
"svelte-preprocess": "^5.1.4",
"sveltekit-flash-message": "^2.4.4",
"sveltekit-rate-limiter": "^0.5.1",
Expand Down
4 changes: 2 additions & 2 deletions app/src/lib/components/header/header.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { routes } from "$lib/components/navigation/index.ts"

<header
class={cn(
'p-2 md:px-4 min-w-full w-screen flex flex-row items-center md:gap-4',
'p-2 md:p-3 min-w-full w-screen flex flex-row items-center md:gap-4',
'bg-card flex justify-between space-x-2 sm:space-x-3 border-b-[1px] border-solid border-secondary/65',
)}
>
Expand All @@ -22,7 +22,7 @@ import { routes } from "$lib/components/navigation/index.ts"
<img
src="/images/logo/union-logo-wide-transparent.svg"
alt="Union Logo"
class="h-full w-full select-none"
class="size-full select-none"
/>
</Button>
<div class="flex-1 p-0 m-0">
Expand Down
1 change: 0 additions & 1 deletion app/src/lib/wallet/evm/config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {
http,
fallback,
webSocket,
reconnect,
serialize,
getClient,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { page } from "$app/stores"
import { cn } from "$lib/utilities/shadcn.ts"
import type { LayoutData } from "../$types.ts"
import type { LayoutData } from "../$types"
import { Button } from "$lib/components/ui/button/index.ts"
import * as Tooltip from "$lib/components/ui/tooltip/index.ts"
Expand Down
2 changes: 1 addition & 1 deletion app/src/routes/explorer/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { onMount } from "svelte"
import Menu from "./components/menu.svelte"
import Menu from "./(components)/menu.svelte"
import type { LayoutData } from "./$types.ts"
import { cn } from "$lib/utilities/shadcn.ts"
import * as Resizable from "$lib/components/ui/resizable"
Expand Down
22 changes: 14 additions & 8 deletions app/src/routes/explorer/+layout.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { redirect } from "@sveltejs/kit"
import type { LayoutLoad } from "./$types"
import type { SvelteComponent } from "svelte"

Expand All @@ -13,11 +14,16 @@ export interface Table {
icon: typeof SvelteComponent
}

export const load = (_loadEvent => ({
tables: [
{ route: "blocks", icon: BlocksIcon },
{ route: "channels", icon: TvIcon },
{ route: "packets", icon: SendHorizontalIcon },
{ route: "connections", icon: ConnectionIcon }
] as Array<Table>
})) satisfies LayoutLoad
export const load = (loadEvent => {
// Redirect if the user is visiting /explorer
if (loadEvent.url.pathname === "/explorer") throw redirect(302, "/explorer/blocks")

return {
tables: [
{ route: "blocks", icon: BlocksIcon },
{ route: "channels", icon: TvIcon },
{ route: "packets", icon: SendHorizontalIcon },
{ route: "connections", icon: ConnectionIcon }
] as Array<Table>
}
}) satisfies LayoutLoad
7 changes: 6 additions & 1 deletion app/src/routes/explorer/+page.svelte
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@

<script lang="ts">
/**
* Intentionally left blank.
* See line 19 in {@link file://./+layout.ts}
*/
</script>
2 changes: 1 addition & 1 deletion app/src/routes/explorer/blocks/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { cn } from "$lib/utilities/shadcn.ts"
import { CHAIN_MAP } from "$lib/constants/chains"
import * as Table from "$lib/components/ui/table"
import { createQuery } from "@tanstack/svelte-query"
import CellText from "../components/cell-text.svelte"
import CellText from "../(components)/cell-text.svelte"
import { removeArrayDuplicates } from "$lib/utilities"
import type { Override } from "$lib/utilities/types.ts"
import { Shine, Duration, DurationUnits } from "svelte-ux"
Expand Down
7 changes: 7 additions & 0 deletions app/src/routes/explorer/connections/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<script lang="ts">
import { cn } from "$lib/utilities/shadcn.ts"
</script>

<section class={cn('py-3')}>
<h1>Connections</h1>
</section>
7 changes: 7 additions & 0 deletions app/src/routes/explorer/packets/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<script lang="ts">
import { cn } from "$lib/utilities/shadcn.ts"
</script>

<section class={cn('py-3')}>
<h1>Packets</h1>
</section>
Loading

0 comments on commit cb51595

Please sign in to comment.