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: update component name

Steven6028838f03fa
diff --git a/web/src/components/Dialog/BaseDialog.tsx b/web/src/components/Dialog/BaseDialog.tsx
index 50e13b59a..e6389a595 100644
--- a/web/src/components/Dialog/BaseDialog.tsx
+++ b/web/src/components/Dialog/BaseDialog.tsx
@@ -12,7 +12,6 @@ import "@/less/base-dialog.less";
interface DialogConfig {
dialogName: string;
className?: string;
- containerClassName?: string;
clickSpaceDestroy?: boolean;
}
@@ -21,7 +20,7 @@ interface Props extends DialogConfig, DialogProps {
}
const BaseDialog: React.FC<Props> = (props: Props) => {
- const { children, className, containerClassName, clickSpaceDestroy, dialogName, destroy } = props;
+ const { children, className, clickSpaceDestroy, dialogName, destroy } = props;
const dialogStore = useDialogStore();
const dialogContainerRef = useRef<HTMLDivElement>(null);
const dialogIndex = dialogStore.state.dialogStack.findIndex((item) => item === dialogName);
@@ -58,7 +57,7 @@ const BaseDialog: React.FC<Props> = (props: Props) => {
return (
<div className={classNames("dialog-wrapper", className)} onMouseDown={handleSpaceClicked}>
- <div ref={dialogContainerRef} className={classNames("dialog-container", containerClassName)} onMouseDown={(e) => e.stopPropagation()}>
+ <div ref={dialogContainerRef} className={classNames("dialog-container")} onMouseDown={(e) => e.stopPropagation()}>
{children}
</div>
</div>
diff --git a/web/src/components/HomeSidebar/HomeSidebar.tsx b/web/src/components/HomeSidebar/HomeSidebar.tsx
index d6fca6fcf..8c965ead7 100644
--- a/web/src/components/HomeSidebar/HomeSidebar.tsx
+++ b/web/src/components/HomeSidebar/HomeSidebar.tsx
@@ -1,6 +1,6 @@
import classNames from "classnames";
-import PersonalStatistics from "@/components/PersonalStatistics";
import SearchBar from "@/components/SearchBar";
+import UserStatisticsView from "@/components/UserStatisticsView";
import useCurrentUser from "@/hooks/useCurrentUser";
import TagsSection from "./TagsSection";
@@ -19,7 +19,7 @@ const HomeSidebar = (props: Props) => {
)}
>
<SearchBar />
- <PersonalStatistics user={currentUser} />
+ <UserStatisticsView user={currentUser} />
<TagsSection />
</aside>
);
diff --git a/web/src/components/MemoEditor/MemoEditorDialog.tsx b/web/src/components/MemoEditor/MemoEditorDialog.tsx
index 47516a9ac..01441828a 100644
--- a/web/src/components/MemoEditor/MemoEditorDialog.tsx
+++ b/web/src/components/MemoEditor/MemoEditorDialog.tsx
@@ -55,7 +55,6 @@ export default function showMemoEditorDialog(props: Pick<Props, "memoName" | "ca
{
className: "memo-editor-dialog",
dialogName: "memo-editor-dialog",
- containerClassName: "dark:!bg-zinc-800",
},
MemoEditorDialog,
props,
diff --git a/web/src/components/PreviewMarkdownDialog.tsx b/web/src/components/PreviewMarkdownDialog.tsx
index 77644e542..447c62366 100644
--- a/web/src/components/PreviewMarkdownDialog.tsx
+++ b/web/src/components/PreviewMarkdownDialog.tsx
@@ -34,7 +34,6 @@ export default function showPreviewMarkdownDialog(content: string): void {
{
className: "preview-markdown-dialog",
dialogName: "preview-markdown-dialog",
- containerClassName: "dark:!bg-zinc-800",
},
PreviewMarkdownDialog,
{
diff --git a/web/src/components/PersonalStatistics.tsx b/web/src/components/UserStatisticsView.tsx
similarity index 90%
rename from web/src/components/PersonalStatistics.tsx
rename to web/src/components/UserStatisticsView.tsx
index b3175dae7..98abb5610 100644
--- a/web/src/components/PersonalStatistics.tsx
+++ b/web/src/components/UserStatisticsView.tsx
@@ -10,7 +10,7 @@ interface Props {
user: User;
}
-const PersonalStatistics = (props: Props) => {
+const UserStatisticsView = (props: Props) => {
const { user } = props;
const t = useTranslate();
const tagStore = useTagStore();
@@ -39,7 +39,9 @@ const PersonalStatistics = (props: Props) => {
return (
<div className="w-full border mt-2 py-2 px-3 rounded-md space-y-0.5 text-gray-500 dark:text-gray-400 bg-zinc-50 dark:bg-zinc-900 dark:border-zinc-800">
- <p className="text-sm font-medium dark:text-gray-500">{t("common.statistics")}</p>
+ <div className="mb-1 w-full flex flex-row justify-between items-center">
+ <p className="text-sm font-medium leading-6 dark:text-gray-500">{t("common.statistics")}</p>
+ </div>
<div className="w-full flex justify-between items-center">
<div className="w-full flex justify-start items-center">
<Icon.CalendarDays className="w-4 h-auto mr-1" />
@@ -65,4 +67,4 @@ const PersonalStatistics = (props: Props) => {
);
};
-export default PersonalStatistics;
+export default UserStatisticsView;