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

refactor(bridge-ui-v2): menu changes #14085

Merged
merged 46 commits into from
Jul 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
6f170e9
typescript module
jscriptcoder Jun 26, 2023
3ae1fba
add pages
jscriptcoder Jun 26, 2023
b6e22a0
wip
jscriptcoder Jun 26, 2023
d881b45
wip
jscriptcoder Jun 26, 2023
da75567
Merge branch 'main' into bridge_form
jscriptcoder Jun 26, 2023
2f493b6
wip
jscriptcoder Jun 26, 2023
8e4c675
Merge branch 'bridge_form' of https://github.com/taikoxyz/taiko-mono …
jscriptcoder Jun 26, 2023
d0bb01b
wip
jscriptcoder Jun 26, 2023
21650bf
TokenDropdown component
jscriptcoder Jun 27, 2023
0ea5713
wip
jscriptcoder Jun 27, 2023
ff4b397
improve TokenDropdown
jscriptcoder Jun 27, 2023
11ec35a
wip: Chain selector
jscriptcoder Jun 27, 2023
9021fca
wip
jscriptcoder Jun 27, 2023
43e1280
wip
jscriptcoder Jun 27, 2023
087cf47
ChainSelector component
jscriptcoder Jun 27, 2023
b3f4ecd
add RecipientInput
jscriptcoder Jun 28, 2023
138bda7
Add Tooltip
jscriptcoder Jun 28, 2023
4f446ba
add unit test
jscriptcoder Jun 28, 2023
bbacbd4
add unit test
jscriptcoder Jun 28, 2023
3ba0680
mobile version
jscriptcoder Jun 28, 2023
a6a63ee
wip
jscriptcoder Jun 28, 2023
b7a5b5d
wip
jscriptcoder Jun 28, 2023
3ba5824
wip
jscriptcoder Jun 28, 2023
0417333
wip
jscriptcoder Jun 28, 2023
186529e
wip
jscriptcoder Jun 29, 2023
fd23e84
wip
jscriptcoder Jun 29, 2023
2f44217
wip: processing fee
jscriptcoder Jun 29, 2023
652ff32
Merge branch 'main' into bridge_form
jscriptcoder Jun 29, 2023
8e3c002
wip: processing fee
jscriptcoder Jun 29, 2023
31ab860
Merge branch 'bridge_form' of https://github.com/taikoxyz/taiko-mono …
jscriptcoder Jun 29, 2023
e57dc5c
wip
jscriptcoder Jun 29, 2023
be21f54
wip
jscriptcoder Jun 29, 2023
6940dcf
Merge branch 'main' into bridge_form
jscriptcoder Jun 30, 2023
457dec6
Bridge form
jscriptcoder Jun 30, 2023
9ce39ba
Merge branch 'bridge_form' of https://github.com/taikoxyz/taiko-mono …
jscriptcoder Jun 30, 2023
e6c0b80
wip: mobile
jscriptcoder Jun 30, 2023
ddcef19
minor change
jscriptcoder Jun 30, 2023
32b9859
fix lint
jscriptcoder Jun 30, 2023
20ee5a7
Faucet component
jscriptcoder Jun 30, 2023
00778d5
lint fix
jscriptcoder Jun 30, 2023
c59d814
align to design
jscriptcoder Jun 30, 2023
62e9f0f
wip
jscriptcoder Jul 1, 2023
094aa1b
merge main
jscriptcoder Jul 1, 2023
7ba1dde
fix menu for small devices
jscriptcoder Jul 2, 2023
c125e9e
minor comment
jscriptcoder Jul 2, 2023
7c888e5
minor comment
jscriptcoder Jul 2, 2023
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
2 changes: 1 addition & 1 deletion packages/bridge-ui-v2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@typescript-eslint/eslint-plugin": "^5.45.0",
"@typescript-eslint/parser": "^5.45.0",
"autoprefixer": "^10.4.14",
"daisyui": "3.1.1",
"daisyui": "3.1.7",
"eslint": "^8.28.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-simple-import-sort": "^10.0.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/bridge-ui-v2/src/components/Header/Header.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
class="
f-between-center
py-[20px]
px-4 border-b
px-4
border-b
border-b-divider-border
md:border-b-0
md:px-10 md:py-7
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@
export let href = '/';
export let external = false;

$: activeClass = active ? 'bg-primary-interactive hover:bg-primary-interactive-hover' : '';
$: activeClass = active
? 'body-bold bg-primary-interactive hover:bg-primary-interactive-hover'
: 'body-regular hover:bg-secondary-interactive-hover';
</script>

<a
{href}
target={external ? '_blank' : null}
class={classNames(
'btn btn-sm md:btn-md btn-ghost p-3 rounded-full body-bold flex justify-start content-center',
activeClass,
)}>
class={classNames('p-3 rounded-full flex justify-start content-center', activeClass)}>
<slot />
</a>
Original file line number Diff line number Diff line change
Expand Up @@ -12,66 +12,91 @@
import { LinkButton } from '../LinkButton';
import { LogoWithText } from '../Logo';

