Skip to content

Commit 2756949

Browse files
authored
Merge pull request #10 from gnolang/fix/captcha-links
fix: captcha links
2 parents 0b18ee8 + 400a90d commit 2756949

File tree

6 files changed

+15
-8
lines changed

6 files changed

+15
-8
lines changed

.env-example

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/components/faucet/FaucetDetail.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
ref="DOMpopup"
66
class="popup fixed flex flex-col items-center rounded w-[90vw] max-w-[36rem] bg-grey-300 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-[1000] 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
>
8-
<div ref="DOMFaucetRequest" class="py-12 px-20 w-full">
8+
<div ref="DOMFaucetRequest" class="py-12 px-20 w-full" 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" />
1010
<div>
1111
<div ref="gnoRequestLogo" v-show="store.contentStep >= 1" class="opacity-0">

src/components/faucet/content/FaucetContentForm.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<form class="w-full space-y-12" @submit.prevent="requestFaucet">
55
<Input :label="'Enter your wallet address'" :placeholder="'e.g. g1juwee0ynsdvaukvxk3j5s4cl6nn24uxwlydxrl'" v-model="bindAddress" required />
66
<Select v-if="store.selectedFaucet.amounts" :label="'Select faucet amount'" :options="options" @update="(option) => SelectAmount(option)" />
7-
<Recaptcha @validation="captchaValidation" />
7+
<Recaptcha @validation="captchaValidation" :captchakey="store.selectedFaucet.recaptcha" />
88
<div>
99
<div class="flex gap-4">
1010
<Button text="Cancel" variant="outline" @click.prevent="() => closePopup()" class="w-full" />

src/components/ui/Button.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<button class="p-4 rounded border border-light ease-in-out duration-300" :class="[css[variant], disabled && ['!bg-grey-100 !border-grey-100 hover:bg-grey-100 hover:!border-grey-100 hover:cursor-not-allowed']]">{{ text }} {{ disabled }}</button>
2+
<button class="p-4 rounded border border-light ease-in-out duration-300" :class="[css[variant], disabled && ['!bg-grey-100 !border-grey-100 hover:bg-grey-100 hover:!border-grey-100 hover:cursor-not-allowed']]">{{ text }}</button>
33
</template>
44

55
<script setup lang="ts">

src/components/ui/Recaptcha.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
<template>
2-
<vue-recaptcha theme="dark" :sitekey="siteKey" @verify="handleSuccess" @error="handleError"></vue-recaptcha>
2+
<vue-recaptcha theme="dark" :sitekey="captchakey" @verify="handleSuccess" @error="handleError"></vue-recaptcha>
33
</template>
44

55
<script setup lang="ts">
6-
import { ref } from 'vue'
6+
import { onMounted } from 'vue'
77
8-
const siteKey = ref(import.meta.env.VITE_reCAPTCHA_SITE_KEY ?? '')
8+
type Props = {
9+
captchakey: string
10+
}
11+
defineProps<Props>()
912
1013
const emit = defineEmits(['validation'])
1114

src/stores/faucetDetail.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export const useFaucetDetail = defineStore('faucetDetail', {
1414
title: null as HTMLElement | null,
1515
},
1616
isOpen: false,
17+
isVisible: false,
1718
contentStep: 0,
1819
status: 'null' as RequestStatus,
1920
selectedFaucet: {} as Faucet,
@@ -50,6 +51,7 @@ export const useFaucetDetail = defineStore('faucetDetail', {
5051

5152
popupToggle() {
5253
this.isOpen = !this.isOpen
54+
if (this.isOpen) this.isVisible = true
5355

5456
this.titleToggle()
5557

@@ -75,7 +77,10 @@ export const useFaucetDetail = defineStore('faucetDetail', {
7577
duration: 0.6,
7678
delay: this.isOpen ? 0.4 : 0,
7779
onComplete: () => {
78-
if (!this.isOpen) this.contentStep = 0
80+
if (!this.isOpen) {
81+
this.contentStep = 0
82+
this.isVisible = false
83+
}
7984
this.status = 'null'
8085
},
8186
})

0 commit comments

Comments
 (0)