From a4a33abe4139b1e337a87ed2d4b4682761ab9b0d Mon Sep 17 00:00:00 2001 From: allence Date: Wed, 8 Mar 2023 17:35:53 +0800 Subject: [PATCH] feat(web): add github link --- web/public/locales/en/translation.json | 5 ++-- web/public/locales/zh-CN/translation.json | 5 ++-- web/public/locales/zh/translation.json | 5 ++-- web/src/layouts/Header/index.tsx | 29 ++++++++++++++----- .../storages/mods/CreateBucketModal/index.tsx | 1 + .../mods/CreateAppModal/BundleItem/index.tsx | 2 +- 6 files changed, 33 insertions(+), 14 deletions(-) diff --git a/web/public/locales/en/translation.json b/web/public/locales/en/translation.json index f99f943a11..dfa80db53c 100644 --- a/web/public/locales/en/translation.json +++ b/web/public/locales/en/translation.json @@ -279,5 +279,6 @@ }, "Price": { "Free": "Free" - } -} \ No newline at end of file + }, + "star-us-on-github": "Star us on GitHub" +} diff --git a/web/public/locales/zh-CN/translation.json b/web/public/locales/zh-CN/translation.json index 2412112165..0702e1d817 100644 --- a/web/public/locales/zh-CN/translation.json +++ b/web/public/locales/zh-CN/translation.json @@ -279,5 +279,6 @@ }, "Price": { "Free": "免费" - } -} \ No newline at end of file + }, + "star-us-on-github": "在 GitHub 上支持我们" +} diff --git a/web/public/locales/zh/translation.json b/web/public/locales/zh/translation.json index 2412112165..0702e1d817 100644 --- a/web/public/locales/zh/translation.json +++ b/web/public/locales/zh/translation.json @@ -279,5 +279,6 @@ }, "Price": { "Free": "免费" - } -} \ No newline at end of file + }, + "star-us-on-github": "在 GitHub 上支持我们" +} diff --git a/web/src/layouts/Header/index.tsx b/web/src/layouts/Header/index.tsx index 38a1b0e075..aad4957a52 100644 --- a/web/src/layouts/Header/index.tsx +++ b/web/src/layouts/Header/index.tsx @@ -2,26 +2,41 @@ * laf website header nav ***************************/ +import { useTranslation } from "react-i18next"; +import { FiGithub } from "react-icons/fi"; + import UserSetting from "./UserSetting"; import useGlobalStore from "@/pages/globalStore"; export default function Header(props: { size: "sm" | "lg" }) { const { userInfo } = useGlobalStore((state) => state); + const { t } = useTranslation(); return (
- logo + logo + + + {t("star-us-on-github")} +
-
+
{userInfo?.profile ? ( - + <> + + ) : null}
diff --git a/web/src/pages/app/storages/mods/CreateBucketModal/index.tsx b/web/src/pages/app/storages/mods/CreateBucketModal/index.tsx index 44dcd14835..e292e6cf83 100644 --- a/web/src/pages/app/storages/mods/CreateBucketModal/index.tsx +++ b/web/src/pages/app/storages/mods/CreateBucketModal/index.tsx @@ -72,6 +72,7 @@ function CreateBucketModal(props: { storage?: TBucket; children: React.ReactElem policy: values.policy, }); if (!res.error) { + store.setCurrentStorage(res.data); showSuccess("create success."); onClose(); } diff --git a/web/src/pages/home/mods/CreateAppModal/BundleItem/index.tsx b/web/src/pages/home/mods/CreateAppModal/BundleItem/index.tsx index ee3f1445f0..8bc3d3a242 100644 --- a/web/src/pages/home/mods/CreateAppModal/BundleItem/index.tsx +++ b/web/src/pages/home/mods/CreateAppModal/BundleItem/index.tsx @@ -22,7 +22,7 @@ export default function BundleItem(props: { const { bundle, isActive, onChange } = props; return (
onChange(bundle.name)} + onClick={() => onChange(bundle.id)} key={bundle.name} className={clsx("min-w-[170px] border p-2 rounded-md cursor-pointer", { "border-primary-500 bg-primary-100": isActive,