Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ascartabelli committed Aug 1, 2024
1 parent 26d38d3 commit cfb9e46
Show file tree
Hide file tree
Showing 22 changed files with 209 additions and 143 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,12 @@ exports[`Block Details > renders the Block Details component 1`] = `
class="details-list__definition"
>
<time
class="block-details__list-timestamp"
class="dusk-relative-time block-details__list-timestamp"
datetime="2024-04-16T20:07:02.000Z"
slot="definition"
>
Tue, 16 Apr 2024 20:07:02 GMT (last month)
</time>
</dd>
<dt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ exports[`Blocks Card > should disable the \`Show More\` button if there is no mo
class="details-list__definition details-list__definition--table"
>
<time
class="block-details__list-timestamp"
class="dusk-relative-time block-details__list-timestamp"
datetime="2024-05-28T14:26:54.000Z"
slot="definition"
>
Expand Down Expand Up @@ -810,7 +810,7 @@ exports[`Blocks Card > should disable the \`Show More\` button if there is no mo
class="details-list__definition details-list__definition--table"
>
<time
class="block-details__list-timestamp"
class="dusk-relative-time block-details__list-timestamp"
datetime="2024-05-28T14:26:51.000Z"
slot="definition"
>
Expand Down Expand Up @@ -914,7 +914,7 @@ exports[`Blocks Card > should disable the \`Show More\` button if there is no mo
class="details-list__definition details-list__definition--table"
>
<time
class="block-details__list-timestamp"
class="dusk-relative-time block-details__list-timestamp"
datetime="2024-05-28T14:26:47.000Z"
slot="definition"
>
Expand Down Expand Up @@ -1018,7 +1018,7 @@ exports[`Blocks Card > should disable the \`Show More\` button if there is no mo
class="details-list__definition details-list__definition--table"
>
<time
class="block-details__list-timestamp"
class="dusk-relative-time block-details__list-timestamp"
datetime="2024-05-28T14:26:45.000Z"
slot="definition"
>
Expand Down Expand Up @@ -1122,7 +1122,7 @@ exports[`Blocks Card > should disable the \`Show More\` button if there is no mo
class="details-list__definition details-list__definition--table"
>
<time
class="block-details__list-timestamp"
class="dusk-relative-time block-details__list-timestamp"
datetime="2024-05-28T14:26:42.000Z"
slot="definition"
>
Expand Down Expand Up @@ -1226,7 +1226,7 @@ exports[`Blocks Card > should disable the \`Show More\` button if there is no mo
class="details-list__definition details-list__definition--table"
>
<time
class="block-details__list-timestamp"
class="dusk-relative-time block-details__list-timestamp"
datetime="2024-05-28T14:26:39.000Z"
slot="definition"
>
Expand Down Expand Up @@ -1330,7 +1330,7 @@ exports[`Blocks Card > should disable the \`Show More\` button if there is no mo
class="details-list__definition details-list__definition--table"
>
<time
class="block-details__list-timestamp"
class="dusk-relative-time block-details__list-timestamp"
datetime="2024-05-28T14:26:35.000Z"
slot="definition"
>
Expand Down Expand Up @@ -1434,7 +1434,7 @@ exports[`Blocks Card > should disable the \`Show More\` button if there is no mo
class="details-list__definition details-list__definition--table"
>
<time
class="block-details__list-timestamp"
class="dusk-relative-time block-details__list-timestamp"
datetime="2024-05-28T14:26:32.000Z"
slot="definition"
>
Expand Down Expand Up @@ -1538,7 +1538,7 @@ exports[`Blocks Card > should disable the \`Show More\` button if there is no mo
class="details-list__definition details-list__definition--table"
>
<time
class="block-details__list-timestamp"
class="dusk-relative-time block-details__list-timestamp"
datetime="2024-05-28T14:26:29.000Z"
slot="definition"
>
Expand Down Expand Up @@ -1642,7 +1642,7 @@ exports[`Blocks Card > should disable the \`Show More\` button if there is no mo
class="details-list__definition details-list__definition--table"
>
<time
class="block-details__list-timestamp"
class="dusk-relative-time block-details__list-timestamp"
datetime="2024-05-28T14:26:24.000Z"
slot="definition"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ exports[`Blocks List > renders the Blocks List component 1`] = `
class="details-list__definition details-list__definition--table"
>
<time
class="block-details__list-timestamp"
class="dusk-relative-time block-details__list-timestamp"
datetime="2024-04-16T20:07:02.000Z"
slot="definition"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,12 @@ exports[`Transaction Details > renders the Transaction Details component 1`] = `
class="details-list__definition"
>
<time
class="transaction-details__list-timestamp"
class="dusk-relative-time transaction-details__list-timestamp"
datetime="2024-04-16T06:39:09.000Z"
slot="definition"
>
Tue, 16 Apr 2024 06:39:09 GMT (last month)
</time>
</dd>
<dt
Expand Down Expand Up @@ -461,13 +460,12 @@ exports[`Transaction Details > renders the Transaction Details component with th
class="details-list__definition"
>
<time
class="transaction-details__list-timestamp"
class="dusk-relative-time transaction-details__list-timestamp"
datetime="2024-04-16T06:39:09.000Z"
slot="definition"
>
Tue, 16 Apr 2024 06:39:09 GMT (last month)
</time>
</dd>
<dt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ exports[`Transactions Card > should disable the \`Show More\` button if there is
class="details-list__definition details-list__definition--table"
>
<time
class="transaction-details__list-timestamp"
class="dusk-relative-time transaction-details__list-timestamp"
datetime="2024-05-29T05:42:20.000Z"
slot="definition"
>
Expand Down Expand Up @@ -1021,7 +1021,7 @@ exports[`Transactions Card > should disable the \`Show More\` button if there is
class="details-list__definition details-list__definition--table"
>
<time
class="transaction-details__list-timestamp"
class="dusk-relative-time transaction-details__list-timestamp"
datetime="2024-05-29T05:42:08.000Z"
slot="definition"
>
Expand Down Expand Up @@ -1138,7 +1138,7 @@ exports[`Transactions Card > should disable the \`Show More\` button if there is
class="details-list__definition details-list__definition--table"
>
<time
class="transaction-details__list-timestamp"
class="dusk-relative-time transaction-details__list-timestamp"
datetime="2024-05-29T05:41:58.000Z"
slot="definition"
>
Expand Down Expand Up @@ -1255,7 +1255,7 @@ exports[`Transactions Card > should disable the \`Show More\` button if there is
class="details-list__definition details-list__definition--table"
>
<time
class="transaction-details__list-timestamp"
class="dusk-relative-time transaction-details__list-timestamp"
datetime="2024-05-29T05:40:57.000Z"
slot="definition"
>
Expand Down Expand Up @@ -1372,7 +1372,7 @@ exports[`Transactions Card > should disable the \`Show More\` button if there is
class="details-list__definition details-list__definition--table"
>
<time
class="transaction-details__list-timestamp"
class="dusk-relative-time transaction-details__list-timestamp"
datetime="2024-05-29T05:40:28.000Z"
slot="definition"
>
Expand Down Expand Up @@ -1489,7 +1489,7 @@ exports[`Transactions Card > should disable the \`Show More\` button if there is
class="details-list__definition details-list__definition--table"
>
<time
class="transaction-details__list-timestamp"
class="dusk-relative-time transaction-details__list-timestamp"
datetime="2024-05-29T05:39:59.000Z"
slot="definition"
>
Expand Down Expand Up @@ -1606,7 +1606,7 @@ exports[`Transactions Card > should disable the \`Show More\` button if there is
class="details-list__definition details-list__definition--table"
>
<time
class="transaction-details__list-timestamp"
class="dusk-relative-time transaction-details__list-timestamp"
datetime="2024-05-29T05:39:13.000Z"
slot="definition"
>
Expand Down Expand Up @@ -1723,7 +1723,7 @@ exports[`Transactions Card > should disable the \`Show More\` button if there is
class="details-list__definition details-list__definition--table"
>
<time
class="transaction-details__list-timestamp"
class="dusk-relative-time transaction-details__list-timestamp"
datetime="2024-05-29T05:01:59.000Z"
slot="definition"
>
Expand Down Expand Up @@ -1840,7 +1840,7 @@ exports[`Transactions Card > should disable the \`Show More\` button if there is
class="details-list__definition details-list__definition--table"
>
<time
class="transaction-details__list-timestamp"
class="dusk-relative-time transaction-details__list-timestamp"
datetime="2024-05-29T05:01:15.000Z"
slot="definition"
>
Expand Down Expand Up @@ -1957,7 +1957,7 @@ exports[`Transactions Card > should disable the \`Show More\` button if there is
class="details-list__definition details-list__definition--table"
>
<time
class="transaction-details__list-timestamp"
class="dusk-relative-time transaction-details__list-timestamp"
datetime="2024-05-29T05:00:40.000Z"
slot="definition"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ exports[`Transactions List > should render the \`TransactionsList\` component in
class="details-list__definition details-list__definition--table"
>
<time
class="transaction-details__list-timestamp"
class="dusk-relative-time transaction-details__list-timestamp"
datetime="2024-04-16T06:39:09.000Z"
slot="definition"
>
Expand Down Expand Up @@ -127,7 +127,7 @@ exports[`Transactions List > should render the \`TransactionsList\` component in
class="details-list__definition details-list__definition--table"
>
<time
class="transaction-details__list-timestamp"
class="dusk-relative-time transaction-details__list-timestamp"
datetime="2024-04-16T06:39:09.000Z"
slot="definition"
>
Expand Down
27 changes: 12 additions & 15 deletions explorer/src/lib/components/block-details/BlockDetails.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,8 @@

<script>
import { mdiArrowLeft, mdiArrowRight } from "@mdi/js";
import {
AppAnchorButton,
DataCard,
ListItem,
Rerender,
} from "$lib/components";
import { ProgressBar } from "$lib/dusk/components";
import { AppAnchorButton, DataCard, ListItem } from "$lib/components";
import { ProgressBar, RelativeTime } from "$lib/dusk/components";
import { luxToDusk } from "$lib/dusk/currency";
import { createValueFormatter } from "$lib/dusk/value";
import {
Expand All @@ -34,6 +29,10 @@
const formatter = createValueFormatter("en");
/** @type {(date: Date) => string} */
const formatDate = (date) =>
`${date.toUTCString()} (${getRelativeTimeString(date, "long")})`;
/** @type {Number} */
let screenWidth = window.innerWidth;
Expand Down Expand Up @@ -97,15 +96,13 @@
<!-- TIMESTAMP -->
<ListItem tooltipText="The date and time the block was created">
<svelte:fragment slot="term">timestamp</svelte:fragment>
<time
datetime={data.header.date.toISOString()}
class="block-details__list-timestamp"
<RelativeTime
autoRefresh={true}
className="block-details__list-timestamp"
date={data.header.date}
{formatDate}
slot="definition"
>
<Rerender>
{`${data.header.date.toUTCString()} (${getRelativeTimeString(data.header.date, "long")})`}
</Rerender>
</time>
/>
</ListItem>

<!-- TRANSACTIONS -->
Expand Down
20 changes: 7 additions & 13 deletions explorer/src/lib/components/blocks-list/BlocksList.svelte
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<svelte:options immutable={true} />

<script>
import { AppAnchor, DetailList, ListItem, Rerender } from "$lib/components";
import { ProgressBar } from "$lib/dusk/components";
import { AppAnchor, DetailList, ListItem } from "$lib/components";
import { ProgressBar, RelativeTime } from "$lib/dusk/components";
import { createValueFormatter } from "$lib/dusk/value";
import { getRelativeTimeString } from "$lib/dusk/string";
import { luxToDusk } from "$lib/dusk/currency";
import "./BlocksList.css";
Expand Down Expand Up @@ -44,17 +43,12 @@
: ""}
>
<svelte:fragment slot="term">relative time</svelte:fragment>
<time
datetime={data.header.date.toISOString()}
class="block-details__list-timestamp"
<RelativeTime
autoRefresh={autoRefreshTimes}
className="block-details__list-timestamp"
date={data.header.date}
slot="definition"
>
{#if autoRefreshTimes}
<Rerender>{getRelativeTimeString(data.header.date, "long")}</Rerender>
{:else}
{getRelativeTimeString(data.header.date, "long")}
{/if}
</time>
/>
</ListItem>

<!-- AVERAGE FEE PAID -->
Expand Down
1 change: 0 additions & 1 deletion explorer/src/lib/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export { default as LatestBlocksCard } from "./latest-blocks-card/LatestBlocksCa
export { default as LatestTransactionsCard } from "./latest-transactions-card/LatestTransactionsCard.svelte";
export { default as ListItem } from "./list-item/ListItem.svelte";
export { default as Navbar } from "./navbar/Navbar.svelte";
export { default as Rerender } from "./rerender/Rerender.svelte";
export { default as SearchNotification } from "./search-notification/SearchNotification.svelte";
export { default as StaleDataNotice } from "./stale-data-notice/StaleDataNotice.svelte";
export { default as TextboxAndButton } from "./textbox-and-button/TextboxAndButton.svelte";
Expand Down
15 changes: 0 additions & 15 deletions explorer/src/lib/components/rerender/Rerender.svelte

This file was deleted.

Loading

0 comments on commit cfb9e46

Please sign in to comment.