From 33d7257ed2c569a2b7fe4780479d6f065c6bf6e1 Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Mon, 10 Apr 2023 23:09:44 +0100 Subject: [PATCH] Add update password form --- .../ForgotPasswordForm.tsx | 2 +- src/components/Authenticator/authenticator.ts | 4 +- src/components/Breadcrumbs.astro | 2 +- src/components/DownloadPopup.astro | 50 ---- .../Navigation/AccountDropdown.astro | 2 +- src/components/Navigation/Navigation.astro | 2 +- src/components/Profile/profile-details.tsx | 45 ---- src/components/RoadmapHeader.astro | 4 - src/components/Setting/ChangePasswordForm.tsx | 219 ------------------ src/components/Setting/SettingSidebar.astro | 8 +- src/components/Setting/UpdatePasswordForm.tsx | 181 +++++++++++++++ src/components/SubscribePopup.astro | 41 ---- src/pages/forgot-password.astro | 9 +- ...e-password.astro => update-password.astro} | 4 +- .../{profile.astro => update-profile.astro} | 0 15 files changed, 199 insertions(+), 374 deletions(-) rename src/components/{Profile => AuthenticationFlow}/ForgotPasswordForm.tsx (97%) delete mode 100644 src/components/DownloadPopup.astro delete mode 100644 src/components/Profile/profile-details.tsx delete mode 100644 src/components/Setting/ChangePasswordForm.tsx create mode 100644 src/components/Setting/UpdatePasswordForm.tsx delete mode 100644 src/components/SubscribePopup.astro rename src/pages/settings/{change-password.astro => update-password.astro} (75%) rename src/pages/settings/{profile.astro => update-profile.astro} (100%) diff --git a/src/components/Profile/ForgotPasswordForm.tsx b/src/components/AuthenticationFlow/ForgotPasswordForm.tsx similarity index 97% rename from src/components/Profile/ForgotPasswordForm.tsx rename to src/components/AuthenticationFlow/ForgotPasswordForm.tsx index 299dd15d7..c493c75be 100644 --- a/src/components/Profile/ForgotPasswordForm.tsx +++ b/src/components/AuthenticationFlow/ForgotPasswordForm.tsx @@ -2,7 +2,7 @@ import { useState } from 'preact/hooks'; import Spinner from '../Spinner'; import { httpPost } from '../../lib/http'; -export default function ForgotPasswordForm() { +export function ForgotPasswordForm() { const [email, setEmail] = useState(''); const [isLoading, setIsLoading] = useState(false); const [error, setError] = useState(''); diff --git a/src/components/Authenticator/authenticator.ts b/src/components/Authenticator/authenticator.ts index 2de9a1d5d..a58dd0e94 100644 --- a/src/components/Authenticator/authenticator.ts +++ b/src/components/Authenticator/authenticator.ts @@ -32,8 +32,8 @@ function showHideGuestElements(hideOrShow: 'hide' | 'show' = 'hide') { // Prepares the UI for the user who is logged in function handleGuest() { const authenticatedRoutes = [ - '/settings/profile', - '/settings/change-password', + '/settings/update-profile', + '/settings/update-password', ]; showHideAuthElements('hide'); diff --git a/src/components/Breadcrumbs.astro b/src/components/Breadcrumbs.astro index 6aaab220a..ec912ad5c 100644 --- a/src/components/Breadcrumbs.astro +++ b/src/components/Breadcrumbs.astro @@ -10,7 +10,7 @@ const { breadcrumbs, roadmapId } = Astro.props; ---
- +
- - - - - - - - - - - - - - diff --git a/src/components/Navigation/AccountDropdown.astro b/src/components/Navigation/AccountDropdown.astro index 6c2e6df2f..f99b37dae 100644 --- a/src/components/Navigation/AccountDropdown.astro +++ b/src/components/Navigation/AccountDropdown.astro @@ -24,7 +24,7 @@ import Icon from '../AstroIcon.astro';