Move all profile stuff into the profile component and auto redirect / to /login
ci/woodpecker/push/build Pipeline was successful
Details
ci/woodpecker/push/build Pipeline was successful
Details
This commit is contained in:
parent
57c9e46d40
commit
4bd5ab8969
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
try {
|
try {
|
||||||
user = await getUser("@me");
|
user = await getUser(id);
|
||||||
} catch (_) {}
|
} catch (_) {}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Profile from "~/components/profile/Profile.svelte";
|
import {onMount} from "svelte";
|
||||||
import Page from "~/lib/Page.svelte";
|
import {navigate} from "svelte-navigator";
|
||||||
</script>
|
|
||||||
|
|
||||||
<Page>
|
onMount(() => {
|
||||||
<Profile id="@me" />
|
navigate("/login");
|
||||||
</Page>
|
});
|
||||||
|
</script>
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {getUser} from "~/api/login";
|
import {getUser} from "~/api/login";
|
||||||
import {onMount} from "svelte";
|
import {onMount} from "svelte";
|
||||||
import {Link, navigate} from "svelte-navigator";
|
import {navigate} from "svelte-navigator";
|
||||||
|
import Page from "~/lib/Page.svelte";
|
||||||
|
import Profile from "~/components/profile/Profile.svelte";
|
||||||
|
|
||||||
type ProfileData = {icon: string; display_name: string; username: string};
|
type ProfileData = {icon: string; display_name: string; username: string};
|
||||||
|
|
||||||
|
@ -17,34 +19,6 @@
|
||||||
profile = {icon: "", display_name: "", username: ""};
|
profile = {icon: "", display_name: "", username: ""};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="profile-layout">
|
<Page>
|
||||||
<div class="layout-sidebar">
|
<Profile id="@me" />
|
||||||
{#if profile.icon}
|
</Page>
|
||||||
<div class="image">
|
|
||||||
<img src={profile.icon} alt="User Icon" />
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
{#if profile.display_name}
|
|
||||||
<div class="profile-field-display">{profile.display_name}</div>
|
|
||||||
{/if}
|
|
||||||
{#if profile.username}
|
|
||||||
<div class="profile-field-username">{profile.username}</div>
|
|
||||||
{/if}
|
|
||||||
<div class="profile-button-edit">
|
|
||||||
<Link to="/profile/@me/edit">Edit Profile</Link>
|
|
||||||
</div>
|
|
||||||
<div class="profile-field-timezone">01:18 (UTC +01:00)</div>
|
|
||||||
<div class="profile-field-github">
|
|
||||||
<a href="https://github.com/MrMelon54" target="_blank">github.com/MrMelon54</a>
|
|
||||||
</div>
|
|
||||||
<div class="profile-field-email">
|
|
||||||
<a href="mailto:melon@mrmelon54.com" target="_blank">melon at mrmelon54.com</a>
|
|
||||||
</div>
|
|
||||||
<div class="profile-field-website">
|
|
||||||
<a href="https://mrmelon54.com" target="_blank">mrmelon54.com</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="layout-main">
|
|
||||||
<div class="profile-field-description" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
Reference in New Issue