From b46534419b48eedfac766ea74886a4cb245297e6 Mon Sep 17 00:00:00 2001 From: radishzzz Date: Fri, 24 Jan 2025 10:11:56 +0000 Subject: [PATCH] feat: add language switcher component and update layout - Introduced a new LanguageSwitcher component to facilitate language switching in the application. - Added an SVG icon for the language switcher button. - Updated the Header component to adjust margin for better spacing. - Modified the Navigation component's margin and top properties for improved layout. - Adjusted the ThemeToggle button size for consistency with the new design. --- public/image/languageSwitcher.svg | 1 + src/components/Header.astro | 2 +- src/components/LanguageSwitcher.astro | 60 +++++++++++++++++++++++++++ src/components/Navigation.astro | 2 +- src/components/ThemeToggle.astro | 2 +- src/layouts/Layout.astro | 2 + 6 files changed, 66 insertions(+), 3 deletions(-) create mode 100644 public/image/languageSwitcher.svg create mode 100644 src/components/LanguageSwitcher.astro diff --git a/public/image/languageSwitcher.svg b/public/image/languageSwitcher.svg new file mode 100644 index 0000000..e93f63b --- /dev/null +++ b/public/image/languageSwitcher.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/Header.astro b/src/components/Header.astro index af0c4ce..0d330d5 100644 --- a/src/components/Header.astro +++ b/src/components/Header.astro @@ -14,7 +14,7 @@ const marginClass = {

diff --git a/src/components/LanguageSwitcher.astro b/src/components/LanguageSwitcher.astro new file mode 100644 index 0000000..ffc6f0c --- /dev/null +++ b/src/components/LanguageSwitcher.astro @@ -0,0 +1,60 @@ +--- +import themeConfig from '@/config' + +const langs = ['', ...themeConfig.global.moreLocale] +--- + + + + + + diff --git a/src/components/Navigation.astro b/src/components/Navigation.astro index 339183f..d44f019 100644 --- a/src/components/Navigation.astro +++ b/src/components/Navigation.astro @@ -51,7 +51,7 @@ const isTagActive = isTagPage(currentPath) const isAboutActive = isAboutPage(currentPath) --- -