-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #278 from greymass/dev
Next Release
- Loading branch information
Showing
75 changed files
with
1,592 additions
and
886 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
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<script lang="ts"> | ||
import { Stack } from '$lib/components/layout'; | ||
import type { Snippet } from 'svelte'; | ||
interface Props { | ||
children: Snippet; | ||
isCurrentUser?: boolean; | ||
} | ||
let props: Props = $props(); | ||
</script> | ||
|
||
<Stack class="gap-2 @container"> | ||
<h5 class="h5">Breakdown</h5> | ||
{#if props.isCurrentUser} | ||
<div class="grid grid-cols-3 gap-0"> | ||
{@render props.children()} | ||
</div> | ||
{:else} | ||
<div class="grid grid-cols-2 gap-0"> | ||
{@render props.children()} | ||
</div> | ||
{/if} | ||
</Stack> |
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,48 @@ | ||
<script lang="ts"> | ||
import { Asset } from '@wharfkit/antelope'; | ||
import AssetText from '$lib/components/elements/asset.svelte'; | ||
import { cn } from '$lib/utils'; | ||
type BreakdownAction = { | ||
href: string; | ||
text: string; | ||
visible?: boolean; | ||
}; | ||
interface Props { | ||
key: string; | ||
value: Asset | undefined; | ||
action?: BreakdownAction; | ||
} | ||
let { key, value, action }: Props = $props(); | ||
const isTotal = key === 'Total'; | ||
</script> | ||
|
||
<div | ||
class={cn( | ||
'col-span-full grid min-h-12 grid-cols-subgrid items-center gap-x-4 border-b border-mineShaft-900 last:border-none ', | ||
isTotal && 'font-semibold' | ||
)} | ||
> | ||
<div | ||
class="col-start-1 col-end-3 row-start-1 flex flex-col py-2 @xs:flex-row @xs:justify-between" | ||
> | ||
<div class="text-muted">{key}</div> | ||
<div class="text-white"> | ||
<AssetText class="text-nowrap" variant="full" {value} /> | ||
</div> | ||
</div> | ||
|
||
{#if action && action.visible} | ||
<div class="col-span-2 col-start-2 row-start-1 text-right @xs:col-span-1 @xs:col-start-3"> | ||
<a | ||
class="inline-block h-12 content-center text-skyBlue-500 hover:text-skyBlue-400" | ||
href={action.href} | ||
> | ||
{action.text} | ||
</a> | ||
</div> | ||
{/if} | ||
</div> |
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,2 @@ | ||
export { default as Breakdown } from './breakdown.svelte'; | ||
export { default as BreakdownRow } from './breakdownRow.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
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,48 @@ | ||
<script lang="ts"> | ||
import { getContext } from 'svelte'; | ||
import type { UnicoveContext } from '$lib/state/client.svelte'; | ||
import { Card, Stack } from '$lib/components/layout'; | ||
import Button from '$lib/components/button/button.svelte'; | ||
import Chip from '$lib/components/chip.svelte'; | ||
import AssetText from '$lib/components/elements/asset.svelte'; | ||
const context = getContext<UnicoveContext>('state'); | ||
interface Props { | ||
cta?: { | ||
label: string; | ||
href: string; | ||
}; | ||
title?: string; | ||
} | ||
const { cta, title = 'Account Balance' }: Props = $props(); | ||
</script> | ||
|
||
<Card {title}> | ||
<Stack> | ||
<Stack class="gap-2"> | ||
<h4 class="text-muted text-base leading-none">Available</h4> | ||
<p class="text-xl font-semibold leading-none text-white"> | ||
{#if context.account} | ||
<AssetText variant="full" value={context.account?.balance?.liquid} /> | ||
{:else} | ||
Not logged in | ||
{/if} | ||
</p> | ||
{#if context.account?.value?.liquid} | ||
<Chip> | ||
<AssetText variant="full" value={context.account?.value?.liquid} /> | ||
<!-- TODO: Percent change --> | ||
</Chip> | ||
{/if} | ||
</Stack> | ||
|
||
{#if cta} | ||
<Stack class="gap-2"> | ||
<Button href={cta.href}>{cta.label}</Button> | ||
</Stack> | ||
{/if} | ||
</Stack> | ||
</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
Oops, something went wrong.