diff --git a/src/components/AccountSidebar.astro b/src/components/AccountSidebar.astro new file mode 100644 index 000000000..192fbd68c --- /dev/null +++ b/src/components/AccountSidebar.astro @@ -0,0 +1,85 @@ +--- +import Icon from './AstroIcon.astro'; + +const { activePageId, activePageTitle } = Astro.props; + +export interface Props { + activePageId: string; + activePageTitle: string; +} +--- + +
+ + +
+ +
+ + + + +
+ +
+
+ + diff --git a/src/components/Authenticator/authenticator.ts b/src/components/Authenticator/authenticator.ts index 1f1230dde..8da6cbe76 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/update-profile', - '/settings/update-password', + '/account/update-profile', + '/account/update-password', ]; showHideAuthElements('hide'); diff --git a/src/components/Captcha/CaptchaFields.astro b/src/components/Captcha/CaptchaFields.astro deleted file mode 100644 index fb30a3371..000000000 --- a/src/components/Captcha/CaptchaFields.astro +++ /dev/null @@ -1,5 +0,0 @@ ---- ---- - -
- \ No newline at end of file diff --git a/src/components/Captcha/CaptchaScripts.astro b/src/components/Captcha/CaptchaScripts.astro deleted file mode 100644 index dd266e2d7..000000000 --- a/src/components/Captcha/CaptchaScripts.astro +++ /dev/null @@ -1,36 +0,0 @@ ---- - ---- - - - - - - \ No newline at end of file diff --git a/src/components/Captcha/captcha.js b/src/components/Captcha/captcha.js deleted file mode 100644 index aa065ac25..000000000 --- a/src/components/Captcha/captcha.js +++ /dev/null @@ -1,49 +0,0 @@ -class Captcha { - constructor() { - this.onDOMLoaded = this.onDOMLoaded.bind(this); - this.bindValidation = this.bindValidation.bind(this); - this.validateCaptchaBeforeSubmit = - this.validateCaptchaBeforeSubmit.bind(this); - } - - validateCaptchaBeforeSubmit(e) { - const target = e.target; - const captchaField = target.querySelector('.recaptcha-field'); - - if (captchaField) { - const captchaId = captchaField.dataset.recaptchaId; - const captchaResponse = window.grecaptcha.getResponse(captchaId); - - // If valid captcha is not present, prevent form submission - if (!captchaResponse) { - e.preventDefault(); - alert('Please verify that you are human first'); - return false; - } - - target.querySelector('.recaptcha-response').value = captchaResponse; - } - - target.closest('.popup').classList.add('hidden'); - return true; - } - - bindValidation() { - const forms = document.querySelectorAll('[captcha-form]'); - - forms.forEach((form) => { - form.addEventListener('submit', this.validateCaptchaBeforeSubmit); - }); - } - - onDOMLoaded() { - this.bindValidation(); - } - - init() { - window.addEventListener('DOMContentLoaded', this.onDOMLoaded); - } -} - -const captcha = new Captcha(); -captcha.init(); diff --git a/src/components/CommandMenu/CommandMenu.tsx b/src/components/CommandMenu/CommandMenu.tsx index 81e26e3b0..ba8b04c5f 100644 --- a/src/components/CommandMenu/CommandMenu.tsx +++ b/src/components/CommandMenu/CommandMenu.tsx @@ -1,14 +1,14 @@ import { useEffect, useRef, useState } from 'preact/hooks'; +import { useKeydown } from '../../hooks/use-keydown'; +import { useOutsideClick } from '../../hooks/use-outside-click'; import BestPracticesIcon from '../../icons/best-practices.svg'; -import HomeIcon from '../../icons/home.svg'; -import UserIcon from '../../icons/user.svg'; -import RoadmapIcon from '../../icons/roadmap.svg'; import GuideIcon from '../../icons/guide.svg'; +import HomeIcon from '../../icons/home.svg'; +import RoadmapIcon from '../../icons/roadmap.svg'; +import UserIcon from '../../icons/user.svg'; import VideoIcon from '../../icons/video.svg'; import { httpGet } from '../../lib/http'; -import { useKeydown } from '../../hooks/use-keydown'; import { isLoggedIn } from '../../lib/jwt'; -import { useOutsideClick } from '../../hooks/use-outside-click'; type PageType = { url: string; @@ -21,7 +21,7 @@ type PageType = { const defaultPages: PageType[] = [ { url: '/', title: 'Home', group: 'Pages', icon: HomeIcon }, { - url: '/settings/update-profile', + url: '/account/update-profile', title: 'Account', group: 'Pages', icon: UserIcon, diff --git a/src/components/Navigation/AccountDropdown.astro b/src/components/Navigation/AccountDropdown.astro index f99b37dae..135a6cdf1 100644 --- a/src/components/Navigation/AccountDropdown.astro +++ b/src/components/Navigation/AccountDropdown.astro @@ -24,7 +24,7 @@ import Icon from '../AstroIcon.astro';