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

style: account + connect wallet component UX improvements #156

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
27 changes: 16 additions & 11 deletions src/components/wallet/IgniteAccount.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const { spn, signIn, signOut } = useSpn()

// variables
const initialState = {
showConnectWallet: false,
modalPage: ModalPage.Connecting,
isConnectWalletModalOpen: false
}
Expand Down Expand Up @@ -91,6 +92,7 @@ async function tryToConnectToKeplr() {

const onKeplrError = (): void => {
state.modalPage = ModalPage.Error
state.showConnectWallet = true
}

try {
Expand All @@ -109,6 +111,7 @@ async function tryToConnectToKeplr() {
})
} catch (e) {
state.modalPage = ModalPage.Error
state.showConnectWallet = true
}
}

Expand All @@ -131,17 +134,19 @@ watchEffect(() => {
</script>

<template>
<IgniteAccountMenu v-if="address" />

<IgniteButton
v-else
variant="primary"
color="primary"
class="!px-5 !py-[10px] !text-2"
@click="onOpenModal"
>
Connect Wallet
</IgniteButton>
<div class="min-h-[42px]">
<IgniteAccountMenu v-if="address" />

<IgniteButton
v-else-if="state.showConnectWallet"
variant="primary"
color="primary"
class="!px-5 !py-[10px] !text-2"
@click="onOpenModal"
>
Connect Wallet
</IgniteButton>
</div>

<IgniteModal
size="sm"
Expand Down
4 changes: 2 additions & 2 deletions src/components/wallet/IgniteAccountMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ const mainCoinBalance = computed(() => {
<MenuButton class="flex items-center space-x-4">
<IgniteProfileIcon :address="address" />

<div class="text-left">
<div class="min-w-[100px] text-left">
<IgniteHeading class="text-3 font-semibold">
{{ account?.name }}
</IgniteHeading>

<IgniteLoader v-if="isFetchingBalances" class="mt-2 h-5" />
<IgniteLoader v-if="isFetchingBalances" class="mt-1 h-5" />
<IgniteText v-else-if="mainCoinBalance" class="text-2 text-muted">
<IgniteNumber :number="mainCoinBalance.amount?.toUpperCase()" />
{{ mainCoinBalance.denom?.toUpperCase() }}
Expand Down