Skip to content

Commit 0e0cf23

Browse files
committed
UI fixes
1 parent de3b8f6 commit 0e0cf23

4 files changed

Lines changed: 29 additions & 15 deletions

File tree

frontend/components/parts/ConnectWallet.vue

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@
3030
>
3131
<FormWallet :admin="admin">
3232
<template v-if="!!config.public.EMBEDDED_WALLET_CLIENT">
33-
<small v-if="!admin">Dont have a wallet?</small>
34-
<Btn type="secondary" size="large" @click="openWallet">
33+
<Btn class="relative" type="secondary" size="large" @click="openWallet">
3534
<span class="mr-1">▶◀</span> Apillon Embedded Wallet
35+
<Tag v-if="!admin" class="absolute -right-4 top-0 rotate-12 z-10" type="info">No setup needed</Tag>
3636
</Btn>
37-
<small v-if="!admin">Connect your existing wallet to get started:</small>
3837
</template>
3938
</FormWallet>
4039
</modal>
@@ -43,7 +42,7 @@
4342
<script lang="ts" setup>
4443
import type { Size } from 'naive-ui/es/button/src/interface';
4544
import { useAccountEffect, useChains } from '@wagmi/vue';
46-
import { EmbeddedWallet, useWallet } from '@apillon/wallet-vue';
45+
import { EmbeddedWallet, useWallet, useAccount } from '@apillon/wallet-vue';
4746
4847
const props = defineProps({
4948
admin: { type: Boolean, default: false },
@@ -53,6 +52,7 @@ const props = defineProps({
5352
const config = useRuntimeConfig();
5453
const authStore = useAuthStore();
5554
const chains = useChains();
55+
const { info } = useAccount();
5656
const { wallet } = useWallet();
5757
const { loading, modalWalletVisible, network, connected, walletAddress, disconnectWallet, initEmbeddedWallet, login } =
5858
useWalletConnect();
@@ -70,9 +70,19 @@ watch(
7070
}
7171
}
7272
);
73+
watch(
74+
() => info.activeWallet?.address,
75+
address => {
76+
if (address && props.admin) {
77+
login();
78+
}
79+
}
80+
);
7381
7482
function openWallet() {
75-
if (wallet.value) {
83+
if (info.activeWallet?.address && props.admin) {
84+
login();
85+
} else if (wallet.value) {
7686
wallet.value.events.emit('open', true);
7787
modalWalletVisible.value = false;
7888
}

frontend/components/parts/PreviewUpload.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@
2323
<p class="mt-2 text-xs">Your balance: {{ userStore.balance }} credits</p>
2424
</div>
2525
</div>
26-
<Btn size="large" type="primary" @click="deploy()"> Send minting invites </Btn>
26+
<Btn size="large" type="primary" @click="deploy()">
27+
<span v-if="isMethodWallet">Send NFTs</span>
28+
<span v-else>Send minting invites</span>
29+
</Btn>
2730
</div>
2831
</div>
2932

frontend/composables/useWalletConnect.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Events } from '@apillon/wallet-sdk';
1+
import { WalletDisconnectedError, type Events } from '@apillon/wallet-sdk';
22
import type { Config } from '@wagmi/vue';
33
import type { Address } from 'viem';
44
import { signMessage } from '@wagmi/vue/actions';
@@ -72,7 +72,11 @@ export default function useWalletConnect() {
7272
if (isConnected.value) {
7373
disconnect();
7474
} else if (wallet.value && info.activeWallet?.address) {
75-
wallet.value?.events.emit('disconnect');
75+
try {
76+
wallet.value?.events.emit('disconnect', { error: new WalletDisconnectedError() });
77+
} catch (e) {
78+
console.error(e);
79+
}
7680
}
7781
}
7882

frontend/layouts/poap.vue

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
<div ref="headerRef">
66
<Header logo-center />
77
</div>
8-
<div class="container max-w-6xl py-8 flex flex-col justify-center box-border" :style="containerStyle">
8+
<div
9+
class="container max-w-6xl py-8 flex flex-col justify-center box-border"
10+
:style="{ minHeight: `calc(100vh - ${height}px)` }"
11+
>
912
<slot />
1013
</div>
1114
<div ref="footerRef" class="justify-center">
@@ -32,12 +35,6 @@ const height = ref<number>(0);
3235
const headerRef = ref<HTMLElement>();
3336
const footerRef = ref<HTMLElement>();
3437
35-
const containerStyle = computed(() => {
36-
return {
37-
minHeight: `calc(100vh - ${height.value}px)`,
38-
};
39-
});
40-
4138
onMounted(() => {
4239
setHeight();
4340
});

0 commit comments

Comments
 (0)