-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(#283): switched env.development to main net
- Loading branch information
1 parent
27e8aee
commit 8b28757
Showing
3 changed files
with
90 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<template> | ||
<button | ||
class="text-white font-bold uppercase flex hover:underline my-auto" | ||
@click="tryLogin" | ||
> | ||
<ProfilePicComponent | ||
class="min-h-8 min-w-8 h-8 w-8 mr-4 my-auto" | ||
size="8" | ||
:src="loggedIn ? loggedInProfilePic : Profile" | ||
alt="PP" | ||
/> | ||
<a class="my-auto">{{ | ||
isSignUpRequired ? "Log in / Sign up" : loggedIn ? "Profile" : "Login" | ||
}}</a> | ||
</button> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import Profile from "@/assets/figma/Profile.png"; | ||
import { useProfilePic } from "@/def-composables/useProfilePic"; | ||
import { useLoggedIn } from "@/def-composables/useLoggedIn"; | ||
import { useLogin } from "@/def-composables/useLogin"; | ||
import { onMounted } from "vue"; | ||
import ProfilePicComponent from "@/components/elements/ProfilePicComponent.vue"; | ||
const { loggedInProfilePic } = useProfilePic(); | ||
const { loggedIn } = useLoggedIn(); | ||
const { tryLogin, isSignUpRequired, checkSignUpRequired } = useLogin(); | ||
onMounted(() => { | ||
checkSignUpRequired().then((value) => { | ||
if (!value) { | ||
tryLogin(); | ||
} | ||
}); | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<template> | ||
<div> | ||
<BaseCCButton v-if="!isSignUpRequired" @click="login"> | ||
Login with keplr | ||
</BaseCCButton> | ||
<div v-else> | ||
<div v-if="isKeplrAvailable" class="flex flex-col justify-center"> | ||
<p class="p-7">You have to sign up first</p> | ||
<vue-hcaptcha | ||
:sitekey="state.siteKey" | ||
class="mx-auto" | ||
@verify="onVerify" | ||
/> | ||
</div> | ||
<div v-else> | ||
<p class="p-7"> | ||
To log in you first need download and install the | ||
<a href="https://www.keplr.app" class="underline">keplr wallet</a> | ||
browser extension | ||
</p> | ||
<a href="https://www.keplr.app/download" class="mx-auto"> | ||
<BaseCCButton :type="ButtonType.TEAL"> Download Keplr</BaseCCButton> | ||
</a> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
<script setup lang="ts"> | ||
import BaseCCButton from "@/components/elements/CCButton/BaseCCButton.vue"; | ||
import VueHcaptcha from "@hcaptcha/vue3-hcaptcha"; | ||
import useKeplr from "@/def-composables/useKeplr"; | ||
import { ButtonType } from "@/components/elements/CCButton/ButtonType"; | ||
import { useLogin } from "@/def-composables/useLogin"; | ||
import { onMounted, reactive } from "vue"; | ||
import { env } from "@/env"; | ||
import SignupComponent from "@/components/elements/Login/SignupComponent.vue"; | ||
const { isKeplrAvailable } = useKeplr(); | ||
const { checkSignUpRequired, login, isSignUpRequired, onVerify } = useLogin(); | ||
const initialState: { | ||
siteKey: string; | ||
} = { | ||
siteKey: env.faucetSiteKey, | ||
}; | ||
const state = reactive(initialState); | ||
onMounted(checkSignUpRequired); | ||
</script> |