let drawerToggleElem: HTMLInputElement;

$: isBridgePage = $page.route.id === '/';
$: isFaucetPage = $page.route.id === '/faucet';
$: isActivitiesPage = $page.route.id === '/activities';

function closeDrawer() {
drawerToggleElem.checked = false;
}

function onMenuKeydown(event: KeyboardEvent) {
if (event.key === 'Escape' || event.key === 'Enter') {
closeDrawer();
}
}
</script>

<div class="drawer md:drawer-open">
<input id={drawerToggleId} type="checkbox" class="drawer-toggle" />
<div class="drawer md:drawer-open overflow-hidden">
<input id={drawerToggleId} type="checkbox" class="drawer-toggle" bind:this={drawerToggleElem} />

<div class="drawer-content">
<slot />
</div>

<div class="drawer-side z-1 bg-primary-background">
<label for={drawerToggleId} class="drawer-overlay bg-overlay-background" />
<div class="drawer-side h-full">
<label for={drawerToggleId} class="drawer-overlay" />

<!--
Slow transitions can be pretty annoying after a while.
Let's reduce it to 100ms for a better experience.
-->
<div class="w-h-full !duration-100">
<header class="flex justify-end py-[20px] px-4 md:hidden">
<button on:click={closeDrawer} class="h-9">
<Icon type="x-close" fillClass="fill-primary-icon" size={24} />
</button>
</header>

<aside
class="
p-2
w-[226px]
h-full
md:px-4
md:py-8
md:border-r
md:border-r-divider-border">
<a href="/" class="hidden md:inline-block">
<LogoWithText />
</a>
<aside
class="
h-full
px-[20px]
md:mt-0
md:px-4
md:py-8
md:w-[226px]
md:border-r
md:border-r-divider-border">
<a href="/" class="hidden md:inline-block">
<LogoWithText />
</a>

<ul class="menu md:pt-10 space-y-2">
<li>
<LinkButton active={isBridgePage}>
<Icon type="bridge" fillClass="fill-white" />
<span>{$t('nav.bridge')}</span>
</LinkButton>
</li>
<li>
<LinkButton href="/faucet" active={isFaucetPage}>
<Icon type="faucet" />
<span>{$t('nav.faucet')}</span>
</LinkButton>
</li>
<li>
<LinkButton href="/activities" active={isActivitiesPage}>
<Icon type="activities" />
<span>{$t('nav.activities')}</span>
</LinkButton>
</li>
<li>
<LinkButton href={PUBLIC_L2_EXPLORER_URL} external>
<Icon type="explorer" />
<span>{$t('nav.explorer')}</span>
</LinkButton>
</li>
<li>
<LinkButton href={PUBLIC_GUIDE_URL} external>
<Icon type="guide" />
<span>{$t('nav.guide')}</span>
</LinkButton>
</li>
</ul>
</aside>
<ul class="menu p-0 md:pt-10 space-y-2" on:click={closeDrawer} on:keydown={onMenuKeydown}>
<li>
<LinkButton active={isBridgePage}>
<Icon type="bridge" fillClass="fill-white" />
<span>{$t('nav.bridge')}</span>
</LinkButton>
</li>
<li>
<LinkButton href="/faucet" active={isFaucetPage}>
<Icon type="faucet" />
<span>{$t('nav.faucet')}</span>
</LinkButton>
</li>
<li>
<LinkButton href="/activities" active={isActivitiesPage}>
<Icon type="activities" />
<span>{$t('nav.activities')}</span>
</LinkButton>
</li>
<li>
<LinkButton href={PUBLIC_L2_EXPLORER_URL} external>
<Icon type="explorer" />
<span>{$t('nav.explorer')}</span>
</LinkButton>
</li>
<li>
<LinkButton href={PUBLIC_GUIDE_URL} external>
<Icon type="guide" />
<span>{$t('nav.guide')}</span>
</LinkButton>
</li>
</ul>
</aside>
</div>
</div>
</div>
9 changes: 9 additions & 0 deletions packages/bridge-ui-v2/src/styles/override.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,12 @@ input::-webkit-inner-spin-button {
input[type='number'] {
-moz-appearance: textfield;
}

/**
* Overrides the dafault color for the overlay component used
* in DaisyUI's drawer. Unfortunately cannot be done via variables
*/
.drawer-toggle:checked ~ .drawer-side > .drawer-overlay {
/* Primary background: '#0B101B' => grey-900 */
background-color: hsl(221, 42%, 7%);
}
4 changes: 4 additions & 0 deletions packages/bridge-ui-v2/src/styles/utilities.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
@apply hidden md:inline-block;
}

.w-h-full {
@apply w-full h-full;
}

/* Flex shortcuts */
.f-between-center {
@apply flex justify-between items-center;
Expand Down
Loading