-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor block and transaction details pages
- Loading branch information
Showing
17 changed files
with
203 additions
and
175 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 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,3 +1,7 @@ | ||
.block-details__list-link { | ||
text-decoration: none; | ||
} | ||
|
||
.dusk-progress-bar.blocks-list__gas-used { | ||
width: 60%; | ||
} |
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,5 +1,4 @@ | ||
.block__link { | ||
color: var(--primary-color); | ||
text-decoration: none; | ||
} | ||
|
||
|
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,32 +1,56 @@ | ||
<svelte:options immutable={true} /> | ||
|
||
<script> | ||
import { Alert } from "$lib/components"; | ||
import { Button, Card } from "$lib/dusk/components"; | ||
import { makeClassName } from "$lib/dusk/string"; | ||
import { goto } from "$lib/navigation"; | ||
import "./DataCard.css"; | ||
/** @type {string}*/ | ||
/** @type {Block[] | Transaction[] | Block | Transaction}*/ | ||
export let data; | ||
/** @type {Error | null}*/ | ||
export let error; | ||
/** @type {Boolean} */ | ||
export let loading; | ||
/** @type {String}*/ | ||
export let title; | ||
/** @type { {label:string, href:string} }*/ | ||
export let action; | ||
/** @type {{action:(e: MouseEvent) => void, label: String}}*/ | ||
export let button; | ||
/** @type {string | Undefined} */ | ||
export let className = undefined; | ||
/** @type {Boolean} */ | ||
let hasEmptyData; | ||
$: classes = makeClassName(["data-card", className]); | ||
$: { | ||
hasEmptyData = Array.isArray(data) && data.length === 0; | ||
} | ||
</script> | ||
|
||
<Card className={classes}> | ||
<header slot="header" class="data-card__header"> | ||
<h1 class="data-card__header-title">{title}</h1> | ||
<Button | ||
on:click={() => goto(action.href)} | ||
text={action.label} | ||
variant="secondary" | ||
/> | ||
{#if button} | ||
<Button | ||
on:click={button.action} | ||
text={button.label} | ||
variant="secondary" | ||
/> | ||
{/if} | ||
</header> | ||
<slot /> | ||
{#if loading && data === null} | ||
<p>Loading...</p> | ||
{:else if error || hasEmptyData} | ||
<Alert on:retry {error} {hasEmptyData} /> | ||
{:else if data} | ||
<slot /> | ||
{/if} | ||
</Card> |
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 |
---|---|---|
|
@@ -3,4 +3,5 @@ | |
grid-template-columns: 1fr 1fr; | ||
font-size: 0.75rem; | ||
column-gap: 1.125rem; | ||
padding-bottom: 0.625rem; | ||
} |
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.