Skip to content

Commit

Permalink
fix(#283): switched env.development to main net
Browse files Browse the repository at this point in the history
  • Loading branch information
lxgr-linux committed Mar 18, 2024
1 parent 27e8aee commit 8b28757
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ NODE_VERSION=v18.17.1
#VITE_WS_TENDERMINT_FALLBACK=https://cardchain2.crowdcontrol.network/tendermint/
#VITE_APP_FAUCET_FALLBACK=https://cardchain2.crowdcontrol.network/faucet/claimTokens

VITE_API_COSMOS="http://lxgr.xyz:1317"
VITE_WS_TENDERMINT="http://lxgr.xyz:26657"
VITE_APP_FAUCET="http://lxgr.xyz:4500/claimTokens"
#VITE_API_COSMOS="http://lxgr.xyz:1317"
#VITE_WS_TENDERMINT="http://lxgr.xyz:26657"
#VITE_APP_FAUCET="http://lxgr.xyz:4500/claimTokens"
37 changes: 37 additions & 0 deletions src/components/elements/Login/LoginComponent.vue
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>
50 changes: 50 additions & 0 deletions src/components/elements/Login/SignupComponent.vue
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>

0 comments on commit 8b28757

Please sign in to comment.