Skip to content

Commit 6d3c067

Browse files
committed
fix: ui batch
1 parent 4892db2 commit 6d3c067

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

src/components/faucet/FaucetDetail.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<template>
2-
<div ref="DOMbackground" class="fixed w-screen h-screen top-0 left-0 z-30 bg-darkblur backdrop-blur-sm invisible opacity-0"></div>
2+
<div ref="DOMbackground" class="fixed w-screen h-screen top-0 left-0 z-30 bg-darkblur backdrop-blur-sm invisible opacity-0" @click="closePopup()"></div>
33

44
<section
55
ref="DOMpopup"
6-
class="popup fixed flex flex-col items-center rounded w-[90vw] max-w-[36rem] max-h-[90vh] justify-start bg-grey-300 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-[1000] md:justify-center text-grey-50 before:absolute before:top-0 before:bottom-0 before:left-0 before:right-0 before:rounded before:bg-500 before:z-min after:absolute after:top-px after:left-px after:bottom-px after:right-px after:bg-grey-500 after:rounded after:z-min"
6+
class="popup fixed flex flex-col items-center rounded w-[90vw] max-w-[36rem] max-h-[90vh] justify-start bg-grey-300 top-[45%] left-1/2 -translate-x-1/2 -translate-y-1/2 z-[1000] md:justify-center text-grey-50 before:absolute before:top-0 before:bottom-0 before:left-0 before:right-0 before:rounded before:bg-500 before:z-min after:absolute after:top-px after:left-px after:bottom-px after:right-px after:bg-grey-500 after:rounded after:z-min"
77
>
88
<div ref="DOMFaucetRequest" class="py-8 md:py-12 px-8 md:px-20 w-full overflow-scroll no-scrollbar" v-if="store.isVisible">
99
<FaucetContentForm :name="store.selectedFaucet.name ?? 'Faucet'" :options="store.faucetAmount" v-show="store.contentStep === 0" class="js-faucetform opacity-100" :error="error" @requestFaucet="requestFaucet" />
@@ -42,6 +42,8 @@ const gnoRequestLogo = ref<HTMLElement | null>(null)
4242
const popupHeight = reactive({ from: 0, to: 0 })
4343
const error = ref<string | null>(null)
4444
45+
const closePopup = () => store.popupToggle()
46+
4547
const requestFaucet = async (address: string, amount: number, secret: string) => {
4648
popupHeight.from = DOMpopup.value?.getBoundingClientRect().height ?? 0
4749
gsap.set(DOMpopup.value, { height: popupHeight.from + 'px' })
@@ -58,7 +60,6 @@ const requestFaucet = async (address: string, amount: number, secret: string) =>
5860
5961
// min default loading timer
6062
const minTimer = new Promise((resolve) => setTimeout(resolve, 2000))
61-
console.log(secret)
6263
6364
const displayError = (e: string) => {
6465
store.status = 'error'

src/components/faucet/content/FaucetContentForm.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<div>
99
<div class="flex flex-col md:flex-row gap-4">
1010
<Button text="Cancel" variant="outline" @click.prevent="() => closePopup()" class="w-full" />
11-
<Button text="Request drip" class="w-full" type="submit" :disabled="captchaValid === false || bindAddress === ''" />
11+
<Button text="Request drip" class="w-full" type="submit" :disabled="captchaValid === false || !isAddressValid" />
1212
</div>
1313
<div v-if="error" class="text-center text-red-200 mt-6">{{ error }}</div>
1414
</div>
@@ -17,7 +17,7 @@
1717
</template>
1818

1919
<script setup lang="ts">
20-
import { ref } from 'vue'
20+
import { ref, computed } from 'vue'
2121
2222
import Input from '@/components/ui/Input.vue'
2323
import Select from '@/components/ui/Select.vue'
@@ -47,6 +47,8 @@ const captchaValidation = ({ code = 'error', secret = '' }) => {
4747
captchaSecret.value = secret
4848
}
4949
50+
const isAddressValid = computed(() => new RegExp(/^[a-z0-9]{40}$/).test(bindAddress.value))
51+
5052
const SelectAmount = (option: SelectOption) => {
5153
amount.value = option
5254
}

src/components/faucet/content/FaucetContentSuccess.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class="flex flex-col items-center justify-center text-center">
33
<h2 class="text-500 mt-8">Faucet request successful</h2>
44
<div class="js-faucetsuccessdetail h-0 overflow-hidden">
5-
<p class="font-light text-grey-100 mt-6">You can now check your faucet balance.</p>
5+
<p class="font-light text-grey-100 mt-6">You can now check your wallet balance.</p>
66

77
<Button text="Done" class="w-full mt-12" @click.prevent="() => $emit('doneFaucet')" />
88
</div>

0 commit comments

Comments
 (0)