mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
chore: update about dialog
This commit is contained in:
@ -1,7 +1,7 @@
|
|||||||
|
import { Divider } from "@mui/joy";
|
||||||
import { useGlobalStore } from "@/store/module";
|
import { useGlobalStore } from "@/store/module";
|
||||||
import { useTranslate } from "@/utils/i18n";
|
import { useTranslate } from "@/utils/i18n";
|
||||||
import { generateDialog } from "./Dialog";
|
import { generateDialog } from "./Dialog";
|
||||||
import GitHubBadge from "./GitHubBadge";
|
|
||||||
import Icon from "./Icon";
|
import Icon from "./Icon";
|
||||||
|
|
||||||
type Props = DialogProps;
|
type Props = DialogProps;
|
||||||
@ -29,36 +29,14 @@ const AboutSiteDialog: React.FC<Props> = ({ destroy }: Props) => {
|
|||||||
<div className="flex flex-col justify-start items-start max-w-full w-96">
|
<div className="flex flex-col justify-start items-start max-w-full w-96">
|
||||||
<p className="text-xs">{t("about.memos-description")}</p>
|
<p className="text-xs">{t("about.memos-description")}</p>
|
||||||
<p className="text-sm mt-2">{customizedProfile.description || t("about.no-server-description")}</p>
|
<p className="text-sm mt-2">{customizedProfile.description || t("about.no-server-description")}</p>
|
||||||
<div className="mt-4 w-full flex flex-row text-sm justify-start items-center">
|
<Divider className="!my-3" />
|
||||||
<div className="flex flex-row justify-start items-center mr-2">
|
<div className="w-full flex flex-row justify-start items-center text-sm italic">
|
||||||
{t("about.powered-by")}
|
{t("about.powered-by")}
|
||||||
<a href="https://usememos.com" target="_blank" className="flex flex-row justify-start items-center mx-1 hover:underline">
|
<a className="shrink-0 flex flex-row justify-start items-center mx-1 hover:underline" href="https://usememos.com" target="_blank">
|
||||||
<img className="w-6 h-auto rounded-full mr-1" src="/logo.png" alt="" />
|
<img className="w-auto h-7" src="https://www.usememos.com/full-logo-landscape.png" alt="" />
|
||||||
memos
|
|
||||||
</a>
|
</a>
|
||||||
<span>v{profile.version}</span>
|
<span>v{profile.version}</span>
|
||||||
</div>
|
</div>
|
||||||
<GitHubBadge />
|
|
||||||
</div>
|
|
||||||
<div className="border-t w-full mt-3 pt-2 text-sm flex flex-row justify-start items-center space-x-2">
|
|
||||||
<span className="text-gray-500">{t("about.other-projects")}:</span>
|
|
||||||
<a href="https://github.com/boojack/slash" target="_blank" className="flex items-center underline text-blue-600 hover:opacity-80">
|
|
||||||
<img className="w-5 h-auto mr-1 rounded-full" src="https://github.com/boojack/slash/raw/main/resources/logo.png" alt="" />
|
|
||||||
<span>Slash</span>
|
|
||||||
</a>
|
|
||||||
<a
|
|
||||||
href="https://github.com/boojack/sticky-notes"
|
|
||||||
target="_blank"
|
|
||||||
className="flex items-center underline text-blue-600 hover:opacity-80"
|
|
||||||
>
|
|
||||||
<img
|
|
||||||
className="w-5 h-auto mr-1"
|
|
||||||
src="https://raw.githubusercontent.com/boojack/sticky-notes/main/public/sticky-notes.ico"
|
|
||||||
alt=""
|
|
||||||
/>
|
|
||||||
<span>Sticky notes</span>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
@ -89,7 +89,7 @@ const CreateMemoRelationDialog: React.FC<Props> = (props: Props) => {
|
|||||||
onChange={handleMemoIdChanged}
|
onChange={handleMemoIdChanged}
|
||||||
onKeyDown={handleMemoIdInputKeyDown}
|
onKeyDown={handleMemoIdInputKeyDown}
|
||||||
fullWidth
|
fullWidth
|
||||||
endDecorator={<Icon.PlusCircle onClick={handleSaveBtnClick} className="w-4 h-auto cursor-pointer hover:opacity-80" />}
|
endDecorator={<Icon.Check onClick={handleSaveBtnClick} className="w-4 h-auto cursor-pointer hover:opacity-80" />}
|
||||||
/>
|
/>
|
||||||
{memoList.length > 0 && (
|
{memoList.length > 0 && (
|
||||||
<>
|
<>
|
||||||
|
@ -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 (
|
|
||||||
<a
|
|
||||||
className="h-7 flex flex-row justify-start items-center border dark:border-zinc-600 rounded cursor-pointer hover:opacity-80"
|
|
||||||
href="https://github.com/usememos/memos"
|
|
||||||
target="_blank"
|
|
||||||
>
|
|
||||||
<div className="apply w-auto h-full px-2 flex flex-row justify-center items-center text-xs bg-gray-100 dark:bg-zinc-700">
|
|
||||||
<Icon.Github className="mr-1 w-4 h-4" />
|
|
||||||
Star
|
|
||||||
</div>
|
|
||||||
<div className="w-auto h-full flex flex-row justify-center items-center px-3 text-xs font-bold">{starCount || ""}</div>
|
|
||||||
</a>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default GitHubBadge;
|
|
@ -180,16 +180,6 @@ export function deleteIdentityProvider(id: IdentityProviderId) {
|
|||||||
return axios.delete(`/api/v1/idp/${id}`);
|
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() {
|
export async function getRepoLatestTag() {
|
||||||
const { data } = await axios.get(`https://api.github.com/repos/usememos/memos/tags`, {
|
const { data } = await axios.get(`https://api.github.com/repos/usememos/memos/tags`, {
|
||||||
headers: {
|
headers: {
|
||||||
|
Reference in New Issue
Block a user