mirror of
https://github.com/usememos/memos.git
synced 2025-02-21 05:40:57 +01:00
chore: update component name
This commit is contained in:
parent
000b3a7a2c
commit
6028838f03
@ -12,7 +12,6 @@ import "@/less/base-dialog.less";
|
|||||||
interface DialogConfig {
|
interface DialogConfig {
|
||||||
dialogName: string;
|
dialogName: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
containerClassName?: string;
|
|
||||||
clickSpaceDestroy?: boolean;
|
clickSpaceDestroy?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -21,7 +20,7 @@ interface Props extends DialogConfig, DialogProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const BaseDialog: React.FC<Props> = (props: Props) => {
|
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 dialogStore = useDialogStore();
|
||||||
const dialogContainerRef = useRef<HTMLDivElement>(null);
|
const dialogContainerRef = useRef<HTMLDivElement>(null);
|
||||||
const dialogIndex = dialogStore.state.dialogStack.findIndex((item) => item === dialogName);
|
const dialogIndex = dialogStore.state.dialogStack.findIndex((item) => item === dialogName);
|
||||||
@ -58,7 +57,7 @@ const BaseDialog: React.FC<Props> = (props: Props) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classNames("dialog-wrapper", className)} onMouseDown={handleSpaceClicked}>
|
<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}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import classNames from "classnames";
|
import classNames from "classnames";
|
||||||
import PersonalStatistics from "@/components/PersonalStatistics";
|
|
||||||
import SearchBar from "@/components/SearchBar";
|
import SearchBar from "@/components/SearchBar";
|
||||||
|
import UserStatisticsView from "@/components/UserStatisticsView";
|
||||||
import useCurrentUser from "@/hooks/useCurrentUser";
|
import useCurrentUser from "@/hooks/useCurrentUser";
|
||||||
import TagsSection from "./TagsSection";
|
import TagsSection from "./TagsSection";
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ const HomeSidebar = (props: Props) => {
|
|||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<SearchBar />
|
<SearchBar />
|
||||||
<PersonalStatistics user={currentUser} />
|
<UserStatisticsView user={currentUser} />
|
||||||
<TagsSection />
|
<TagsSection />
|
||||||
</aside>
|
</aside>
|
||||||
);
|
);
|
||||||
|
@ -55,7 +55,6 @@ export default function showMemoEditorDialog(props: Pick<Props, "memoName" | "ca
|
|||||||
{
|
{
|
||||||
className: "memo-editor-dialog",
|
className: "memo-editor-dialog",
|
||||||
dialogName: "memo-editor-dialog",
|
dialogName: "memo-editor-dialog",
|
||||||
containerClassName: "dark:!bg-zinc-800",
|
|
||||||
},
|
},
|
||||||
MemoEditorDialog,
|
MemoEditorDialog,
|
||||||
props,
|
props,
|
||||||
|
@ -34,7 +34,6 @@ export default function showPreviewMarkdownDialog(content: string): void {
|
|||||||
{
|
{
|
||||||
className: "preview-markdown-dialog",
|
className: "preview-markdown-dialog",
|
||||||
dialogName: "preview-markdown-dialog",
|
dialogName: "preview-markdown-dialog",
|
||||||
containerClassName: "dark:!bg-zinc-800",
|
|
||||||
},
|
},
|
||||||
PreviewMarkdownDialog,
|
PreviewMarkdownDialog,
|
||||||
{
|
{
|
||||||
|
@ -10,7 +10,7 @@ interface Props {
|
|||||||
user: User;
|
user: User;
|
||||||
}
|
}
|
||||||
|
|
||||||
const PersonalStatistics = (props: Props) => {
|
const UserStatisticsView = (props: Props) => {
|
||||||
const { user } = props;
|
const { user } = props;
|
||||||
const t = useTranslate();
|
const t = useTranslate();
|
||||||
const tagStore = useTagStore();
|
const tagStore = useTagStore();
|
||||||
@ -39,7 +39,9 @@ const PersonalStatistics = (props: Props) => {
|
|||||||
|
|
||||||
return (
|
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">
|
<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-between items-center">
|
||||||
<div className="w-full flex justify-start items-center">
|
<div className="w-full flex justify-start items-center">
|
||||||
<Icon.CalendarDays className="w-4 h-auto mr-1" />
|
<Icon.CalendarDays className="w-4 h-auto mr-1" />
|
||||||
@ -65,4 +67,4 @@ const PersonalStatistics = (props: Props) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default PersonalStatistics;
|
export default UserStatisticsView;
|
Loading…
x
Reference in New Issue
Block a user