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

hide eth on withdraw for mantle #219

Merged
merged 1 commit into from
May 3, 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
19 changes: 15 additions & 4 deletions components/token/TokenSelectModal.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
<template>
<CommonModal v-model:opened="isModalOpened" class="token-select-modal" :class="{ 'token-modal': title === 'Choose chain and token' }" :title="title" @after-leave="search = ''">
<CommonModal
v-model:opened="isModalOpened"
class="token-select-modal"
:class="{ 'token-modal': title === 'Choose chain and token' }"
:title="title"
@after-leave="search = ''"
>
<div v-if="title === 'Choose chain and token'" class="mb-4">
<div class="flex gap-2 flex-wrap">
<div v-for="(group, groupIndex) in arr" :key="groupIndex" class="chainBox cursor-pointer" :class="{'active': selectChain === group.key}"
@click="buttonClicked(zkSyncNetwork.find(item => item.key === group.key)!);">
<img :src="group.iconUrl" :alt="group.label"/>
<div
v-for="(group, groupIndex) in arr"
:key="groupIndex"
class="chainBox cursor-pointer"
:class="{ active: selectChain === group.key }"
@click="buttonClicked(zkSyncNetwork.find(item => item.key === group.key)!);"
>
<img :src="group.iconUrl" :alt="group.label" />
</div>
</div>
<p v-if="!arr.length" class="mt-block-padding-1/2 text-center">No chains found</p>
Expand Down
57 changes: 28 additions & 29 deletions views/transactions/Withdraw.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,13 @@
Confirm transaction
</PageTitle>
<div class="tab">
<div class="box" :class="{ 'active': showBridge }" @click="showBridge =true">
<div class="name">
Use the official Bridge
</div>
<div class="time">
Up to 8 days, no additional fee
</div>
<div class="box" :class="{ active: showBridge }" @click="showBridge = true">
<div class="name">Use the official Bridge</div>
<div class="time">Up to 8 days, no additional fee</div>
</div>
<div class="box" :class="{ 'active': !showBridge }" @click="showBridge =false">
<div class="name">
Use a third party bridge
</div>
<div class="time">
Usually takes under 20 mins
</div>
<div class="box" :class="{ active: !showBridge }" @click="showBridge = false">
<div class="name">Use a third party bridge</div>
<div class="time">Usually takes under 20 mins</div>
</div>
</div>
<div class="warnBox flex" v-if="!route.query.s || route.query.s !== 'okx'">
Expand Down Expand Up @@ -618,7 +610,9 @@ const availableTokens = computed(() => {
if (!e.l1Address) {
return false;
}
if (e.l1Address === ETH_ADDRESS) {
if (selectedNetwork.value.key === "mantle" && e.l1Address === ETH_ADDRESS) {
return false;
} else if (e.l1Address === ETH_ADDRESS) {
return true;
}
if (e.networkKey === eraNetwork.value.key) {
Expand All @@ -639,7 +633,9 @@ const availableBalances = computed(() => {
if (!e.l1Address) {
return false;
}
if (e.l1Address === ETH_ADDRESS) {
if (selectedNetwork.value.key === "mantle" && e.l1Address === ETH_ADDRESS) {
return false;
} else if (e.l1Address === ETH_ADDRESS) {
return true;
}
if (e.networkKey === eraNetwork.value.key) {
Expand All @@ -666,7 +662,10 @@ const tokenWithHighestBalancePrice = computed(() => {
});
const defaultToken = computed(() => availableTokens.value?.[0] ?? undefined);
const selectedTokenAddress = ref<string | undefined>(
route.query.tokenAddress ?? routeTokenAddress.value ?? tokenWithHighestBalancePrice.value?.address ?? defaultToken.value?.address
route.query.tokenAddress ??
routeTokenAddress.value ??
tokenWithHighestBalancePrice.value?.address ??
defaultToken.value?.address
);
const selectedToken = computed<Token | undefined>(() => {
if (!tokens.value) {
Expand Down Expand Up @@ -1183,50 +1182,50 @@ onBeforeUnmount(() => {
color: #0bc48f;
}
}
.tab{
.tab {
width: 100%;
border-radius: 64px;
background: #262B33;
background: #262b33;
padding: 8px;
display: flex;
margin-bottom: 16px;
.box{
.box {
border-radius: 64px;
display: flex;
flex-direction: column;
align-items: center;
width: 50%;
padding: 7px 0;
cursor: pointer;
.name{
color: #FFF;
.name {
color: #fff;
font-size: 16px;
font-style: normal;
font-weight: 700;
line-height: normal;
}
.time{
color: #9DA3AE;
.time {
color: #9da3ae;
text-align: center;
font-size: 12px;
font-style: normal;
font-weight: 400;
line-height: normal;
}
@media screen and (max-width: 600px) {
.name{
.name {
font-size: 12px;
}
.time{
.time {
font-size: 10px;
}
}
}
.box:focus{
.box:focus {
background: transparent;
}
.active{
background: #3D424D;
.active {
background: #3d424d;
}
}
</style>
Loading