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

fix(bridge-ui): ios dropdown a11y and horizontal padding #425

Merged
merged 3 commits into from
Dec 14, 2022
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
16 changes: 9 additions & 7 deletions packages/bridge-ui/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,15 @@
</script>

<QueryProvider>
<main>
<Navbar {transactioner} />
<Router {routes} />
</main>
<SvelteToast options={toastOptions} />

<SwitchEthereumChainModal />
<div class="lg:container lg:mx-auto lg:px-64">
<main>
<Navbar {transactioner} />
<Router {routes} />
</main>
<SvelteToast options={toastOptions} />

<SwitchEthereumChainModal />
</div>
</QueryProvider>

<style global lang="postcss">
Expand Down
4 changes: 2 additions & 2 deletions packages/bridge-ui/src/components/AddressDropdown.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</script>

<div class="dropdown dropdown-bottom dropdown-end">
<button tabindex="0" class="btn btn-md md:btn-wide justify-around">
<label tabindex="0" class="btn btn-md md:btn-wide justify-around">
<span class="font-normal flex-1 text-left">
{#if $pendingTransactions && $pendingTransactions.length}
{$pendingTransactions.length} Pending
Expand Down Expand Up @@ -75,7 +75,7 @@
</span>

<ChevDown />
</button>
</label>
<ul
tabindex="0"
class="dropdown-content menu p-2 shadow bg-dark-3 rounded-box w-[194px]"
Expand Down
4 changes: 2 additions & 2 deletions packages/bridge-ui/src/components/ChainDropdown.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</script>

<div class="dropdown dropdown-bottom dropdown-end mr-4">
<button tabindex="0" class="btn btn-md md:btn-wide justify-around">
<label tabindex="0" class="btn btn-md md:btn-wide justify-around">
<span class="font-normal flex-1 text-left mr-2">
{#if $fromChain}
<svelte:component this={$fromChain.icon} />
Expand All @@ -37,7 +37,7 @@
</span>

<ChevDown />
</button>
</label>
<ul
tabindex="0"
class="dropdown-content flex menu p-2 shadow bg-dark-3 rounded-box w-[194px]"
Expand Down
12 changes: 9 additions & 3 deletions packages/bridge-ui/src/components/buttons/SelectToken.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,18 @@
</script>

<div class="dropdown dropdown-bottom">
<button tabindex="0" class="flex items-center justify-center">
<label
tabindex="0"
class="flex items-center justify-center hover:cursor-pointer"
>
<svelte:component this={$token.logoComponent} class="inline-block" />
<p class="px-2 text-sm">{$token.symbol.toUpperCase()}</p>
<ChevDown />
</button>
<ul class="dropdown-content menu py-2 shadow-xl bg-base-100 rounded-box">
</label>
<ul
tabindex="0"
class="dropdown-content menu py-2 shadow-xl bg-base-100 rounded-box"
>
{#each tokens as t}
<li class="cursor-pointer w-full hover:bg-dark-3 px-7 py-3">
<button
Expand Down
12 changes: 8 additions & 4 deletions packages/bridge-ui/src/components/form/SelectChain.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import ArrowRight from "../icons/ArrowRight.svelte";
import ArrowRightLeft from "../icons/ArrowRightLeft.svelte";
import { fromChain, toChain } from "../../store/chain";
import { CHAIN_MAINNET, CHAIN_TKO } from "../../domain/chain";
import { ethereum } from "../../store/ethereum";
Expand Down Expand Up @@ -27,7 +27,9 @@
};
</script>

<div class="flex items-center justify-between w-full px-4 md:px-8 py-6 text-sm md:text-lg">
<div
class="flex items-center justify-between w-full px-4 md:px-8 py-6 text-sm md:text-lg"
>
<div class="flex items-center w-2/5 justify-center">
{#if $fromChain}
<svelte:component this={$fromChain.icon} />
Expand All @@ -38,8 +40,10 @@
{/if}
</div>

<button on:click={toggleChains} class="btn btn-square btn-xs" disabled={!$signer}
><ArrowRight /></button
<button
on:click={toggleChains}
class="btn btn-square btn-xs"
disabled={!$signer}><ArrowRightLeft /></button
>
<div class="flex items-center w-2/5 justify-center">
{#if $toChain}
Expand Down
3 changes: 0 additions & 3 deletions packages/bridge-ui/src/components/icons/ArrowRight.svelte

This file was deleted.

14 changes: 14 additions & 0 deletions packages/bridge-ui/src/components/icons/ArrowRightLeft.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
class="w-6 h-6"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M7.5 21L3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5"
/>
</svg>