Skip to content

Commit

Permalink
chore: update component name
Browse files Browse the repository at this point in the history
  • Loading branch information
boojack committed Apr 9, 2024
1 parent 000b3a7 commit 6028838
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
5 changes: 2 additions & 3 deletions web/src/components/Dialog/BaseDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import "@/less/base-dialog.less";
interface DialogConfig {
dialogName: string;
className?: string;
containerClassName?: string;
clickSpaceDestroy?: boolean;
}

Expand All @@ -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);
Expand Down Expand Up @@ -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>
Expand Down
4 changes: 2 additions & 2 deletions web/src/components/HomeSidebar/HomeSidebar.tsx
Original file line number Diff line number Diff line change
@@ -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";

Expand All @@ -19,7 +19,7 @@ const HomeSidebar = (props: Props) => {
)}
>
<SearchBar />
<PersonalStatistics user={currentUser} />
<UserStatisticsView user={currentUser} />
<TagsSection />
</aside>
);
Expand Down
1 change: 0 additions & 1 deletion web/src/components/MemoEditor/MemoEditorDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion web/src/components/PreviewMarkdownDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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" />
Expand All @@ -65,4 +67,4 @@ const PersonalStatistics = (props: Props) => {
);
};

export default PersonalStatistics;
export default UserStatisticsView;

0 comments on commit 6028838

Please sign in to comment.