Skip to content

Commit

Permalink
chore: Update UI
Browse files Browse the repository at this point in the history
  • Loading branch information
AricRedemption committed Apr 23, 2024
1 parent 51a1d37 commit b3ff75f
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 22 deletions.
12 changes: 8 additions & 4 deletions src/components/AssetLogo.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script setup lang="ts">
import FlexBox from './FlexBox.vue'
import { type Chain } from '@/lib/types'
import { UseImage } from '@vueuse/components'
import IncomeLogo from '@/assets/icons-v3/income.svg'
import ExpenseLogo from '@/assets/icons-v3/expense.svg'
import BTCNetworkLogo from '@/assets/icons-v3/network_btc.svg'
Expand All @@ -17,10 +18,13 @@ const { logo, chain, symbol } = defineProps<{

<template>
<div class="relative text-3xl">
<img v-if="logo" :src="logo" :alt="symbol" class="w-full aspect-square" />
<FlexBox ai="center" jc="center" v-else class="rounded-full aspect-square text-white bg-blue-primary">
{{ symbol[0].toLocaleUpperCase() }}
</FlexBox>
<UseImage :src="logo!" class="w-full aspect-square">
<template #error>
<div class="aspect-square flex items-center justify-center rounded-full text-white bg-blue-primary">
{{ symbol[0].toLocaleUpperCase() }}
</div>
</template>
</UseImage>

<template v-if="type === 'network'">
<BTCNetworkLogo v-if="chain === 'btc'" class="absolute bottom-0 right-0 w-6 h-6" />
Expand Down
9 changes: 6 additions & 3 deletions src/components/ResetModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,17 @@ const disconnect = async () => {
/>
</div>

<div class="grid grid-cols-2 gap-x-4">
<button class="reset-button border-gray-700 text-gray-700" @click="$emit('update:show', false)">
<div class="flex items-center justify-center gap-2">
<button
class="w-30 h-12 bg-blue-light text-blue-primary rounded-3xl text-ss"
@click="$emit('update:show', false)"
>
Cancel
</button>
<button
@click="disconnect"
:disabled="!checkedAll"
class="reset-button border-red-600 bg-red-600 text-red-50"
class="w-30 h-12 bg-red-600 text-white rounded-3xl text-ss"
:class="[checkedAll ? 'cursor-pointer' : 'cursor-not-allowed opacity-50 saturate-50']"
>
Reset
Expand Down
10 changes: 3 additions & 7 deletions src/pages/wallet/Asset.vue
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,6 @@ const toSend = () => {
}
const setAddressType = async (addressType: AddressType, _address: string) => {
console.log(addressType)
const chain = asset.value!.chain as Chain
await setV3AddressTypeStorage(chain, addressType)
await updataWallet(chain)
Expand Down Expand Up @@ -190,18 +188,16 @@ const toReceive = () => {
<AssetLogo :logo="asset.logo" :chain="asset.chain" :symbol="asset.symbol" type="network" class="w-15" />

<div class="mt-3 text-2xl">
<span v-if="asset.balance">{{ calcBalance(asset.balance.total, asset.decimal, asset.symbol) }}</span>
<span v-else-if="balance">{{ calcBalance(balance.total, asset.decimal, asset.symbol) }}</span>
<span v-if="balance">{{ calcBalance(balance.total, asset.decimal, asset.symbol) }}</span>
<span v-else>-- {{ asset.symbol }}</span>
<span class="text-gray-primary ml-2">≈ ${{ assetUSD?.toNumber().toFixed(2) }}</span>
</div>

<div class="mt-0.5 text-sm text-gray-primary">$ {{ assetUSD?.toNumber().toFixed(2) }}</div>

<div
:key="tag.name"
v-for="tag in tags"
:style="`background-color:${tag.bg};color:${tag.color};`"
:class="['px-1.5', 'py-0.5', 'rounded', 'text-xs', 'inline-block', 'scale-75']"
:class="['px-1', 'py-0.5', 'rounded', 'text-xs', 'inline-block', 'mt-2']"
>
{{ tag.name }}
</div>
Expand Down
1 change: 0 additions & 1 deletion src/pages/wallet/BRC20.vue
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ watch(assetUSD, (_assetUSD) => {

<div class="mt-3 text-2xl">
<span v-if="asset.balance">{{ calcBalance(asset.balance.total, asset.decimal, asset.symbol) }}</span>
<span v-else-if="balance">{{ calcBalance(balance.total, asset.decimal, asset.symbol) }}</span>
<span v-else>-- {{ asset.symbol }}</span>
<span class="text-gray-primary ml-2">≈ ${{ assetUSD?.toNumber().toFixed(2) }}</span>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/wallet/Backup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const next = async () => {
</script>

<template>
<div class="flex h-full flex-col">
<div class="flex min-h-full flex-col">
<!-- TODO: put into secondary-header -->
<div class="grid grid-cols-5 items-center h-15">
<div class="col-span-1 flex items-center">
Expand Down Expand Up @@ -119,7 +119,7 @@ const next = async () => {
</div>

<!-- buttons -->
<div class="flex flex-col items-center justify-center mb-20 relative">
<div class="flex flex-col items-center justify-center py-10 relative">
<button
@click="next"
:disabled="!password"
Expand Down
7 changes: 3 additions & 4 deletions src/pages/wallet/Token.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,14 @@ const copyGenesis = () => {
<div class="mt-3 text-2xl">
<span v-if="asset.balance">{{ calcBalance(asset.balance.total, asset.decimal, asset.symbol) }}</span>
<span v-else>-- {{ asset.symbol }}</span>
<span class="text-gray-primary ml-2">≈ ${{ assetUSD?.toNumber().toFixed(2) }}</span>
</div>

<div class="mt-0.5 text-sm text-gray-primary">$ {{ assetUSD?.toNumber() }} USD</div>

<div
v-for="tag in tags"
:key="tag.name"
v-for="tag in tags"
:style="`background-color:${tag.bg};color:${tag.color};`"
:class="['px-1.5', 'py-0.5', 'rounded', 'text-xs', 'inline-block', 'scale-75']"
:class="['px-1', 'py-0.5', 'rounded', 'text-xs', 'inline-block', 'mt-2']"
>
{{ tag.name }}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/wallet/components/AssetItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ watch(

<template>
<div class="group relative transition hover:z-10">
<div class="flex gap-2 cursor-pointer items-center justify-between rounded-md bg-gray-100 px-4 py-4">
<div class="flex gap-2 cursor-pointer items-center justify-between rounded-md py-3">
<!-- left part -->
<div class="flex flex-shrink-0 items-center gap-x-3">
<UseImage :src="asset.logo" v-if="asset.logo && asset.codeHash" class="h-10 w-10 rounded-md">
Expand Down

0 comments on commit b3ff75f

Please sign in to comment.