From 4a407668bc8a0188ef54e6c9dc34e51a979e4483 Mon Sep 17 00:00:00 2001 From: Steven Date: Sat, 13 Jan 2024 15:33:23 +0800 Subject: [PATCH] chore: tweak dialog close button --- .../components/ChangeMemberPasswordDialog.tsx | 25 ++++++++++--------- .../components/ChangeMemoCreatedTsDialog.tsx | 18 +++++++------ web/src/components/ChangePasswordDialog.tsx | 8 +++--- .../components/CreateAccessTokenDialog.tsx | 8 +++--- .../CreateIdentityProviderDialog.tsx | 8 +++--- .../components/CreateMemoRelationDialog.tsx | 8 +++--- web/src/components/CreateResourceDialog.tsx | 8 +++--- .../components/CreateStorageServiceDialog.tsx | 8 +++--- web/src/components/CreateTagDialog.tsx | 8 +++--- web/src/components/CreateWebhookDialog.tsx | 8 +++--- web/src/components/Dialog/CommonDialog.tsx | 8 +++--- .../components/DisablePasswordLoginDialog.tsx | 10 ++++---- .../MemoEditor/MemoEditorDialog.tsx | 7 +++--- web/src/components/PreviewMarkdownDialog.tsx | 9 ++++--- web/src/components/ShareMemoDialog.tsx | 8 +++--- web/src/components/UpdateAccountDialog.tsx | 8 +++--- .../UpdateCustomizedProfileDialog.tsx | 10 ++++---- .../components/UpdateLocalStorageDialog.tsx | 8 +++--- web/src/css/tailwind.css | 22 ---------------- 19 files changed, 91 insertions(+), 106 deletions(-) diff --git a/web/src/components/ChangeMemberPasswordDialog.tsx b/web/src/components/ChangeMemberPasswordDialog.tsx index 98300cb0..d3a883bd 100644 --- a/web/src/components/ChangeMemberPasswordDialog.tsx +++ b/web/src/components/ChangeMemberPasswordDialog.tsx @@ -1,3 +1,4 @@ +import { Button, IconButton, Input } from "@mui/joy"; import { useEffect, useState } from "react"; import { toast } from "react-hot-toast"; import { useUserStore } from "@/store/v1"; @@ -69,34 +70,34 @@ const ChangeMemberPasswordDialog: React.FC = (props: Props) => {

{t("setting.account-section.change-password")} ({user.nickname})

- + + +

{t("auth.new-password")}

-

{t("auth.repeat-new-password")}

- -
- +
+ +
diff --git a/web/src/components/ChangeMemoCreatedTsDialog.tsx b/web/src/components/ChangeMemoCreatedTsDialog.tsx index 5fbdc94d..c5639c58 100644 --- a/web/src/components/ChangeMemoCreatedTsDialog.tsx +++ b/web/src/components/ChangeMemoCreatedTsDialog.tsx @@ -1,4 +1,4 @@ -import { Button } from "@mui/joy"; +import { Button, IconButton, Input } from "@mui/joy"; import { useEffect, useState } from "react"; import { toast } from "react-hot-toast"; import { getNormalizedTimeString, getUnixTime } from "@/helpers/datetime"; @@ -66,16 +66,20 @@ const ChangeMemoCreatedTsDialog: React.FC = (props: Props) => { <>

{t("message.change-memo-created-time")}

- + + +
-
diff --git a/web/src/components/ChangePasswordDialog.tsx b/web/src/components/ChangePasswordDialog.tsx index 3e884954..c8cf0324 100644 --- a/web/src/components/ChangePasswordDialog.tsx +++ b/web/src/components/ChangePasswordDialog.tsx @@ -1,4 +1,4 @@ -import { Button, Input } from "@mui/joy"; +import { Button, IconButton, Input } from "@mui/joy"; import { useEffect, useState } from "react"; import { toast } from "react-hot-toast"; import useCurrentUser from "@/hooks/useCurrentUser"; @@ -70,9 +70,9 @@ const ChangePasswordDialog: React.FC = ({ destroy }: Props) => { <>

{t("setting.account-section.change-password")}

- + + +

{t("auth.new-password")}

diff --git a/web/src/components/CreateAccessTokenDialog.tsx b/web/src/components/CreateAccessTokenDialog.tsx index cae2749f..84e2472d 100644 --- a/web/src/components/CreateAccessTokenDialog.tsx +++ b/web/src/components/CreateAccessTokenDialog.tsx @@ -1,4 +1,4 @@ -import { Button, Input, Radio, RadioGroup } from "@mui/joy"; +import { Button, IconButton, Input, Radio, RadioGroup } from "@mui/joy"; import React, { useState } from "react"; import { toast } from "react-hot-toast"; import { userServiceClient } from "@/grpcweb"; @@ -86,9 +86,9 @@ const CreateAccessTokenDialog: React.FC = (props: Props) => { <>

Create access token

- + destroy()}> + +
diff --git a/web/src/components/CreateIdentityProviderDialog.tsx b/web/src/components/CreateIdentityProviderDialog.tsx index 7c9b54f0..63756ff9 100644 --- a/web/src/components/CreateIdentityProviderDialog.tsx +++ b/web/src/components/CreateIdentityProviderDialog.tsx @@ -1,4 +1,4 @@ -import { Button, Divider, Input, Option, Select, Typography } from "@mui/joy"; +import { Button, Divider, IconButton, Input, Option, Select, Typography } from "@mui/joy"; import { useEffect, useState } from "react"; import { toast } from "react-hot-toast"; import * as api from "@/helpers/api"; @@ -237,9 +237,9 @@ const CreateIdentityProviderDialog: React.FC = (props: Props) => { <>

{t(isCreating ? "setting.sso-section.create-sso" : "setting.sso-section.update-sso")}

- + + +
{isCreating && ( diff --git a/web/src/components/CreateMemoRelationDialog.tsx b/web/src/components/CreateMemoRelationDialog.tsx index 8fa169c5..66bfa56a 100644 --- a/web/src/components/CreateMemoRelationDialog.tsx +++ b/web/src/components/CreateMemoRelationDialog.tsx @@ -1,4 +1,4 @@ -import { Button, Input } from "@mui/joy"; +import { Button, IconButton, Input } from "@mui/joy"; import { isNaN, unionBy } from "lodash-es"; import React, { useState } from "react"; import { toast } from "react-hot-toast"; @@ -76,9 +76,9 @@ const CreateMemoRelationDialog: React.FC = (props: Props) => { <>

{"Add references"}

- + destroy()}> + +
= (props: Props) => { <>

{t("resource.create-dialog.title")}

- + + +
diff --git a/web/src/components/CreateStorageServiceDialog.tsx b/web/src/components/CreateStorageServiceDialog.tsx index a4fe59ad..033185cd 100644 --- a/web/src/components/CreateStorageServiceDialog.tsx +++ b/web/src/components/CreateStorageServiceDialog.tsx @@ -1,4 +1,4 @@ -import { Button, Input, Typography } from "@mui/joy"; +import { Button, IconButton, Input, Typography } from "@mui/joy"; import { useEffect, useState } from "react"; import { toast } from "react-hot-toast"; import * as api from "@/helpers/api"; @@ -109,9 +109,9 @@ const CreateStorageServiceDialog: React.FC = (props: Props) => { {t(isCreating ? "setting.storage-section.create-storage" : "setting.storage-section.update-storage")} - + + +
diff --git a/web/src/components/CreateTagDialog.tsx b/web/src/components/CreateTagDialog.tsx index ce788f5e..0f3319e2 100644 --- a/web/src/components/CreateTagDialog.tsx +++ b/web/src/components/CreateTagDialog.tsx @@ -1,4 +1,4 @@ -import { Button, Input } from "@mui/joy"; +import { Button, IconButton, Input } from "@mui/joy"; import React, { useEffect, useState } from "react"; import { toast } from "react-hot-toast"; import { tagServiceClient } from "@/grpcweb"; @@ -91,9 +91,9 @@ const CreateTagDialog: React.FC = (props: Props) => { <>

{t("tag-list.create-tag")}

- + destroy()}> + +
= (props: Props) => { <>

{isCreating ? "Create webhook" : "Edit webhook"}

- + destroy()}> + +
diff --git a/web/src/components/Dialog/CommonDialog.tsx b/web/src/components/Dialog/CommonDialog.tsx index f0cc40ad..2781949d 100644 --- a/web/src/components/Dialog/CommonDialog.tsx +++ b/web/src/components/Dialog/CommonDialog.tsx @@ -1,4 +1,4 @@ -import { Button } from "@mui/joy"; +import { Button, IconButton } from "@mui/joy"; import { DefaultColorPalette } from "@mui/joy/styles/types"; import { useTranslate } from "@/utils/i18n"; import Icon from "../Icon"; @@ -48,9 +48,9 @@ const CommonDialog: React.FC = (props: Props) => { <>

{title}

- + + +

{content}

diff --git a/web/src/components/DisablePasswordLoginDialog.tsx b/web/src/components/DisablePasswordLoginDialog.tsx index 061586df..916ba711 100644 --- a/web/src/components/DisablePasswordLoginDialog.tsx +++ b/web/src/components/DisablePasswordLoginDialog.tsx @@ -1,4 +1,4 @@ -import { Button } from "@mui/joy"; +import { Button, IconButton, Input } from "@mui/joy"; import { useState } from "react"; import { toast } from "react-hot-toast"; import * as api from "@/helpers/api"; @@ -59,15 +59,15 @@ const DisablePasswordLoginDialog: React.FC = ({ destroy }: Props) => { <>

{t("setting.system-section.disable-password-login")}

- + + +
{confirmedOnce ? ( <>

{t("setting.system-section.disable-password-login-final-warning")}

- + ) : (

{t("setting.system-section.disable-password-login-warning")}

diff --git a/web/src/components/MemoEditor/MemoEditorDialog.tsx b/web/src/components/MemoEditor/MemoEditorDialog.tsx index ae517f8d..f85141d9 100644 --- a/web/src/components/MemoEditor/MemoEditorDialog.tsx +++ b/web/src/components/MemoEditor/MemoEditorDialog.tsx @@ -1,3 +1,4 @@ +import { IconButton } from "@mui/joy"; import { useEffect } from "react"; import { useGlobalStore, useTagStore } from "@/store/module"; import { MemoRelation } from "@/types/proto/api/v2/memo_relation_service"; @@ -30,9 +31,9 @@ const MemoEditorDialog: React.FC = ({ memoId, relationList, destroy }: Pr

{systemStatus.customizedProfile.name}

- + + +
= ({ content, destroy }: Props) =>

Preview

- + + +
- + {content !== "" ? :

Nothing to preview

}
); diff --git a/web/src/components/ShareMemoDialog.tsx b/web/src/components/ShareMemoDialog.tsx index ccff1733..305a0269 100644 --- a/web/src/components/ShareMemoDialog.tsx +++ b/web/src/components/ShareMemoDialog.tsx @@ -1,4 +1,4 @@ -import { Button } from "@mui/joy"; +import { Button, IconButton } from "@mui/joy"; import copy from "copy-to-clipboard"; import React, { useEffect, useRef } from "react"; import { toast } from "react-hot-toast"; @@ -82,9 +82,9 @@ const ShareMemoDialog: React.FC = (props: Props) => { <>

{t("common.share")} Memo

- + + +
diff --git a/web/src/components/UpdateAccountDialog.tsx b/web/src/components/UpdateAccountDialog.tsx index cedbb6ee..332c10f1 100644 --- a/web/src/components/UpdateAccountDialog.tsx +++ b/web/src/components/UpdateAccountDialog.tsx @@ -1,4 +1,4 @@ -import { Button, Input } from "@mui/joy"; +import { Button, IconButton, Input } from "@mui/joy"; import { isEqual } from "lodash-es"; import { useState } from "react"; import { toast } from "react-hot-toast"; @@ -127,9 +127,9 @@ const UpdateAccountDialog: React.FC = ({ destroy }: Props) => { <>

{t("setting.account-section.update-information")}

- + + +
diff --git a/web/src/components/UpdateCustomizedProfileDialog.tsx b/web/src/components/UpdateCustomizedProfileDialog.tsx index b951224d..3bd557f1 100644 --- a/web/src/components/UpdateCustomizedProfileDialog.tsx +++ b/web/src/components/UpdateCustomizedProfileDialog.tsx @@ -1,4 +1,4 @@ -import { Button, Input } from "@mui/joy"; +import { Button, IconButton, Input } from "@mui/joy"; import Textarea from "@mui/joy/Textarea/Textarea"; import { useState } from "react"; import { toast } from "react-hot-toast"; @@ -95,9 +95,9 @@ const UpdateCustomizedProfileDialog: React.FC = ({ destroy }: Props) => { <>

{t("setting.system-section.customize-server.title")}

- + + +

@@ -108,7 +108,7 @@ const UpdateCustomizedProfileDialog: React.FC = ({ destroy }: Props) => {

{t("setting.system-section.customize-server.icon-url")}

{t("setting.system-section.customize-server.description")}

-