-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
175 additions
and
163 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
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
85 changes: 85 additions & 0 deletions
85
platforms/interface/web/src/routes/(app)/account/+page.svelte
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,85 @@ | ||
{#if loading} | ||
<Loading /> | ||
{:else} | ||
<div class="transparent-900 m-10 mx-auto w-11/12 rounded-xl sm:w-full"> | ||
<div class="mx-10 flex flex-col gap-5 pb-10 pt-10 sm:mx-3 sm:flex-wrap"> | ||
<!-- account --> | ||
<div class="transparent-800 flex w-full flex-row flex-wrap items-center justify-between rounded-xl p-8 text-left sm:p-4"> | ||
<div class="flex flex-col items-start gap-3"> | ||
<div class="flex items-center gap-3"> | ||
<div class="transparent-900 flex aspect-square items-center justify-center rounded-lg p-3 sm:p-2"> | ||
<User /> | ||
</div> | ||
<h2>Account</h2> | ||
</div> | ||
<h3>Email: {user?.email}</h3> | ||
</div> | ||
|
||
<div class="flex flex-col items-start gap-3 sm:my-5"> | ||
<button | ||
on:click={async () => { | ||
await supabaseClient.auth.signOut() | ||
goto("/home") | ||
}} | ||
class="button" | ||
> | ||
<LogOut /> | ||
Log out | ||
</button> | ||
</div> | ||
</div> | ||
|
||
<!-- about --> | ||
<div class="transparent-800 flex w-full flex-row flex-wrap items-center justify-between rounded-xl p-8 text-left sm:p-4"> | ||
<div class="flex flex-col items-start gap-3"> | ||
<div class="flex items-center gap-3"> | ||
<div class="transparent-900 flex aspect-square items-center justify-center rounded-lg p-3 sm:p-2"> | ||
<Info /> | ||
</div> | ||
<h2>About Cores</h2> | ||
</div> | ||
<h3>Information about your Cores build and your computer.</h3> | ||
</div> | ||
|
||
<div class="flex flex-col items-start gap-3 sm:my-5"> | ||
<button | ||
on:click={() => { | ||
alert(`Cores ${version} \n\nRelease date: ${date} \nBuild number: ${number} \n\nCreated by Lőrik Levente`) | ||
}} | ||
class="button" | ||
> | ||
<Info /> | ||
About Cores | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
{/if} | ||
|
||
<script lang="ts"> | ||
import { supabaseClient } from "ui/utils/supabase" | ||
import { onMount } from "svelte" | ||
import Loading from "ui/navigation/loading.svelte" | ||
import { goto } from "$app/navigation" | ||
import { LogOut, User } from "lucide-svelte" | ||
import { Info, Megaphone, Github } from "lucide-svelte" | ||
import { version, number, date } from "../../../../../../../build.json" | ||
import type { User as UserType } from "@supabase/supabase-js" | ||
$: loading = true | ||
$: user = null as UserType | null | ||
onMount(async () => { | ||
const { data: userData, error: userError } = await supabaseClient.auth.getUser() | ||
console.log(userData, userError) | ||
if (!userError && userData !== null) { | ||
user = userData.user | ||
loading = false | ||
} else { | ||
goto("/login") | ||
} | ||
}) | ||
</script> |
Oops, something went wrong.