Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

chore: add memo uid

Steven777ed899a3c5
diff --git a/web/src/components/MemoContent/HorizontalRule.tsx b/web/src/components/MemoContent/HorizontalRule.tsx
index 0f81855e3..adaa19390 100644
--- a/web/src/components/MemoContent/HorizontalRule.tsx
+++ b/web/src/components/MemoContent/HorizontalRule.tsx
@@ -1,3 +1,4 @@
+import { Divider } from "@mui/joy";
import { BaseProps } from "./types";
interface Props extends BaseProps {
@@ -5,7 +6,7 @@ interface Props extends BaseProps {
}
const HorizontalRule: React.FC<Props> = () => {
- return <hr />;
+ return <Divider className="!my-3" />;
};
export default HorizontalRule;
diff --git a/web/src/components/MemoView.tsx b/web/src/components/MemoView.tsx
index 02f05b139..d48429012 100644
--- a/web/src/components/MemoView.tsx
+++ b/web/src/components/MemoView.tsx
@@ -1,4 +1,5 @@
import { Divider, Tooltip } from "@mui/joy";
+import copy from "copy-to-clipboard";
import { memo, useEffect, useRef, useState } from "react";
import { toast } from "react-hot-toast";
import { useTranslation } from "react-i18next";
@@ -148,6 +149,11 @@ const MemoView: React.FC<Props> = (props: Props) => {
});
};
+ const handleCopyMemoId = () => {
+ copy(String(memo.id));
+ toast.success("Copied to clipboard!");
+ };
+
const handleMemoContentClick = async (e: React.MouseEvent) => {
const targetEl = e.target as HTMLElement;
@@ -245,6 +251,12 @@ const MemoView: React.FC<Props> = (props: Props) => {
<Icon.Trash className="w-4 h-auto mr-2" />
{t("common.delete")}
</span>
+ <Divider className="!my-1" />
+ <div className="w-full px-3 text-xs text-gray-400">
+ <span className="cursor-pointer" onClick={handleCopyMemoId}>
+ ID: <span className="font-mono">{memo.id}</span>
+ </span>
+ </div>
</div>
</div>
</>