Skip to content

Fix: No way to get to home from My Account page #2616

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ui/user/src/routes/home/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

<div class="flex h-full flex-col items-center">
<div class="flex h-16 w-full items-center p-4 md:p-5">
<div class="relative flex items-end">
<a href="/home" class="relative flex items-end">
{#if darkMode.isDark}
<img src="/user/images/obot-logo-blue-white-text.svg" class="h-12" alt="Obot logo" />
{:else}
Expand All @@ -56,7 +56,7 @@
BETA
</span>
</div>
</div>
</a>
<div class="grow"></div>
<div class="flex items-center gap-1">
{#if !responsive.isMobile}
Expand Down
92 changes: 54 additions & 38 deletions ui/user/src/routes/profile/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import ConfirmDeleteAccount from '$lib/components/ConfirmDeleteAccount.svelte';
import { success } from '$lib/stores/success';
import Confirm from '$lib/components/Confirm.svelte';
import { ArrowLeft } from 'lucide-svelte/icons';

let toDelete = $state(false);
let toRevoke = $state(false);
Expand Down Expand Up @@ -96,44 +97,59 @@
>
<h3 class="flex flex-shrink-0 text-2xl font-semibold">My Account</h3>
</div>
<div class="bg-surface1 mx-auto w-full max-w-lg rounded-xl p-6 shadow-md">
<img
src={profile.current.iconURL}
alt=""
class="mx-auto mb-3 h-28 w-28 rounded-full object-cover"
/>
<div class="flex flex-row py-3">
<div class="w-1/2 max-w-[150px]">Display Name:</div>
<div class="w-1/2 break-words">{profile.current.getDisplayName?.()}</div>
</div>
<hr />
<div class="flex flex-row py-3">
<div class="w-1/2 max-w-[150px]">Email:</div>
<div class="w-1/2 break-words">{profile.current.email}</div>
</div>
<hr />
<div class="flex flex-row py-3">
<div class="w-1/2 max-w-[150px]">Role:</div>
<div class="w-1/2 break-words">{profile.current.role === 1 ? 'Admin' : 'User'}</div>
</div>
<hr />
<div class="mt-2 flex flex-col gap-4 py-3">
{#if version.current.sessionStore === 'db'}
<button
class="w-full rounded-3xl border-2 border-red-600 px-4 py-2 font-medium text-red-600 hover:border-red-700 hover:text-red-700"
onclick={(e) => {
e.preventDefault();
toRevoke = !toRevoke;
}}>Log out all other sessions</button
>
{/if}
<button
class="w-full rounded-3xl bg-red-600 px-4 py-2 font-medium text-white hover:bg-red-700"
onclick={(e) => {
e.preventDefault();
toDelete = !toDelete;
}}>Delete my account</button
>
<div class="bg-surface1 mx-auto w-full max-w-4xl rounded-xl p-6 shadow-md">
<a href="/home" class="mb-2 flex items-center gap-2 text-blue-500 hover:text-blue-600">
<ArrowLeft class="size-4" />Go Home
</a>
<div class="flex flex-col-reverse sm:flex-row">
<div class="w-full sm:w-1/2">
<div class="flex flex-row py-3 2xl:flex-col">
<div class="w-1/2 max-w-[150px] 2xl:w-full 2xl:py-2">Display Name:</div>
<div class="w-1/2 break-words 2xl:w-full 2xl:py-2 2xl:text-xl">
{profile.current.getDisplayName?.()}
</div>
</div>
<hr />
<div class="flex flex-row py-3 2xl:flex-col">
<div class="w-1/2 max-w-[150px] 2xl:w-full 2xl:py-2">Email:</div>
<div class="w-1/2 break-words 2xl:w-full 2xl:py-2 2xl:text-xl">
{profile.current.email}
</div>
</div>
<hr />
<div class="flex flex-row py-3 2xl:flex-col">
<div class="w-1/2 max-w-[150px] 2xl:w-full 2xl:py-2">Role:</div>
<div class="w-1/2 break-words 2xl:w-full 2xl:py-2 2xl:text-xl">
{profile.current.role === 1 ? 'Admin' : 'User'}
</div>
</div>
<hr />
<div class="mt-2 flex flex-col gap-4 py-3">
{#if version.current.sessionStore === 'db'}
<button
class="w-full rounded-3xl border-2 border-red-600 px-4 py-2 font-medium text-red-600 hover:border-red-700 hover:text-red-700 2xl:rounded-4xl 2xl:py-3 2xl:text-lg"
onclick={(e) => {
e.preventDefault();
toRevoke = !toRevoke;
}}>Log out all other sessions</button
>
{/if}
<button
class="w-full rounded-3xl bg-red-600 px-4 py-2 font-medium text-white hover:bg-red-700 2xl:rounded-4xl 2xl:py-3 2xl:text-lg"
onclick={(e) => {
e.preventDefault();
toDelete = !toDelete;
}}>Delete my account</button
>
</div>
</div>
<div class="w-full sm:w-1/2">
<img
src={profile.current.iconURL}
alt=""
class="mx-auto mb-3 h-28 w-28 rounded-full object-cover sm:my-3 sm:h-48 sm:w-48"
/>
</div>
</div>
</div>
</div>
Expand Down