Skip to content

Commit

Permalink
fix: mobile improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
JackHamer09 committed Jan 3, 2024
1 parent 8eb42c6 commit 83cf7e5
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 19 deletions.
6 changes: 3 additions & 3 deletions components/common/input/TransactionAddress.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<template>
<CommonContentBlock for="transaction-address-input" as="label" class="transaction-address-input">
<div class="flex items-center gap-4">
<div class="flex flex-wrap items-center gap-2 sm:flex-nowrap">
<div class="flex flex-wrap items-center justify-between gap-4">
<div class="flex items-center gap-2 overflow-hidden">
<div class="font-bold">{{ label }}</div>
<slot name="dropdown" />
</div>
<div v-if="defaultLabel && isConnected" class="ml-auto text-right">
<div v-if="defaultLabel && isConnected">
<span class="font-bold">{{ inputVisible ? "To another account" : defaultLabel }}</span>
<CommonButtonLabel variant="light" class="ml-1" @click="toggleCustomValue()">
{{ inputVisible ? "Use my account" : "Change" }}
Expand Down
6 changes: 3 additions & 3 deletions components/common/input/TransactionAmount.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
</template>
</TokenSelectModal>
<CommonContentBlock for="transaction-amount-input" as="label">
<div class="flex items-center gap-4">
<div class="flex flex-wrap items-center gap-2 sm:flex-nowrap">
<div class="flex flex-wrap items-center justify-between gap-4">
<div class="flex items-center gap-2 overflow-hidden">
<div class="font-bold">{{ label }}</div>
<slot name="dropdown" />
</div>
<transition v-bind="TransitionOpacity()">
<template v-if="displayedMaxAmount && displayedMaxAmount !== '0'">
<span class="ml-auto text-right">
<span>
<CommonButtonLabel variant="light" as="span">Max:&nbsp;</CommonButtonLabel>
<CommonButtonLabel
variant="light"
Expand Down
21 changes: 17 additions & 4 deletions components/header/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@
<NuxtLink
class="link-item"
:to="{ name: 'index' }"
:class="{ 'router-link-exact-active': route.name === 'withdraw' }"
:class="{ 'router-link-exact-active': routes.bridge.includes(route.name?.toString() || '') }"
>
<ArrowsUpDownIcon class="link-icon" aria-hidden="true" />
Bridge
</NuxtLink>
<NuxtLink class="link-item" :to="{ name: 'assets' }">
<NuxtLink
class="link-item"
:to="{ name: 'assets' }"
:class="{ 'router-link-exact-active': routes.assets.includes(route.name?.toString() || '') }"
>
<WalletIcon class="link-icon" aria-hidden="true" />
Assets
</NuxtLink>
Expand Down Expand Up @@ -70,6 +74,11 @@ import { useOnboardStore } from "@/store/onboard";
const route = useRoute();
const routes = {
bridge: ["index", "withdraw"],
assets: ["assets", "balances", "receive-methods", "receive", "send-methods", "send"],
};
const onboardStore = useOnboardStore();
const { isConnected } = storeToRefs(onboardStore);
Expand All @@ -95,11 +104,15 @@ const { selectedColorMode, switchColorMode } = useColorMode();
.link-item {
@apply flex items-center gap-1 text-lg text-neutral-600 dark:text-neutral-500;
&.router-link-exact-active {
@apply text-neutral-950 dark:text-white;
@apply text-black dark:text-white;
.link-icon {
@apply text-black dark:text-white;
}
}
.link-icon {
@apply h-6 w-6;
@apply h-6 w-6 text-neutral-400 dark:text-neutral-500;
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions components/token/TokenBalance.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
:decimals="decimals"
:icon-url="iconUrl"
:as="sendRouteName ? 'RouterLink' : as"
:icon="sendRouteName ? PaperAirplaneIcon : undefined"
:to="sendRouteName ? { name: sendRouteName, query: { token: address } } : undefined"
class="token-balance"
:class="{ 'is-zero-amount': isZeroAmount }"
Expand All @@ -33,7 +32,6 @@
<script lang="ts" setup>
import { computed } from "vue";
import { PaperAirplaneIcon } from "@heroicons/vue/24/outline";
import { BigNumber } from "ethers";
import type { TokenPrice } from "@/types";
Expand Down
24 changes: 23 additions & 1 deletion components/token/TokenImage.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
<template>
<CommonImageLoader :src="iconUrl" :alt="`${symbol} token icon`" class="token-image-container">
<template #placeholder>
<div class="token-placeholder"></div>
<div class="token-placeholder">
<svg
v-if="!iconUrl"
class="no-icon-placeholder"
viewBox="0 0 100 100"
preserveAspectRatio="xMidYMid meet"
aria-hidden="true"
>
<text
x="50%"
y="55%"
dominant-baseline="middle"
text-anchor="middle"
style="fill: currentColor; font-size: 50px"
>
{{ symbol[0] }}
</text>
</svg>
</div>
</template>
</CommonImageLoader>
</template>
Expand All @@ -24,6 +42,10 @@ defineProps({
.token-placeholder {
@apply h-full w-full rounded-full border border-neutral-400 bg-neutral-200 dark:border-neutral-500 dark:bg-neutral-700;
.no-icon-placeholder {
@apply h-full w-full opacity-50;
}
}
}
</style>
10 changes: 6 additions & 4 deletions pages/balances.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
as="div"
:key="item.address"
show-name-link
:send-route-name="eraNetwork.l1Network ? 'send-methods' : 'send'"
:send-route-name="
item.amount === '0' ? 'receive-methods' : eraNetwork.l1Network ? 'send-methods' : 'send'
"
v-bind="item"
/>
</CommonCardWithLineButtons>
Expand All @@ -49,17 +51,17 @@ import { useZkSyncWalletStore } from "@/store/zksync/wallet";
import { groupBalancesByAmount } from "@/utils/mappers";
const onboardStore = useOnboardStore();
const walletStore = useZkSyncWalletStore();
const walletEraStore = useZkSyncWalletStore();
const { isConnected } = storeToRefs(onboardStore);
const { balance, balanceInProgress, balanceError } = storeToRefs(walletStore);
const { balance, balanceInProgress, balanceError } = storeToRefs(walletEraStore);
const { eraNetwork } = storeToRefs(useZkSyncProviderStore());
const { loading, reset: resetSingleLoading } = useSingleLoading(computed(() => balanceInProgress.value));
const balanceGroups = groupBalancesByAmount(balance);
const fetch = () => {
walletStore.requestBalance();
walletEraStore.requestBalance();
};
fetch();
Expand Down
6 changes: 4 additions & 2 deletions views/transactions/Transfer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,13 @@
:toggled="fromNetworkModalOpened"
size="xs"
variant="light"
class="overflow-hidden"
@click="fromNetworkModalOpened = true"
>
<template #left-icon>
<img :src="destinations.era.iconUrl" class="h-full w-full" />
</template>
<span>{{ destinations.era.label }}</span>
<span class="truncate">{{ destinations.era.label }}</span>
</CommonButtonDropdown>
</template>
</CommonInputTransactionAmount>
Expand All @@ -75,12 +76,13 @@
:toggled="toNetworkModalOpened"
size="xs"
variant="light"
class="overflow-hidden"
@click="toNetworkModalOpened = true"
>
<template #left-icon>
<img :src="destination.iconUrl" class="h-full w-full" />
</template>
<span>{{ destination.label }}</span>
<span class="truncate">{{ destination.label }}</span>
</CommonButtonDropdown>
</template>
</CommonInputTransactionAddress>
Expand Down

0 comments on commit 83cf7e5

Please sign in to comment.