-
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
ed792ae
commit b5be8fc
Showing
19 changed files
with
716 additions
and
98 deletions.
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
apps/dashboard/src/lib/recent-transactions/EntityFilterCard.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,53 @@ | ||
<script lang="ts"> | ||
import InputNew from '@components/_base/input/InputNew.svelte' | ||
import FilterCard from './FilterCard.svelte' | ||
import ButtonNew from '@components/_base/button/ButtonNew.svelte' | ||
import { shortenAddress } from '@utils' | ||
export let title: string | ||
export let description: string | ||
export let values: string[] | ||
let input = '' | ||
</script> | ||
|
||
<FilterCard {title} {description} appliedFilters={values.map(shortenAddress)}> | ||
<div class="input"> | ||
<div class="textinput"> | ||
<InputNew border bind:value={input} /> | ||
</div> | ||
|
||
<div class="button"> | ||
<ButtonNew | ||
on:click={() => { | ||
values = [...values, input] | ||
input = '' | ||
}}>Add</ButtonNew | ||
> | ||
</div> | ||
|
||
<div class="button"> | ||
<ButtonNew | ||
on:click={() => { | ||
values = [] | ||
}}>Clear All</ButtonNew | ||
> | ||
</div> | ||
</div> | ||
</FilterCard> | ||
|
||
<style lang="scss"> | ||
.input { | ||
display: flex; | ||
margin-top: var(--spacing-xl); | ||
gap: var(--spacing-xl); | ||
.textinput { | ||
width: 100%; | ||
} | ||
.button { | ||
width: 5rem; | ||
} | ||
} | ||
</style> |
98 changes: 98 additions & 0 deletions
98
apps/dashboard/src/lib/recent-transactions/EventFilterCard.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,98 @@ | ||
<script lang="ts"> | ||
import type { | ||
StreamTransactionsRequestEventFilterItem, | ||
StreamTransactionsRequestEventFilterItemEventEnum | ||
} from '@radixdlt/babylon-gateway-api-sdk' | ||
import FilterCard from './FilterCard.svelte' | ||
import InputNew from '@components/_base/input/InputNew.svelte' | ||
import SimplePicker from '@components/_base/picker/simple-picker/SimplePicker.svelte' | ||
import ButtonNew from '@components/_base/button/ButtonNew.svelte' | ||
import { shortenAddress } from '@utils' | ||
export let title: string | ||
export let description: string | ||
export let events: StreamTransactionsRequestEventFilterItem[] = [] | ||
let emitterAddress = '' | ||
let resourceAddress = '' | ||
let selected: { | ||
label: string | ||
value: StreamTransactionsRequestEventFilterItemEventEnum | ||
} | ||
</script> | ||
|
||
<FilterCard | ||
{title} | ||
{description} | ||
appliedFilters={events.map( | ||
(event) => | ||
`${event.event} ${shortenAddress(event.emitter_address)} ${shortenAddress( | ||
event.resource_address | ||
)}` | ||
)} | ||
> | ||
<div class="input"> | ||
<SimplePicker | ||
bind:selected | ||
options={[ | ||
{ | ||
label: 'Withdrawal', | ||
value: 'Withdrawal', | ||
default: true | ||
}, | ||
{ | ||
label: 'Deposit', | ||
value: 'Deposit' | ||
} | ||
]} | ||
/> | ||
|
||
<div class="textinput"> | ||
<InputNew border bind:value={emitterAddress} placeholder="Emitter" /> | ||
</div> | ||
|
||
<div class="textinput"> | ||
<InputNew border bind:value={resourceAddress} placeholder="Resource" /> | ||
</div> | ||
</div> | ||
<div> | ||
<div class="buttons"> | ||
<ButtonNew | ||
on:click={() => { | ||
events = [ | ||
...events, | ||
{ | ||
event: selected.value, | ||
emitter_address: emitterAddress, | ||
resource_address: resourceAddress | ||
} | ||
] | ||
emitterAddress = '' | ||
resourceAddress = '' | ||
}} | ||
> | ||
Add | ||
</ButtonNew> | ||
|
||
<ButtonNew | ||
on:click={() => { | ||
events = [] | ||
}}>Clear All</ButtonNew | ||
> | ||
</div> | ||
</div> | ||
</FilterCard> | ||
|
||
<style lang="scss"> | ||
.input { | ||
display: flex; | ||
margin: var(--spacing-xl) 0; | ||
gap: var(--spacing-xl); | ||
} | ||
.buttons { | ||
display: flex; | ||
gap: var(--spacing-md); | ||
} | ||
</style> |
63 changes: 63 additions & 0 deletions
63
apps/dashboard/src/lib/recent-transactions/FilterCard.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,63 @@ | ||
<script lang="ts"> | ||
import Pill from '@components/_base/pills-menu/Pill.svelte' | ||
export let title: string | ||
export let description: string | ||
export let appliedFilters: string[] = [] | ||
</script> | ||
|
||
<div class="card"> | ||
<div class="text"> | ||
<div class="title"> | ||
{title} | ||
</div> | ||
<div class="description"> | ||
{description} | ||
</div> | ||
<slot /> | ||
|
||
<div class="pills"> | ||
{#each appliedFilters as filter} | ||
<Pill disabled={Promise.resolve(true)}>{filter}</Pill> | ||
{/each} | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<style lang="scss"> | ||
.card { | ||
border-radius: var(--border-radius-lg); | ||
border: var(--border) var(--theme-border); | ||
width: 100%; | ||
padding: var(--spacing-xl); | ||
box-shadow: var(--shadow); | ||
} | ||
.text { | ||
display: flex; | ||
flex-direction: column; | ||
gap: var(--spacing-xs); | ||
.title { | ||
font-size: var(--text-lg); | ||
font-weight: var(--font-weight-bold-3); | ||
} | ||
.description { | ||
font-size: var(--text-md); | ||
font-weight: var(--font-weight-bold-1); | ||
color: var(--theme-subtext); | ||
} | ||
} | ||
.pills { | ||
margin-top: var(--spacing-xl); | ||
display: flex; | ||
gap: var(--spacing-md); | ||
flex-wrap: wrap; | ||
:global(.pill) { | ||
background: var(--theme-surface-3); | ||
} | ||
} | ||
</style> |
27 changes: 27 additions & 0 deletions
27
apps/dashboard/src/lib/recent-transactions/OptionsFilter.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,27 @@ | ||
<script lang="ts"> | ||
import SimplePicker from '@components/_base/picker/simple-picker/SimplePicker.svelte' | ||
import FilterCard from './FilterCard.svelte' | ||
import ButtonNew from '@components/_base/button/ButtonNew.svelte' | ||
export let title: string | ||
export let description: string | ||
export let options: { label: string; value: string }[] = [] | ||
export let selected: { label: string; value: string } | undefined | ||
</script> | ||
|
||
<FilterCard {title} {description}> | ||
<div class="picker"> | ||
<SimplePicker bind:selected {options} /> | ||
</div> | ||
<ButtonNew | ||
on:click={() => { | ||
selected = undefined | ||
}}>Clear</ButtonNew | ||
> | ||
</FilterCard> | ||
|
||
<style> | ||
.picker { | ||
margin: var(--spacing-xl) 0; | ||
} | ||
</style> |
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
Oops, something went wrong.