-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c49d6b5
commit 26270ca
Showing
10 changed files
with
359 additions
and
74 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
15 changes: 15 additions & 0 deletions
15
apps/dashboard/src/routes/(search-pages)/subintent/[subintent]/+layout.svelte
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<script lang="ts"> | ||
import SearchPage from '@dashboard/pages/search-pages/SearchPage.svelte' | ||
import type { LayoutData } from './$types' | ||
export let data: LayoutData | ||
</script> | ||
|
||
<SearchPage | ||
title="Subintent" | ||
address={data.id} | ||
activeTab={data.pageName} | ||
menuItems={[[{ id: 'summary', label: 'Summary' }]]} | ||
> | ||
<slot /> | ||
</SearchPage> |
21 changes: 21 additions & 0 deletions
21
apps/dashboard/src/routes/(search-pages)/subintent/[subintent]/+layout.ts
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { gatewayApi } from '@api/_deprecated/gateway' | ||
import type { LayoutLoad } from './$types' | ||
|
||
export const load: LayoutLoad = ({ params }) => { | ||
const subintent = gatewayApi.transaction.innerClient | ||
.transactionSubintentStatus({ | ||
transactionSubintentStatusRequest: { | ||
subintent_hash: params.subintent | ||
} | ||
}) | ||
.then((response) => ({ | ||
status: response.subintent_status, | ||
description: response.subintent_status_description, | ||
finalizedAt: response.finalized_at_transaction_intent_hash | ||
})) | ||
|
||
return { | ||
id: params.subintent, | ||
subintent | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
apps/dashboard/src/routes/(search-pages)/subintent/[subintent]/+page.svelte
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<script lang="ts"> | ||
import { goto } from '$app/navigation' | ||
import type { LayoutData } from './$types' | ||
export let data: LayoutData | ||
goto(`${data.id}/summary`, { replaceState: true }) | ||
</script> |
96 changes: 96 additions & 0 deletions
96
apps/dashboard/src/routes/(search-pages)/subintent/[subintent]/summary/+page.svelte
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 |
---|---|---|
@@ -0,0 +1,96 @@ | ||
<script lang="ts"> | ||
import IconNew from '@components/_base/icon/IconNew.svelte' | ||
import Checkmark from '@icons/checkmark-green.svg' | ||
import SkeletonLoader from '@components/_base/skeleton-loader/SkeletonLoader.svelte' | ||
import type { PageData } from './$types' | ||
import { shortenAddress } from '@utils' | ||
import Link from '@components/_base/link/Link.svelte' | ||
export let data: PageData | ||
</script> | ||
|
||
<div class="tx-summary card"> | ||
<div class="message-box"> | ||
<div class="header"> | ||
<div class="header-section"> | ||
{#await data.subintent} | ||
<SkeletonLoader /> | ||
{:then { status }} | ||
{#if status === 'CommittedSuccess'} | ||
<h4>Finalized at:</h4> | ||
{/if} | ||
{/await} | ||
</div> | ||
{#await data.subintent} | ||
<SkeletonLoader /> | ||
{:then { status }} | ||
<div | ||
class="header-section status-section" | ||
class:success={status === 'CommittedSuccess'} | ||
> | ||
<div class="main-status"> | ||
{#if status === 'CommittedSuccess'} | ||
<IconNew icon={Checkmark} /> | ||
{/if} | ||
{status === 'CommittedSuccess' ? 'Success' : 'Unknown Status'} | ||
</div> | ||
</div> | ||
{/await} | ||
</div> | ||
</div> | ||
|
||
{#await data.subintent then { finalizedAt }} | ||
{#if finalizedAt} | ||
<Link | ||
url="/transaction/{finalizedAt}" | ||
text={shortenAddress(finalizedAt)} | ||
/> | ||
{/if} | ||
{/await} | ||
</div> | ||
|
||
<style lang="scss"> | ||
.header-section { | ||
display: flex; | ||
flex-direction: column; | ||
gap: var(--spacing-md); | ||
&.status-section { | ||
align-items: flex-end; | ||
&.success { | ||
color: var(--theme-success-primary); | ||
.main-status { | ||
color: var(--theme-success-primary); | ||
} | ||
} | ||
} | ||
} | ||
.manifest-class { | ||
color: var(--color-grey-2); | ||
} | ||
.main-status { | ||
display: flex; | ||
font-size: var(--text-xl); | ||
align-items: center; | ||
gap: var(--spacing-sm); | ||
} | ||
.tx-summary { | ||
.message-box { | ||
display: flex; | ||
flex-direction: column; | ||
.header { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
gap: var(--spacing-2xl); | ||
font-size: var(--text-lg); | ||
font-weight: var(--font-weight-bold-2); | ||
} | ||
} | ||
} | ||
</style> |
Oops, something went wrong.