diff options
author | crupest <crupest@outlook.com> | 2021-07-01 16:43:59 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-07-01 16:43:59 +0800 |
commit | 81e54efaae0ec1d5f1f90c3ca40448f8c61f0e80 (patch) | |
tree | 63fd4f7734c1fdef1c49266c957efcb71413164b /FrontEnd/src/views/common | |
parent | e38e7bb7c113f072914f988063bd9b095f4290c0 (diff) | |
download | timeline-81e54efaae0ec1d5f1f90c3ca40448f8c61f0e80.tar.gz timeline-81e54efaae0ec1d5f1f90c3ca40448f8c61f0e80.tar.bz2 timeline-81e54efaae0ec1d5f1f90c3ca40448f8c61f0e80.zip |
...
Diffstat (limited to 'FrontEnd/src/views/common')
-rw-r--r-- | FrontEnd/src/views/common/button/Button.css | 16 | ||||
-rw-r--r-- | FrontEnd/src/views/common/dailog/ConfirmDialog.tsx | 7 | ||||
-rw-r--r-- | FrontEnd/src/views/common/dailog/Dialog.css | 9 | ||||
-rw-r--r-- | FrontEnd/src/views/common/dailog/OperationDialog.css | 0 | ||||
-rw-r--r-- | FrontEnd/src/views/common/dailog/OperationDialog.tsx | 16 | ||||
-rw-r--r-- | FrontEnd/src/views/common/index.css | 3 | ||||
-rw-r--r-- | FrontEnd/src/views/common/menu/Menu.css | 2 |
7 files changed, 37 insertions, 16 deletions
diff --git a/FrontEnd/src/views/common/button/Button.css b/FrontEnd/src/views/common/button/Button.css index ec2dd798..54127f05 100644 --- a/FrontEnd/src/views/common/button/Button.css +++ b/FrontEnd/src/views/common/button/Button.css @@ -57,7 +57,8 @@ }
.cru-button:not(.outline):disabled {
- background-color: var(--cru-button-f3-color);
+ background-color: var(--cru-disable-color);
+ cursor: auto;
}
.cru-button.outline {
@@ -67,23 +68,24 @@ padding: 0.2em 0.5em;
border-radius: 0.2em;
transition: all 0.6s;
- background-color: var(--cru-background-color);
+ background-color: white;
}
.cru-button.outline:hover {
color: var(--cru-button-f1-color);
border-color: var(--cru-button-f1-color);
- background-color: var(--cru-background-1-color);
+ background-color: var(--cru-background-color);
}
.cru-button.outline:active {
color: var(--cru-button-f2-color);
border-color: var(--cru-button-f2-color);
- background-color: var(--cru-background-2-color);
+ background-color: var(--cru-background-1-color);
}
.cru-button.outline:disabled {
- color: var(--cru-button-f3-color);
- border-color: var(--cru-button-f3-color);
- background-color: var(--cru-background-3-color);
+ color: var(--cru-disable-color);
+ border-color: var(--cru-disable-color);
+ background-color: white;
+ cursor: auto;
}
diff --git a/FrontEnd/src/views/common/dailog/ConfirmDialog.tsx b/FrontEnd/src/views/common/dailog/ConfirmDialog.tsx index 1ad52350..c10b1cdb 100644 --- a/FrontEnd/src/views/common/dailog/ConfirmDialog.tsx +++ b/FrontEnd/src/views/common/dailog/ConfirmDialog.tsx @@ -16,12 +16,15 @@ const ConfirmDialog: React.FC<{ return ( <Dialog onClose={onClose} open={open}> - <h3 className="text-danger">{convertI18nText(title, t)}</h3> + <h3 className="cru-color-danger">{convertI18nText(title, t)}</h3> + <hr /> <p>{convertI18nText(body, t)}</p> - <div> + <hr /> + <div className="cru-dialog-bottom-area"> <Button text="operationDialog.cancel" color="secondary" + outline onClick={onClose} /> <Button diff --git a/FrontEnd/src/views/common/dailog/Dialog.css b/FrontEnd/src/views/common/dailog/Dialog.css index abce04fd..c1209d99 100644 --- a/FrontEnd/src/views/common/dailog/Dialog.css +++ b/FrontEnd/src/views/common/dailog/Dialog.css @@ -20,3 +20,12 @@ padding: 1.5em;
background-color: white;
}
+
+.cru-dialog-bottom-area {
+ display: flex;
+ justify-content: flex-end;
+}
+
+.cru-dialog-bottom-area > * {
+ margin: 0 0.5em
+}
diff --git a/FrontEnd/src/views/common/dailog/OperationDialog.css b/FrontEnd/src/views/common/dailog/OperationDialog.css new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/FrontEnd/src/views/common/dailog/OperationDialog.css diff --git a/FrontEnd/src/views/common/dailog/OperationDialog.tsx b/FrontEnd/src/views/common/dailog/OperationDialog.tsx index 1e765276..f394a3d3 100644 --- a/FrontEnd/src/views/common/dailog/OperationDialog.tsx +++ b/FrontEnd/src/views/common/dailog/OperationDialog.tsx @@ -11,6 +11,8 @@ import Button from "../button/Button"; import LoadingButton from "../button/LoadingButton"; import Dialog from "./Dialog"; +import "./OperationDialog.css"; + interface DefaultErrorPromptProps { error?: string; } @@ -18,13 +20,13 @@ interface DefaultErrorPromptProps { const DefaultErrorPrompt: React.FC<DefaultErrorPromptProps> = (props) => { const { t } = useTranslation(); - let result = <p className="text-danger">{t("operationDialog.error")}</p>; + let result = <p className="cru-color-danger">{t("operationDialog.error")}</p>; if (props.error != null) { result = ( <> {result} - <p className="text-danger">{props.error}</p> + <p className="cru-color-danger">{props.error}</p> </> ); } @@ -392,10 +394,12 @@ const OperationDialog = < } })} </div> - <div> + <hr /> + <div className="cru-dialog-bottom-area"> <Button text="operationDialog.cancel" color="secondary" + outline onClick={close} /> <LoadingButton @@ -421,7 +425,7 @@ const OperationDialog = < content = props.successPrompt?.(result.data) ?? t("operationDialog.success"); if (typeof content === "string") - content = <p className="text-success">{content}</p>; + content = <p className="cru-color-success">{content}</p>; } else { content = props.failurePrompt?.(result.data) ?? <DefaultErrorPrompt />; if (typeof content === "string") @@ -430,6 +434,7 @@ const OperationDialog = < body = ( <> <div>{content}</div> + <hr /> <div> <Button text="operationDialog.ok" color="primary" onClick={close} /> </div> @@ -446,11 +451,12 @@ const OperationDialog = < <Dialog open={props.open} onClose={close}> <h3 className={ - props.themeColor != null ? "text-" + props.themeColor : undefined + props.themeColor != null ? "cru-color-" + props.themeColor : undefined } > {title} </h3> + <hr /> {body} </Dialog> ); diff --git a/FrontEnd/src/views/common/index.css b/FrontEnd/src/views/common/index.css index 02eed6d9..62167cfc 100644 --- a/FrontEnd/src/views/common/index.css +++ b/FrontEnd/src/views/common/index.css @@ -2,7 +2,8 @@ --cru-background-color: #f8f9fa;
--cru-background-1-color: #e9ecef;
--cru-background-2-color: #dee2e6;
- --cru-background-3-color: #ced4da;
+
+ --cru-disable-color: #ced4da;
--cru-primary-color: rgb(0, 123, 255);
--cru-primary-l1-color: rgb(26, 136, 255);
diff --git a/FrontEnd/src/views/common/menu/Menu.css b/FrontEnd/src/views/common/menu/Menu.css index c933b34f..a30eb5c6 100644 --- a/FrontEnd/src/views/common/menu/Menu.css +++ b/FrontEnd/src/views/common/menu/Menu.css @@ -22,7 +22,7 @@ }
.cru-menu-item.color-secondary:hover {
- color: var(--cru-text-on-secondary-color);
+ color: var(--cru-secondary-t-color);
background-color: var(--cru-secondary-color);
}
|