-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(bridge-ui-v2): NFT transaction page (#15084)
- Loading branch information
1 parent
92392b2
commit 49741c5
Showing
14 changed files
with
442 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
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
79 changes: 79 additions & 0 deletions
79
packages/bridge-ui-v2/src/components/Transactions/StatusFilterDropdown.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,79 @@ | ||
<script lang="ts"> | ||
import { t } from 'svelte-i18n'; | ||
import IconFlipper from '$components/Icon/IconFlipper.svelte'; | ||
import { MessageStatus } from '$libs/bridge'; | ||
import { classNames } from '$libs/util/classNames'; | ||
import { closeOnEscapeOrOutsideClick } from '$libs/util/customActions'; | ||
export let selectedStatus: MessageStatus | null = null; | ||
let flipped = false; | ||
let iconFlipperComponent: IconFlipper; | ||
let menuOpen = false; | ||
const options = [ | ||
{ value: null, label: $t('transactions.filter.all') }, | ||
{ value: MessageStatus.NEW, label: $t('transactions.filter.processing') }, | ||
{ value: MessageStatus.RETRIABLE, label: $t('transactions.filter.retry') }, | ||
{ value: MessageStatus.DONE, label: $t('transactions.filter.claimed') }, | ||
{ value: MessageStatus.FAILED, label: $t('transactions.filter.failed') }, | ||
]; | ||
const selectOption = (option: (typeof options)[0]) => { | ||
selectedStatus = option.value; | ||
menuOpen = false; | ||
}; | ||
const toggleMenu = () => { | ||
menuOpen = !menuOpen; | ||
flipped = !flipped; | ||
}; | ||
$: menuClasses = classNames( | ||
'menu absolute right-0 w-[210px] p-3 mt-2 rounded-[10px] bg-neutral-background z-10 box-shadow-small', | ||
menuOpen ? 'visible opacity-100' : 'invisible opacity-0', | ||
); | ||
</script> | ||
|
||
<div class="relative"> | ||
<button | ||
aria-haspopup="listbox" | ||
aria-expanded={menuOpen} | ||
class="f-between-center w-[210px] min-h-[36px] max-h-[36px] px-6 bg-neutral border-0 shadow-none outline-none rounded-[6px]" | ||
on:click|stopPropagation={toggleMenu}> | ||
<span class="text-primary-content font-bold"> | ||
{selectedStatus !== null | ||
? options.find((option) => option.value === selectedStatus)?.label | ||
: $t('transactions.filter.all')} | ||
</span> | ||
<IconFlipper | ||
bind:flipped | ||
bind:this={iconFlipperComponent} | ||
iconType1="chevron-left" | ||
iconType2="chevron-down" | ||
selectedDefault="chevron-left" | ||
size={15} /> | ||
</button> | ||
|
||
{#if menuOpen} | ||
<ul | ||
role="listbox" | ||
class={menuClasses} | ||
use:closeOnEscapeOrOutsideClick={{ enabled: menuOpen, callback: () => (menuOpen = false) }}> | ||
{#each options as option (option.value)} | ||
<li | ||
role="option" | ||
aria-selected={option.value === selectedStatus} | ||
tabindex="0" | ||
class="flex items-center h-[56px] px-3 cursor-pointer rounded-[6px]" | ||
on:click={() => selectOption(option)} | ||
on:keydown={() => selectOption(option)}> | ||
<span class="flex w-full h-[56px] text-primary-content font-bold">{option.label}</span> | ||
</li> | ||
{/each} | ||
</ul> | ||
{/if} | ||
</div> |
Oops, something went wrong.
49741c5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
bridge-ui-v2-internal – ./packages/bridge-ui-v2
bridge-ui-v2-internal.vercel.app
bridge-ui-v2-internal-git-main-taikoxyz.vercel.app
bridge-ui-v2-internal-taikoxyz.vercel.app