Skip to content

Commit

Permalink
feat(bridge-ui): code review and small fix (#17014)
Browse files Browse the repository at this point in the history
Co-authored-by: Korbinian <[email protected]>
  • Loading branch information
defigeneration and KorbinianK authored May 7, 2024
1 parent fcbc346 commit c20f25f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 14 deletions.
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>

0 comments on commit c20f25f

Please sign in to comment.