aboutsummaryrefslogtreecommitdiff
path: root/FrontEnd/src/components/dialog/OperationDialog.tsx
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2023-08-31 00:30:35 +0800
committercrupest <crupest@outlook.com>2023-08-31 00:30:35 +0800
commit9c69024cf5961c3c71fb58e4237f09a513d195b1 (patch)
treee3986003da3b261f3f0f96c24166fed016ff8b48 /FrontEnd/src/components/dialog/OperationDialog.tsx
parent97c3d6f302e236a273d64ddffc632f18ed967cbc (diff)
downloadtimeline-9c69024cf5961c3c71fb58e4237f09a513d195b1.tar.gz
timeline-9c69024cf5961c3c71fb58e4237f09a513d195b1.tar.bz2
timeline-9c69024cf5961c3c71fb58e4237f09a513d195b1.zip
Minor buttons
Diffstat (limited to 'FrontEnd/src/components/dialog/OperationDialog.tsx')
-rw-r--r--FrontEnd/src/components/dialog/OperationDialog.tsx39
1 files changed, 16 insertions, 23 deletions
diff --git a/FrontEnd/src/components/dialog/OperationDialog.tsx b/FrontEnd/src/components/dialog/OperationDialog.tsx
index 4b4ceb36..6ca4d0a0 100644
--- a/FrontEnd/src/components/dialog/OperationDialog.tsx
+++ b/FrontEnd/src/components/dialog/OperationDialog.tsx
@@ -8,7 +8,7 @@ import {
Initializer as InputInitializer,
InputConfirmValueDict,
} from "../input";
-import { ButtonRow } from "../button";
+import { ButtonRowV2 } from "../button";
import Dialog from "./Dialog";
import DialogContainer from "./DialogContainer";
import { useDialogController } from "./DialogProvider";
@@ -140,7 +140,7 @@ function OperationDialog<TData>(props: OperationDialogProps<TData>) {
}
let body: ReactNode;
- let buttons: ComponentProps<typeof ButtonRow>["buttons"];
+ let buttons: ComponentProps<typeof ButtonRowV2>["buttons"];
if (step.type === "input" || step.type === "process") {
const isProcessing = step.type === "process";
@@ -161,25 +161,19 @@ function OperationDialog<TData>(props: OperationDialogProps<TData>) {
buttons = [
{
key: "cancel",
- type: "normal",
- props: {
- text: "operationDialog.cancel",
- color: "secondary",
- outline: true,
- onClick: close,
- disabled: isProcessing,
- },
+ text: "operationDialog.cancel",
+ onClick: close,
+ disabled: isProcessing,
},
{
key: "confirm",
type: "loading",
- props: {
- text: "operationDialog.confirm",
- color,
- loading: isProcessing,
- disabled: hasErrorAndDirty,
- onClick: onConfirm,
- },
+ action: "major",
+ text: "operationDialog.confirm",
+ color,
+ loading: isProcessing,
+ disabled: hasErrorAndDirty,
+ onClick: onConfirm,
},
];
} else {
@@ -207,18 +201,17 @@ function OperationDialog<TData>(props: OperationDialogProps<TData>) {
{
key: "ok",
type: "normal",
- props: {
- text: "operationDialog.ok",
- color: "primary",
- onClick: close,
- },
+ action: "major",
+ color: "create",
+ text: "operationDialog.ok",
+ onClick: close,
},
];
}
return (
<Dialog color={color}>
- <DialogContainer title={title} titleColor={color} buttons={buttons}>
+ <DialogContainer title={title} titleColor={color} buttonsV2={buttons}>
{body}
</DialogContainer>
</Dialog>