From 04f5929cd28bb20fee7b729a78310c2ce1338ece Mon Sep 17 00:00:00 2001 From: Visagan Guruparan <103048@smsassist.com> Date: Mon, 22 Jan 2024 22:50:35 -0600 Subject: [PATCH] Add new profile page --- src/lib/common/ProfileDropdown.svelte | 2 +- .../(authentication)/login/+page.svelte | 17 +++- src/routes/page/dashboard/+page.svelte | 7 +- src/routes/page/myProfile/+page.svelte | 87 +++++++++++++++++++ 4 files changed, 107 insertions(+), 6 deletions(-) create mode 100644 src/routes/page/myProfile/+page.svelte diff --git a/src/lib/common/ProfileDropdown.svelte b/src/lib/common/ProfileDropdown.svelte index 9abac5e0..4643c0f0 100644 --- a/src/lib/common/ProfileDropdown.svelte +++ b/src/lib/common/ProfileDropdown.svelte @@ -27,7 +27,7 @@ - Profile diff --git a/src/routes/(authentication)/login/+page.svelte b/src/routes/(authentication)/login/+page.svelte index bd9289a9..c08a4b4f 100644 --- a/src/routes/(authentication)/login/+page.svelte +++ b/src/routes/(authentication)/login/+page.svelte @@ -15,6 +15,7 @@ import Headtitle from '$lib/common/HeadTitle.svelte'; import { getToken } from '$lib/services/auth-service.js'; import { goto } from '$app/navigation'; + import Loader from '$lib/common/Loader.svelte'; import { PUBLIC_LOGO_URL, PUBLIC_LOGIN_IMAGE, @@ -60,6 +61,9 @@
- {!isSubmitting ? 'Log In' : 'Log In...'}
diff --git a/src/routes/page/dashboard/+page.svelte b/src/routes/page/dashboard/+page.svelte index a369035e..00933c28 100644 --- a/src/routes/page/dashboard/+page.svelte +++ b/src/routes/page/dashboard/+page.svelte @@ -25,7 +25,7 @@ PUBLIC_BRAND_NAME } from '$env/static/public'; import { onMount } from 'svelte'; - import { getUserStore } from '$lib/helpers/store'; + import { getUserStore, userStore } from '$lib/helpers/store'; let subscribemodal = false; let user = {full_name: ""}; @@ -34,6 +34,9 @@ }) onMount(() => { + const userModelSubscribe = userStore.subscribe((/** @type {{ full_name: string; }} */ value) => { + user = value; + }) user = getUserStore(); setTimeout(() => { subscribemodal = true; @@ -83,7 +86,7 @@
- + View Profile
diff --git a/src/routes/page/myProfile/+page.svelte b/src/routes/page/myProfile/+page.svelte new file mode 100644 index 00000000..1d760ff0 --- /dev/null +++ b/src/routes/page/myProfile/+page.svelte @@ -0,0 +1,87 @@ + + + + +{#if isLoading} + +{/if} +{#if !isLoading} + + + +
+ + +
+
Welcome Back !
+

{PUBLIC_BRAND_NAME}

+
+ +
+
+ + + +
+ avatar +
+
{currentUser?.full_name}
+

{currentUser?.role ?? "Role: N/A"}

+ +
+
+
+ + + Personal Information +
+ + + + + + + + + + + + + + + +
First Name: + {currentUser?.first_name ?? "N/A"} +
Last Name: + {currentUser?.last_name ?? "N/A"} +
Email: + {currentUser?.email ?? "N/A"} +
+
+
+
+ +
+{/if}