From f4291f6dc0dfcfaeca197f3708985ee7d8a7942a Mon Sep 17 00:00:00 2001 From: yude Date: Sat, 25 May 2024 10:09:42 +0900 Subject: [PATCH] Merge Keys and Links into Identifier tab --- src/App.tsx | 2 +- src/components/ContentRenderer.tsx | 12 +++--- src/components/Footer.tsx | 6 ++- src/components/HorizontalMenu.tsx | 65 +++++++++++++----------------- src/components/Identifier.tsx | 18 +++++++++ src/components/Keys.tsx | 1 - src/components/Links.tsx | 5 +-- src/components/VerticalMenu.tsx | 34 ++++++---------- src/components/Weather.tsx | 7 ++++ src/locales/en.json | 1 + src/locales/ja.json | 1 + src/locales/zh-cn.json | 1 + 12 files changed, 83 insertions(+), 70 deletions(-) create mode 100644 src/components/Identifier.tsx create mode 100644 src/components/Weather.tsx diff --git a/src/App.tsx b/src/App.tsx index 51cf766..97e11eb 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -8,7 +8,7 @@ import LanguageMenu from "./components/LanguageMenu" import ContentRenderer from "./components/ContentRenderer" import Footer from "./components/Footer" import { ThemeProvider, ThemeSwitcher } from "./components/Theme" - +import Weather from "./components/Weather" import { useState, useEffect } from 'react'; diff --git a/src/components/ContentRenderer.tsx b/src/components/ContentRenderer.tsx index 5d6b13b..390a14b 100644 --- a/src/components/ContentRenderer.tsx +++ b/src/components/ContentRenderer.tsx @@ -1,8 +1,7 @@ import { useRecoilState } from 'recoil' import Profile from "./Profile" -import Links from "./Links" -import Keys from "./Keys" +import Identifier from "./Identifier" import Spotify from "./Spotify" import Services from "./Services" import Chat from "./Chat" @@ -13,11 +12,10 @@ export default function ContentRenderer() { const [page, _] = useRecoilState(currentPage); return ( <> - { page === Pages.Profile && <> } - { page === Pages.Links && } - { page === Pages.Keys && } - { page === Pages.Services && } - { page === Pages.Chat && } + {page === Pages.Profile && <>} + {page === Pages.Identifier && } + {page === Pages.Services && } + {page === Pages.Chat && } ) } diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx index 38ddddf..d53d552 100644 --- a/src/components/Footer.tsx +++ b/src/components/Footer.tsx @@ -1,9 +1,14 @@ +import Weather from "./Weather" + export default function Footer() { return ( ) } - \ No newline at end of file diff --git a/src/components/HorizontalMenu.tsx b/src/components/HorizontalMenu.tsx index ea27a4a..a06ce17 100644 --- a/src/components/HorizontalMenu.tsx +++ b/src/components/HorizontalMenu.tsx @@ -1,6 +1,6 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { faUser, faStar, faComments } from '@fortawesome/free-regular-svg-icons' -import { faLink, faKey } from '@fortawesome/free-solid-svg-icons' +import { faPassport } from "@fortawesome/free-solid-svg-icons" import { Pages } from "./VerticalMenu" import { RecoilRoot, atom, useRecoilState } from 'recoil' @@ -15,40 +15,33 @@ export default function HorizontalMenu() { const activeColor = " bg-slate-700 text-white" return ( - -
-
{setPage(Pages.Profile)}} - > - {" "} + +
+
{ setPage(Pages.Profile) }} + > + {" "} +
+
{ setPage(Pages.Identifier) }} + > + {" "} +
+
{ setPage(Pages.Services) }} + > + {" "} +
+
{ setPage(Pages.Chat) }} + > + {" "} +
-
{setPage(Pages.Links)}} - > - {" "} -
-
{setPage(Pages.Keys)}} - > - {" "} -
-
{setPage(Pages.Services)}} - > - {" "} -
-
{setPage(Pages.Chat)}} - > - {" "} -
-
- + ) - } - \ No newline at end of file +} diff --git a/src/components/Identifier.tsx b/src/components/Identifier.tsx new file mode 100644 index 0000000..c0d50a7 --- /dev/null +++ b/src/components/Identifier.tsx @@ -0,0 +1,18 @@ +import Links from "./Links" +import Keys from "./Keys" + +import { useTranslation } from "react-i18next"; + +export default function Identifier() { + const { t } = useTranslation(); + + return ( + <> +

{t("links")}

+ + +

{t("public_keys")}

+ + + ) +} diff --git a/src/components/Keys.tsx b/src/components/Keys.tsx index 6573d95..06b6339 100644 --- a/src/components/Keys.tsx +++ b/src/components/Keys.tsx @@ -24,7 +24,6 @@ export default function Keys() {
GitHub  -
) diff --git a/src/components/Links.tsx b/src/components/Links.tsx index f79bab5..d764705 100644 --- a/src/components/Links.tsx +++ b/src/components/Links.tsx @@ -6,7 +6,7 @@ export default function Links() { return ( <>
-
+
) - } - +} diff --git a/src/components/VerticalMenu.tsx b/src/components/VerticalMenu.tsx index 7be2880..0594dc0 100644 --- a/src/components/VerticalMenu.tsx +++ b/src/components/VerticalMenu.tsx @@ -1,18 +1,17 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { faUser, faStar, faComments } from '@fortawesome/free-regular-svg-icons' -import { faLink, faKey } from '@fortawesome/free-solid-svg-icons' +import { faPassport } from "@fortawesome/free-solid-svg-icons" import { RecoilRoot, atom, useRecoilState } from 'recoil' import { useTranslation } from "react-i18next"; export enum Pages { Profile = 0, - Links = 1, - Keys = 2, - Activities = 3, - Spotify = 4, - Services = 5, - Chat = 6, + Identifier = 1, + Activities = 2, + Spotify = 3, + Services = 4, + Chat = 5, } export const currentPage = atom({ @@ -34,35 +33,28 @@ export default function VerticalMenu() { className={`w-full px-4 py-2 rounded-lg${page === Pages.Profile ? activeColor : ""}`} onClick={() => { setPage(Pages.Profile) }} > - {" "} + {" "}

{t("profile")}

  • { setPage(Pages.Links) }} + className={`w-full px-4 py-2 rounded-lg${page === Pages.Identifier ? activeColor : ""}`} + onClick={() => { setPage(Pages.Identifier) }} > - {" "} -

    {t("links")}

    -
  • -
  • { setPage(Pages.Keys) }} - > - {" "} -

    {t("public_keys")}

    + {" "} +

    {t("identifier")}

  • { setPage(Pages.Services) }} > - {" "} + {" "}

    {t("services")}

  • { setPage(Pages.Chat) }} > - {" "} + {" "}

    {t("chat")}

  • diff --git a/src/components/Weather.tsx b/src/components/Weather.tsx new file mode 100644 index 0000000..5ab7b90 --- /dev/null +++ b/src/components/Weather.tsx @@ -0,0 +1,7 @@ +export default function Weather() { + return ( + <> +
    + + ) +} diff --git a/src/locales/en.json b/src/locales/en.json index a5b96fc..df928d6 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -2,6 +2,7 @@ "translation": { "profile": "Profile", "links": "Links", + "identifier": "Identifier", "public_keys": "Public keys", "services": "Services", "chat": "Chat", diff --git a/src/locales/ja.json b/src/locales/ja.json index db007f6..2fdc4fb 100644 --- a/src/locales/ja.json +++ b/src/locales/ja.json @@ -2,6 +2,7 @@ "translation": { "profile": "プロフィール", "links": "リンク", + "identifier": "識別子", "public_keys": "公開鍵", "services": "サービス", "chat": "チャット", diff --git a/src/locales/zh-cn.json b/src/locales/zh-cn.json index 5c27e4c..7883276 100644 --- a/src/locales/zh-cn.json +++ b/src/locales/zh-cn.json @@ -2,6 +2,7 @@ "translation": { "profile": "关于我", "links": "超级链接", + "identifier": "識別符", "public_keys": "公钥", "services": "服务", "chat": "聊天",