Skip to content

Commit 1080072

Browse files
authored
Merge branch 'main' into vault_burn_design_fix
2 parents 6b0f722 + e47ff54 commit 1080072

File tree

17 files changed

+397
-164
lines changed

17 files changed

+397
-164
lines changed

go.mod

+3-2
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,8 @@ require (
229229
github.com/prysmaticlabs/gohashtree v0.0.3-alpha // indirect
230230
github.com/prysmaticlabs/prombbolt v0.0.0-20210126082820-9b7adba6db7c // indirect
231231
github.com/quic-go/qpack v0.4.0 // indirect
232-
github.com/quic-go/quic-go v0.42.0 // indirect
232+
github.com/quic-go/qtls-go1-20 v0.3.4 // indirect
233+
github.com/quic-go/quic-go v0.39.4 // indirect
233234
github.com/quic-go/webtransport-go v0.6.0 // indirect
234235
github.com/raulk/go-watchdog v1.3.0 // indirect
235236
github.com/rivo/uniseg v0.4.4 // indirect
@@ -269,7 +270,7 @@ require (
269270
go.opentelemetry.io/otel/trace v1.24.0 // indirect
270271
go.uber.org/dig v1.17.1 // indirect
271272
go.uber.org/fx v1.20.1 // indirect
272-
go.uber.org/mock v0.4.0 // indirect
273+
go.uber.org/mock v0.3.0 // indirect
273274
go.uber.org/multierr v1.11.0 // indirect
274275
go.uber.org/zap v1.26.0 // indirect
275276
golang.org/x/crypto v0.22.0 // indirect

go.sum

+6-4
Original file line numberDiff line numberDiff line change
@@ -992,8 +992,10 @@ github.com/prysmaticlabs/prysm/v4 v4.2.0 h1:87QoRT3Azs7c1Y6SnIq0+CNtQRbAt0sVKGj2
992992
github.com/prysmaticlabs/prysm/v4 v4.2.0/go.mod h1:PQrQtHJeeqTz4K3udN/EX1Gs2xhWR4j93gSj0OQZ1f4=
993993
github.com/quic-go/qpack v0.4.0 h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo=
994994
github.com/quic-go/qpack v0.4.0/go.mod h1:UZVnYIfi5GRk+zI9UMaCPsmZ2xKJP7XBUvVyT1Knj9A=
995-
github.com/quic-go/quic-go v0.42.0 h1:uSfdap0eveIl8KXnipv9K7nlwZ5IqLlYOpJ58u5utpM=
996-
github.com/quic-go/quic-go v0.42.0/go.mod h1:132kz4kL3F9vxhW3CtQJLDVwcFe5wdWeJXXijhsO57M=
995+
github.com/quic-go/qtls-go1-20 v0.3.4 h1:MfFAPULvst4yoMgY9QmtpYmfij/em7O8UUi+bNVm7Cg=
996+
github.com/quic-go/qtls-go1-20 v0.3.4/go.mod h1:X9Nh97ZL80Z+bX/gUXMbipO6OxdiDi58b/fMC9mAL+k=
997+
github.com/quic-go/quic-go v0.39.4 h1:PelfiuG7wXEffUT2yceiqz5V6Pc0TA5ruOd1LcmFc1s=
998+
github.com/quic-go/quic-go v0.39.4/go.mod h1:T09QsDQWjLiQ74ZmacDfqZmhY/NLnw5BC40MANNNZ1Q=
997999
github.com/quic-go/webtransport-go v0.6.0 h1:CvNsKqc4W2HljHJnoT+rMmbRJybShZ0YPFDD3NxaZLY=
9981000
github.com/quic-go/webtransport-go v0.6.0/go.mod h1:9KjU4AEBqEQidGHNDkZrb8CAa1abRaosM2yGOyiikEc=
9991001
github.com/rabbitmq/amqp091-go v1.9.0 h1:qrQtyzB4H8BQgEuJwhmVQqVHB9O4+MNDJCCAcpc3Aoo=
@@ -1225,8 +1227,8 @@ go.uber.org/fx v1.20.1/go.mod h1:iSYNbHf2y55acNCwCXKx7LbWb5WG1Bnue5RDXz1OREg=
12251227
go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
12261228
go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A=
12271229
go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4=
1228-
go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU=
1229-
go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc=
1230+
go.uber.org/mock v0.3.0 h1:3mUxI1No2/60yUYax92Pt8eNOEecx2D3lcXZh2NEZJo=
1231+
go.uber.org/mock v0.3.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc=
12301232
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
12311233
go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4=
12321234
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=

packages/bridge-ui/src/components/Alert/FlatAlert.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
info: {
3131
textClass: 'text-secondary-content',
3232
iconType: 'info-circle',
33-
iconFillClass: 'fill-info-content',
33+
iconFillClass: 'fill-secondary-content',
3434
},
3535
};
3636

packages/bridge-ui/src/components/Bridge/SharedBridgeComponents/AddressInput/AddressInput.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999

100100
<!-- Conditional alerts -->
101101
{#if !quiet}
102-
<div class="">
102+
<div class="pt-[8px]">
103103
{#if state === State.INVALID && ethereumAddress}
104104
<FlatAlert type="error" forceColumnFlow message={$t('inputs.address_input.errors.invalid')} />
105105
{:else if state === State.TOO_SHORT && ethereumAddress}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<script lang="ts">
2+
import { createEventDispatcher } from 'svelte';
3+
4+
import { classNames } from '$libs/util/classNames';
5+
6+
const dispatch = createEventDispatcher();
7+
8+
export let active: boolean;
9+
10+
function onClick() {
11+
dispatch('click');
12+
}
13+
</script>
14+
15+
<button
16+
role="tab"
17+
aria-selected={active}
18+
class:tab-active={active}
19+
class={classNames('tab !border-color-red', active ? 'tab-active ' : '')}
20+
on:click={onClick}>
21+
<slot></slot>
22+
</button>
23+
24+
<style>
25+
.tab {
26+
box-sizing: border-box !important;
27+
padding-bottom: 6px;
28+
}
29+
.tab:not(.tab-active) {
30+
border-color: var(--tertiary-content) !important;
31+
border-bottom: 1px solid;
32+
margin-bottom: 2px;
33+
padding-top: 2px;
34+
}
35+
.tab-active {
36+
border-bottom: 4px solid;
37+
border-color: var(--primary-brand) !important;
38+
padding-bottom: 4px;
39+
}
40+
</style>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<script lang="ts">
2+
import { createEventDispatcher } from 'svelte';
3+
4+
import DialogTab from './DialogTab.svelte';
5+
6+
export let tabs: { id: string; title: string }[];
7+
export let activeTab: string;
8+
const dispatch = createEventDispatcher();
9+
10+
function setActiveTab(tabId: string) {
11+
if (activeTab !== tabId) {
12+
activeTab = tabId;
13+
dispatch('change', { tabId });
14+
}
15+
}
16+
</script>
17+
18+
<div role="tablist" class="tabs">
19+
{#each tabs as tab}
20+
<DialogTab active={tab.id === activeTab} on:click={() => setActiveTab(tab.id)}>
21+
{tab.title}
22+
</DialogTab>
23+
{/each}
24+
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export { default as DialogTab } from './DialogTab.svelte';
2+
export { default as DialogTabs } from './DialogTabs.svelte';

packages/bridge-ui/src/components/Icon/Icon.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@
202202
class={fillClass}
203203
fill-rule="evenodd"
204204
clip-rule="evenodd"
205-
d="M20,6H16V5a3,3,0,0,0-3-3H11A3,3,0,0,0,8,5V6H4A1,1,0,0,0,4,8H5V19a3,3,0,0,0,3,3h8a3,3,0,0,0,3-3V8h1a1,1,0,0,0,0-2ZM10,5a1,1,0,0,1,1-1h2a1,1,0,0,1,1,1V6H10Zm7,14a1,1,0,0,1-1,1H8a1,1,0,0,1-1-1V8H17Z" />
205+
d="M6.12461 0.699951C5.06146 0.699951 4.19961 1.5618 4.19961 2.62495V2.93484C3.64291 2.98875 3.09083 3.05858 2.54381 3.14386C2.25733 3.18852 2.06129 3.45697 2.10595 3.74346C2.15061 4.02995 2.41907 4.22599 2.70556 4.18132L2.80909 4.16538L3.39814 11.5285C3.47817 12.5289 4.31339 13.2999 5.31701 13.2999H8.68206C9.68568 13.2999 10.5209 12.5289 10.6009 11.5285L11.19 4.16534L11.2938 4.18132C11.5803 4.22599 11.8488 4.02995 11.8934 3.74346C11.9381 3.45697 11.742 3.18852 11.4556 3.14386C10.9085 3.05857 10.3564 2.98874 9.79961 2.93482V2.62495C9.79961 1.5618 8.93776 0.699951 7.87461 0.699951H6.12461ZM6.99968 2.79995C7.58723 2.79995 8.17071 2.81761 8.74961 2.85244V2.62495C8.74961 2.1417 8.35786 1.74995 7.87461 1.74995H6.12461C5.64136 1.74995 5.24961 2.1417 5.24961 2.62495V2.85245C5.82856 2.81762 6.41208 2.79995 6.99968 2.79995ZM5.94903 5.40625C5.93868 5.14758 5.72059 4.94626 5.46192 4.95661C5.20324 4.96696 5.00193 5.18505 5.01228 5.44372L5.22229 10.6937C5.23263 10.9524 5.45072 11.1537 5.7094 11.1434C5.96807 11.133 6.16938 10.9149 6.15904 10.6563L5.94903 5.40625ZM8.98704 5.44372C8.99738 5.18505 8.79607 4.96696 8.5374 4.95661C8.27872 4.94627 8.06063 5.14758 8.05029 5.40625L7.84029 10.6563C7.82994 10.9149 8.03125 11.133 8.28993 11.1434C8.5486 11.1537 8.76669 10.9524 8.77704 10.6937L8.98704 5.44372Z" />
206206
{:else if type === 'adjustments'}
207207
<path
208208
class={fillClass}

packages/bridge-ui/src/components/InputBox/InputBox.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
$: disabled = $$props.disabled || false;
1010
1111
let classes = classNames(
12-
'w-full input-box bg-neutral-background shadow-none placeholder:text-tertiary-content font-bold shadow-none outline-none ',
12+
'w-full input-box bg-neutral-background placeholder:text-tertiary-content font-bold',
1313
disabled ? 'cursor-not-allowed ' : 'cursor-pointer',
1414
$$props.class,
1515
);

packages/bridge-ui/src/components/TokenDropdown/AddCustomERC20.svelte

+11-16
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
3232
export let modalOpen = false;
3333
export let loadingTokenDetails = false;
34+
export let customTokens: Token[] = [];
3435
3536
let addressInputComponent: AddressInput;
3637
let tokenAddress: Address | string = '';
37-
let customTokens: Token[] = [];
3838
let customToken: Token | null = null;
3939
let customTokenWithDetails: Token | null = null;
4040
let disabled = true;
@@ -88,10 +88,6 @@
8888
};
8989
9090
const remove = async (token: Token) => {
91-
log('remove token', token);
92-
const address = $account.address;
93-
tokenService.removeToken(token, address as Address);
94-
customTokens = tokenService.getTokens(address as Address);
9591
dispatch('tokenRemoved', { token });
9692
};
9793
@@ -155,8 +151,6 @@
155151
? formatUnits(customTokenWithDetails.balance, customTokenWithDetails.decimals)
156152
: 0;
157153
158-
$: customTokens = tokenService.getTokens($account?.address as Address);
159-
160154
$: disabled = state !== AddressInputState.VALID || tokenAddress === '' || tokenAddress.length !== 42;
161155
162156
const closeModalIfClickedOutside = (e: MouseEvent) => {
@@ -186,24 +180,20 @@
186180
on:addressvalidation={onAddressValidation}
187181
bind:state
188182
onDialog />
189-
<div class="w-full flex items-center justify-between mt-4">
183+
<div class="w-full flex items-center justify-between">
190184
{#if customTokenWithDetails}
191185
<span>{$t('common.name')}: {customTokenWithDetails.symbol}</span>
192186
<span>{$t('common.balance')}: {formattedBalance}</span>
193187
{:else if state === AddressInputState.INVALID && tokenAddress !== '' && isValidEthereumAddress && !loadingTokenDetails}
194188
<FlatAlert type="error" message={$t('bridge.errors.custom_token.not_found.message')} />
195189
{:else if loadingTokenDetails}
196190
<Spinner />
197-
{:else}
198-
<div class="min-h-[25px]" />
191+
{:else if state === AddressInputState.DEFAULT}
192+
<FlatAlert type="info" message={$t('token_dropdown.custom_token.default_message')} />
199193
{/if}
200194
</div>
201195
</div>
202-
203-
<ActionButton priority="primary" {disabled} on:click={addCustomErc20Token} onPopup>
204-
{$t('token_dropdown.custom_token.button')}
205-
</ActionButton>
206-
196+
<div class="h-sep" />
207197
{#if customTokens.length > 0}
208198
<div class="flex h-full w-full flex-col justify-between mt-6">
209199
<h3 class="title-body-bold mb-7">{$t('token_dropdown.imported_tokens')}</h3>
@@ -217,10 +207,15 @@
217207
<Icon type="trash" fillClass="fill-primary-icon" size={24} />
218208
</button>
219209
</div>
220-
<div class="h-sep" />
221210
{/each}
222211
</div>
212+
{:else}
213+
<span>{$t('token_dropdown.no_imported_token')}</span>
223214
{/if}
215+
<div class="h-sep" />
216+
<ActionButton priority="primary" {disabled} on:click={addCustomErc20Token} onPopup>
217+
{$t('token_dropdown.custom_token.button')}
218+
</ActionButton>
224219
</div>
225220
<!-- We catch key events above -->
226221
<!-- svelte-ignore a11y-click-events-have-key-events -->

0 commit comments

Comments
 (0)