From f5c1e791955823b1fa937441cd220f0089e21d4b Mon Sep 17 00:00:00 2001 From: Steven Date: Sat, 28 Oct 2023 15:17:33 +0800 Subject: [PATCH] chore: update about dialog --- web/src/components/AboutSiteDialog.tsx | 38 ++++--------------- .../components/CreateMemoRelationDialog.tsx | 2 +- web/src/components/GitHubBadge.tsx | 29 -------------- web/src/helpers/api.ts | 10 ----- 4 files changed, 9 insertions(+), 70 deletions(-) delete mode 100644 web/src/components/GitHubBadge.tsx diff --git a/web/src/components/AboutSiteDialog.tsx b/web/src/components/AboutSiteDialog.tsx index ae606236..bff26dbf 100644 --- a/web/src/components/AboutSiteDialog.tsx +++ b/web/src/components/AboutSiteDialog.tsx @@ -1,7 +1,7 @@ +import { Divider } from "@mui/joy"; import { useGlobalStore } from "@/store/module"; import { useTranslate } from "@/utils/i18n"; import { generateDialog } from "./Dialog"; -import GitHubBadge from "./GitHubBadge"; import Icon from "./Icon"; type Props = DialogProps; @@ -28,36 +28,14 @@ const AboutSiteDialog: React.FC = ({ destroy }: Props) => {

{t("about.memos-description")}

-

{customizedProfile.description || t("about.no-server-description")}

-
-
- {t("about.powered-by")} - - - memos - - v{profile.version} -
- -
-
- {t("about.other-projects")}: - - - Slash - - - - Sticky notes +

{customizedProfile.description || t("about.no-server-description")}

+ +
+ {t("about.powered-by")} + + + v{profile.version}
diff --git a/web/src/components/CreateMemoRelationDialog.tsx b/web/src/components/CreateMemoRelationDialog.tsx index 83d3958e..cc78d4a1 100644 --- a/web/src/components/CreateMemoRelationDialog.tsx +++ b/web/src/components/CreateMemoRelationDialog.tsx @@ -89,7 +89,7 @@ const CreateMemoRelationDialog: React.FC = (props: Props) => { onChange={handleMemoIdChanged} onKeyDown={handleMemoIdInputKeyDown} fullWidth - endDecorator={} + endDecorator={} /> {memoList.length > 0 && ( <> diff --git a/web/src/components/GitHubBadge.tsx b/web/src/components/GitHubBadge.tsx deleted file mode 100644 index c184c67a..00000000 --- a/web/src/components/GitHubBadge.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import { useEffect, useState } from "react"; -import * as api from "@/helpers/api"; -import Icon from "./Icon"; - -const GitHubBadge = () => { - const [starCount, setStarCount] = useState(0); - - useEffect(() => { - api.getRepoStarCount().then((data) => { - setStarCount(data); - }); - }, []); - - return ( - -
- - Star -
-
{starCount || ""}
-
- ); -}; - -export default GitHubBadge; diff --git a/web/src/helpers/api.ts b/web/src/helpers/api.ts index 6d31ac0f..9d44194d 100644 --- a/web/src/helpers/api.ts +++ b/web/src/helpers/api.ts @@ -180,16 +180,6 @@ export function deleteIdentityProvider(id: IdentityProviderId) { return axios.delete(`/api/v1/idp/${id}`); } -export async function getRepoStarCount() { - const { data } = await axios.get(`https://api.github.com/repos/usememos/memos`, { - headers: { - Accept: "application/vnd.github.v3.star+json", - Authorization: "", - }, - }); - return data.stargazers_count as number; -} - export async function getRepoLatestTag() { const { data } = await axios.get(`https://api.github.com/repos/usememos/memos/tags`, { headers: {