-
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.
Merge pull request #250 from DecentralCardGame/243-login
243 login
- Loading branch information
Showing
23 changed files
with
633 additions
and
426 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
This file was deleted.
Oops, something went wrong.
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="h-8 w-8 mr-4" | ||
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,26 @@ | ||
<template> | ||
<div | ||
:class="[ | ||
'overflow-hidden', | ||
'rounded-full', | ||
'w-' + props.size, | ||
'h-' + props.size, | ||
]" | ||
> | ||
<img :src="src" class="-pt-[10%] w-[100%] object-contain" :alt="alt" /> | ||
</div> | ||
</template> | ||
<script setup lang="ts"> | ||
const props = withDefaults( | ||
defineProps<{ | ||
src: any; | ||
size: number | string; | ||
alt: string; | ||
}>(), | ||
{ | ||
src: {}, | ||
size: 64, | ||
alt: "Profile Pic", | ||
} | ||
); | ||
</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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.