From 9e6617e3ca251260943ce0ebc15f2fff1022df26 Mon Sep 17 00:00:00 2001 From: Yidadaa Date: Thu, 6 Jul 2023 01:11:50 +0800 Subject: [PATCH] feat: add max icon for modals --- app/components/exporter.module.scss | 2 +- app/components/ui-lib.module.scss | 29 +++++++++++++++++++++++++---- app/components/ui-lib.tsx | 25 ++++++++++++++++++++++--- 3 files changed, 48 insertions(+), 8 deletions(-) diff --git a/app/components/exporter.module.scss b/app/components/exporter.module.scss index 3fde363f..c2046ffc 100644 --- a/app/components/exporter.module.scss +++ b/app/components/exporter.module.scss @@ -186,7 +186,7 @@ box-shadow: var(--card-shadow); border: var(--border-in-light); - * { + *:not(li) { overflow: hidden; } } diff --git a/app/components/ui-lib.module.scss b/app/components/ui-lib.module.scss index d2ddb7df..86b467e5 100644 --- a/app/components/ui-lib.module.scss +++ b/app/components/ui-lib.module.scss @@ -79,6 +79,19 @@ --modal-padding: 20px; + &-max { + width: 95vw; + max-width: unset; + height: 95vh; + display: flex; + flex-direction: column; + + .modal-content { + max-height: unset !important; + flex-grow: 1; + } + } + .modal-header { padding: var(--modal-padding); display: flex; @@ -91,11 +104,19 @@ font-size: 16px; } - .modal-close-btn { - cursor: pointer; + .modal-header-actions { + display: flex; - &:hover { - filter: brightness(1.2); + .modal-header-action { + cursor: pointer; + + &:not(:last-child) { + margin-right: 20px; + } + + &:hover { + filter: brightness(1.2); + } } } } diff --git a/app/components/ui-lib.tsx b/app/components/ui-lib.tsx index e02051c0..5e6a50dc 100644 --- a/app/components/ui-lib.tsx +++ b/app/components/ui-lib.tsx @@ -6,6 +6,8 @@ import EyeOffIcon from "../icons/eye-off.svg"; import DownIcon from "../icons/down.svg"; import ConfirmIcon from "../icons/confirm.svg"; import CancelIcon from "../icons/cancel.svg"; +import MaxIcon from "../icons/max.svg"; +import MinIcon from "../icons/min.svg"; import Locale from "../locales"; @@ -111,13 +113,30 @@ export function Modal(props: ModalProps) { // eslint-disable-next-line react-hooks/exhaustive-deps }, []); + const [isMax, setMax] = useState(false); + return ( -
+
{props.title}
-
- +
+
setMax(!isMax)} + > + {isMax ? : } +
+
+ +