forked from XiaoMo/ChatGPT-Next-Web
feat: add max icon for modals
This commit is contained in:
parent
5c8be2a8f6
commit
9e6617e3ca
@ -186,7 +186,7 @@
|
|||||||
box-shadow: var(--card-shadow);
|
box-shadow: var(--card-shadow);
|
||||||
border: var(--border-in-light);
|
border: var(--border-in-light);
|
||||||
|
|
||||||
* {
|
*:not(li) {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -79,6 +79,19 @@
|
|||||||
|
|
||||||
--modal-padding: 20px;
|
--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 {
|
.modal-header {
|
||||||
padding: var(--modal-padding);
|
padding: var(--modal-padding);
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -91,14 +104,22 @@
|
|||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.modal-close-btn {
|
.modal-header-actions {
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
.modal-header-action {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
|
&:not(:last-child) {
|
||||||
|
margin-right: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
filter: brightness(1.2);
|
filter: brightness(1.2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.modal-content {
|
.modal-content {
|
||||||
max-height: 40vh;
|
max-height: 40vh;
|
||||||
|
@ -6,6 +6,8 @@ import EyeOffIcon from "../icons/eye-off.svg";
|
|||||||
import DownIcon from "../icons/down.svg";
|
import DownIcon from "../icons/down.svg";
|
||||||
import ConfirmIcon from "../icons/confirm.svg";
|
import ConfirmIcon from "../icons/confirm.svg";
|
||||||
import CancelIcon from "../icons/cancel.svg";
|
import CancelIcon from "../icons/cancel.svg";
|
||||||
|
import MaxIcon from "../icons/max.svg";
|
||||||
|
import MinIcon from "../icons/min.svg";
|
||||||
|
|
||||||
import Locale from "../locales";
|
import Locale from "../locales";
|
||||||
|
|
||||||
@ -111,15 +113,32 @@ export function Modal(props: ModalProps) {
|
|||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
const [isMax, setMax] = useState(false);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles["modal-container"]}>
|
<div
|
||||||
|
className={
|
||||||
|
styles["modal-container"] + ` ${isMax && styles["modal-container-max"]}`
|
||||||
|
}
|
||||||
|
>
|
||||||
<div className={styles["modal-header"]}>
|
<div className={styles["modal-header"]}>
|
||||||
<div className={styles["modal-title"]}>{props.title}</div>
|
<div className={styles["modal-title"]}>{props.title}</div>
|
||||||
|
|
||||||
<div className={styles["modal-close-btn"]} onClick={props.onClose}>
|
<div className={styles["modal-header-actions"]}>
|
||||||
|
<div
|
||||||
|
className={styles["modal-header-action"]}
|
||||||
|
onClick={() => setMax(!isMax)}
|
||||||
|
>
|
||||||
|
{isMax ? <MinIcon /> : <MaxIcon />}
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
className={styles["modal-header-action"]}
|
||||||
|
onClick={props.onClose}
|
||||||
|
>
|
||||||
<CloseIcon />
|
<CloseIcon />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className={styles["modal-content"]}>{props.children}</div>
|
<div className={styles["modal-content"]}>{props.children}</div>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user