From 884bd5d66eda36c68d94a0cba12a4599300e9a38 Mon Sep 17 00:00:00 2001 From: Arik Chakma Date: Sat, 1 Apr 2023 06:30:21 +0600 Subject: [PATCH] chore: setting sidebar --- src/components/Setting/ChangePassword.astro | 4 +- src/components/Setting/SettingSidebar.astro | 81 ++++++++++++ src/components/Setting/UpdateProfile.astro | 53 +++++++- src/icons/dropdown.svg | 3 + src/layouts/SettingLayout.astro | 133 ++++++++++++++++++++ src/pages/settings/change-password.astro | 11 +- src/pages/settings/profile.astro | 11 +- 7 files changed, 280 insertions(+), 16 deletions(-) create mode 100644 src/components/Setting/SettingSidebar.astro create mode 100644 src/icons/dropdown.svg create mode 100644 src/layouts/SettingLayout.astro diff --git a/src/components/Setting/ChangePassword.astro b/src/components/Setting/ChangePassword.astro index 0e6a097fb..2597dc488 100644 --- a/src/components/Setting/ChangePassword.astro +++ b/src/components/Setting/ChangePassword.astro @@ -1,4 +1,4 @@ -
+

Password

Manage settings for your account passwords

@@ -50,4 +50,4 @@ Change
-
+ diff --git a/src/components/Setting/SettingSidebar.astro b/src/components/Setting/SettingSidebar.astro new file mode 100644 index 000000000..3e2bc3dd9 --- /dev/null +++ b/src/components/Setting/SettingSidebar.astro @@ -0,0 +1,81 @@ +--- +import Icon from '../Icon.astro'; +const { pageUrl, name } = Astro.props; + +export interface Props { + pageUrl: string; + name: string; +} +--- + +
+ +
+
+ + +
+ + +
+
+ + diff --git a/src/components/Setting/UpdateProfile.astro b/src/components/Setting/UpdateProfile.astro index 992ed23ab..6cc4d95b5 100644 --- a/src/components/Setting/UpdateProfile.astro +++ b/src/components/Setting/UpdateProfile.astro @@ -1,9 +1,9 @@ -
+

Update Profile

Manage settings for your roadmap.sh profile

- +
- +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+
-
+ diff --git a/src/icons/dropdown.svg b/src/icons/dropdown.svg new file mode 100644 index 000000000..c830ddfd0 --- /dev/null +++ b/src/icons/dropdown.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/layouts/SettingLayout.astro b/src/layouts/SettingLayout.astro new file mode 100644 index 000000000..80477afa6 --- /dev/null +++ b/src/layouts/SettingLayout.astro @@ -0,0 +1,133 @@ +--- +import '../styles/global.css'; +import Navigation from '../components/Navigation.astro'; +import type { SponsorType } from '../components/Sponsor/Sponsor.astro'; +import YouTubeBanner from '../components/YouTubeBanner.astro'; +import { siteConfig } from '../lib/config'; +import SettingSidebar from '../components/Setting/SettingSidebar.astro'; + +export interface Props { + title: string; + redirectUrl?: string; + description?: string; + keywords?: string[]; + noIndex?: boolean; + canonicalUrl?: string; + permalink?: string; + sponsor?: SponsorType; + jsonLd?: Record[]; +} + +const { + title = siteConfig.title, + description = siteConfig.description, + keywords = siteConfig.keywords, + noIndex = false, + permalink = '', + canonicalUrl: givenCanonical = '', + sponsor, + jsonLd = [], + redirectUrl = '', +} = Astro.props; + +// Remove trailing slashes to consider the page as canonical +const currentPageAbsoluteUrl = `https://roadmap.sh${permalink}`; + +const canonicalUrl = givenCanonical || currentPageAbsoluteUrl; + +const commitUrl = `https://github.com/kamranahmedse/developer-roadmap/commit/${ + import.meta.env.GITHUB_SHA +}`; +--- + + + + + + + + {title} + + + + { + redirectUrl && ( + + ) + } + {noIndex && } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { + jsonLd.length > 0 && ( +