Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(bridge-ui): code review and small fix #17014

Merged
merged 5 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@
menuOpen = false;
};

const openMenu = (event: Event) => {
event.stopPropagation();
const openMenu = () => {
menuOpen = true;
};

Expand Down Expand Up @@ -201,7 +200,7 @@
aria-expanded={menuOpen}
class="f-between-center w-full h-full px-[20px] py-[14px] input-box bg-neutral-background border-0 shadow-none outline-none
{combined ? '!rounded-l-[0px] !rounded-r-[10px]' : '!rounded-[10px]'}"
on:click={openMenu}>
on:click|stopPropagation={openMenu}>
<div class="space-x-2">
{#if !value || disabled}
<span class="title-subsection-bold text-base text-secondary-content">{$t('token_dropdown.label')}</span>
Expand Down
7 changes: 3 additions & 4 deletions packages/bridge-ui/src/components/Tooltip/Tooltip.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
}, ms);
}

function openTooltip(event: Event) {
event.stopPropagation();
function openTooltip() {
tooltipOpen = true;
}

Expand All @@ -45,8 +44,8 @@
aria-haspopup="dialog"
aria-controls={tooltipId}
aria-expanded={tooltipOpen}
on:click={openTooltip}
on:focus={openTooltip}
on:click|stopPropagation={openTooltip}
on:focus|stopPropagation={openTooltip}
on:mouseenter={openTooltip}
bind:this={triggerElem}>
<Icon type="question-circle" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
let openStatusDialog = false;

let tooltipOpen = false;
const openToolTip = (event: Event) => {
event.stopPropagation();
const openToolTip = () => {
tooltipOpen = !tooltipOpen;
};
let dialogId = `dialog-${uid()}`;
Expand Down Expand Up @@ -119,7 +118,7 @@
<li class="f-between-center">
<h4 class="text-secondary-content">
<div class="f-items-center space-x-1">
<button on:click={openToolTip}>
<button on:click|stopPropagation={openToolTip}>
<span>{$t('transactions.header.status')}</span>
</button>
<button on:click={handleStatusDialog} class="flex justify-start content-center">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,8 @@
<h4 class={classes.headline}>{$t('transactions.status.failed.name')}</h4>
{$t('transactions.status.failed.description')}
</div>

<!-- We catch key events aboe -->
<!-- svelte-ignore a11y-click-events-have-key-events -->
<div role="button" tabindex="0" class="overlay-backdrop" on:click={closeModalIfClickedOutside} />
</div>
<!-- We catch key events aboe -->
<!-- svelte-ignore a11y-click-events-have-key-events -->
<div role="button" tabindex="0" class="overlay-backdrop" on:click={closeModalIfClickedOutside} />
</dialog>