mirror of
https://github.com/usememos/memos.git
synced 2024-12-26 23:22:47 +08:00
chore: update logo
This commit is contained in:
parent
7dc4bc5714
commit
16dad8b00d
13 changed files with 30 additions and 44 deletions
|
@ -1,6 +1,6 @@
|
|||
# memos
|
||||
|
||||
<img height="72px" src="https://usememos.com/logo.webp" alt="✍️ memos" align="right" />
|
||||
<img height="72px" src="https://usememos.com/logo.png" alt="✍️ memos" align="right" />
|
||||
|
||||
A privacy-first, lightweight note-taking service. Easily capture and share your great thoughts.
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" href="/logo.webp" type="image/*" />
|
||||
<link rel="icon" href="/logo.png" type="image/*" />
|
||||
<meta name="theme-color" media="(prefers-color-scheme: light)" content="#f4f4f5" />
|
||||
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="#27272a" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
|
||||
|
|
BIN
web/public/logo.png
Normal file
BIN
web/public/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 845 KiB |
|
@ -4,9 +4,8 @@
|
|||
"description": "usememos/memos",
|
||||
"icons": [
|
||||
{
|
||||
"src": "/logo.webp",
|
||||
"type": "image/webp",
|
||||
"sizes": "520x520"
|
||||
"src": "/logo.png",
|
||||
"type": "image/png"
|
||||
}
|
||||
],
|
||||
"start_url": "/",
|
||||
|
|
|
@ -70,7 +70,7 @@ const App = () => {
|
|||
// dynamic update metadata with customized profile.
|
||||
document.title = systemStatus.customizedProfile.name;
|
||||
const link = document.querySelector("link[rel~='icon']") as HTMLLinkElement;
|
||||
link.href = systemStatus.customizedProfile.logoUrl || "/logo.webp";
|
||||
link.href = systemStatus.customizedProfile.logoUrl || "/logo.png";
|
||||
}, [systemStatus.customizedProfile]);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
|
@ -33,17 +33,17 @@ const AboutSiteDialog: React.FC<Props> = ({ destroy }: Props) => {
|
|||
<div className="flex flex-row justify-start items-center mr-2">
|
||||
{t("about.powered-by")}
|
||||
<a href="https://usememos.com" target="_blank" className="flex flex-row justify-start items-center mx-1 hover:underline">
|
||||
<img className="w-6 h-auto rounded-full mr-1" src="/logo.webp" alt="" />
|
||||
<img className="w-6 h-auto rounded-full mr-1" src="/logo.png" alt="" />
|
||||
memos
|
||||
</a>
|
||||
<span>v{profile.version}</span>
|
||||
</div>
|
||||
<GitHubBadge />
|
||||
</div>
|
||||
<div className="border-t w-full mt-3 pt-2 text-sm flex flex-row justify-start items-center space-x-4">
|
||||
<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-4 h-auto mr-1" src="https://github.com/boojack/slash/raw/main/resources/logo.png" alt="" />
|
||||
<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
|
||||
|
@ -52,7 +52,7 @@ const AboutSiteDialog: React.FC<Props> = ({ destroy }: Props) => {
|
|||
className="flex items-center underline text-blue-600 hover:opacity-80"
|
||||
>
|
||||
<img
|
||||
className="w-4 h-auto mr-1"
|
||||
className="w-5 h-auto mr-1"
|
||||
src="https://raw.githubusercontent.com/boojack/sticky-notes/main/public/sticky-notes.ico"
|
||||
alt=""
|
||||
/>
|
||||
|
|
|
@ -63,7 +63,7 @@ const UpdateCustomizedProfileDialog: React.FC<Props> = ({ destroy }: Props) => {
|
|||
const handleRestoreButtonClick = () => {
|
||||
setPartialState({
|
||||
name: "memos",
|
||||
logoUrl: "/logo.webp",
|
||||
logoUrl: "/logo.png",
|
||||
description: "",
|
||||
locale: "en",
|
||||
appearance: "system",
|
||||
|
|
|
@ -11,7 +11,7 @@ const UserAvatar = (props: Props) => {
|
|||
<div className={classNames(`w-8 h-8 overflow-clip rounded-full`, className)}>
|
||||
<img
|
||||
className="w-full h-auto rounded-full shadow min-w-full min-h-full object-cover dark:opacity-80"
|
||||
src={avatarUrl || "/logo.webp"}
|
||||
src={avatarUrl || "/logo.png"}
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
|
|
|
@ -14,7 +14,6 @@ import MemoResourceListView from "@/components/MemoResourceListView";
|
|||
import showShareMemoDialog from "@/components/ShareMemoDialog";
|
||||
import UserAvatar from "@/components/UserAvatar";
|
||||
import VisibilityIcon from "@/components/VisibilityIcon";
|
||||
import { memoServiceClient } from "@/grpcweb";
|
||||
import { UNKNOWN_ID, VISIBILITY_SELECTOR_ITEMS } from "@/helpers/consts";
|
||||
import { getDateTimeString } from "@/helpers/datetime";
|
||||
import useCurrentUser from "@/hooks/useCurrentUser";
|
||||
|
@ -25,15 +24,14 @@ import { User } from "@/types/proto/api/v2/user_service";
|
|||
import { useTranslate } from "@/utils/i18n";
|
||||
|
||||
const MemoDetail = () => {
|
||||
const t = useTranslate();
|
||||
const params = useParams();
|
||||
const navigateTo = useNavigateTo();
|
||||
const t = useTranslate();
|
||||
const globalStore = useGlobalStore();
|
||||
const memoStore = useMemoStore();
|
||||
const userV1Store = useUserV1Store();
|
||||
const currentUser = useCurrentUser();
|
||||
const [user, setUser] = useState<User>();
|
||||
const [comments, setComments] = useState<Memo[]>([]);
|
||||
const [creator, setCreator] = useState<User>();
|
||||
const { systemStatus } = globalStore.state;
|
||||
const memoId = Number(params.memoId);
|
||||
const memo = memoStore.state.memos.find((memo) => memo.id === memoId);
|
||||
|
@ -42,6 +40,10 @@ const MemoDetail = () => {
|
|||
memo?.relationList.filter(
|
||||
(relation) => relation.memoId === memo?.id && relation.relatedMemoId !== memo?.id && relation.type === "REFERENCE"
|
||||
) || [];
|
||||
const commentRelations = memo?.relationList.filter((relation) => relation.relatedMemoId === memo.id && relation.type === "COMMENT") || [];
|
||||
const comments = commentRelations
|
||||
.map((relation) => memoStore.state.memos.find((memo) => memo.id === relation.memoId))
|
||||
.filter((memo) => memo) as Memo[];
|
||||
|
||||
// Prepare memo.
|
||||
useEffect(() => {
|
||||
|
@ -50,7 +52,7 @@ const MemoDetail = () => {
|
|||
.fetchMemoById(memoId)
|
||||
.then(async (memo) => {
|
||||
const user = await userV1Store.getOrFetchUserByUsername(memo.creatorUsername);
|
||||
setUser(user);
|
||||
setCreator(user);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error(error);
|
||||
|
@ -67,20 +69,19 @@ const MemoDetail = () => {
|
|||
return;
|
||||
}
|
||||
|
||||
fetchMemoComments();
|
||||
}, [memo]);
|
||||
(async () => {
|
||||
await fetchMemoComments();
|
||||
})();
|
||||
}, [memo?.relationList]);
|
||||
|
||||
const fetchMemoComments = async () => {
|
||||
if (!memo) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { memos } = await memoServiceClient.listMemoComments({
|
||||
id: memo.id,
|
||||
});
|
||||
const requests = memos.map((memo) => memoStore.fetchMemoById(memo.id));
|
||||
const composedMemos = await Promise.all(requests);
|
||||
setComments(composedMemos);
|
||||
const commentRelations = memo.relationList.filter((relation) => relation.relatedMemoId === memo.id && relation.type === "COMMENT");
|
||||
const requests = commentRelations.map((relation) => memoStore.fetchMemoById(relation.memoId));
|
||||
await Promise.all(requests);
|
||||
};
|
||||
|
||||
if (!memo) {
|
||||
|
@ -135,8 +136,8 @@ const MemoDetail = () => {
|
|||
</Tooltip>
|
||||
<Icon.Dot className="w-4 h-auto text-gray-400 dark:text-zinc-400" />
|
||||
<Link className="flex flex-row justify-start items-center" to={`/u/${encodeURIComponent(memo.creatorUsername)}`}>
|
||||
<UserAvatar className="!w-5 !h-auto mr-1" avatarUrl={user?.avatarUrl} />
|
||||
<span className="text-sm text-gray-600 max-w-[8em] truncate dark:text-gray-400">{user?.nickname}</span>
|
||||
<UserAvatar className="!w-5 !h-auto mr-1" avatarUrl={creator?.avatarUrl} />
|
||||
<span className="text-sm text-gray-600 max-w-[8em] truncate dark:text-gray-400">{creator?.nickname}</span>
|
||||
</Link>
|
||||
{allowEdit && (
|
||||
<>
|
||||
|
|
|
@ -21,7 +21,7 @@ export const initialGlobalState = async () => {
|
|||
memoDisplayWithUpdatedTs: false,
|
||||
customizedProfile: {
|
||||
name: "memos",
|
||||
logoUrl: "/logo.webp",
|
||||
logoUrl: "/logo.png",
|
||||
description: "",
|
||||
locale: "en",
|
||||
appearance: "system",
|
||||
|
@ -45,7 +45,7 @@ export const initialGlobalState = async () => {
|
|||
...data,
|
||||
customizedProfile: {
|
||||
name: customizedProfile.name || "memos",
|
||||
logoUrl: customizedProfile.logoUrl || "/logo.webp",
|
||||
logoUrl: customizedProfile.logoUrl || "/logo.png",
|
||||
description: customizedProfile.description,
|
||||
locale: customizedProfile.locale || "en",
|
||||
appearance: customizedProfile.appearance || "system",
|
||||
|
|
|
@ -26,7 +26,7 @@ const globalSlice = createSlice({
|
|||
memoDisplayWithUpdatedTs: false,
|
||||
customizedProfile: {
|
||||
name: "memos",
|
||||
logoUrl: "/logo.webp",
|
||||
logoUrl: "/logo.png",
|
||||
description: "",
|
||||
locale: "en",
|
||||
appearance: "system",
|
||||
|
|
11
web/src/types/modules/resource.d.ts
vendored
11
web/src/types/modules/resource.d.ts
vendored
|
@ -5,14 +5,3 @@ interface ResourceCreate {
|
|||
externalLink: string;
|
||||
type: string;
|
||||
}
|
||||
|
||||
interface ResourcePatch {
|
||||
id: ResourceId;
|
||||
filename?: string;
|
||||
memoId?: number;
|
||||
}
|
||||
|
||||
interface ResourceFind {
|
||||
offset?: number;
|
||||
limit?: number;
|
||||
}
|
||||
|
|
3
web/src/types/modules/tag.d.ts
vendored
3
web/src/types/modules/tag.d.ts
vendored
|
@ -1,3 +0,0 @@
|
|||
interface TagFind {
|
||||
creatorUsername?: string;
|
||||
}
|
Loading…
Reference in a new issue