diff --git a/web/modals/chat/sidebar-list-modal.react.js b/web/modals/chat/sidebar-list-modal.react.js --- a/web/modals/chat/sidebar-list-modal.react.js +++ b/web/modals/chat/sidebar-list-modal.react.js @@ -115,7 +115,7 @@ } return ( - +
h2 { - font-size: 22px; - font-weight: 300; - color: var(--fg); + +div.modalHeader { + display: flex; + justify-content: space-between; + align-items: center; + padding: 32px 32px 0px 32px; } -@media only screen and (-webkit-min-device-pixel-ratio: 2), - only screen and (min--moz-device-pixel-ratio: 2), - only screen and (-o-min-device-pixel-ratio: 2/1), - only screen and (min-device-pixel-ratio: 2), - only screen and (min-resolution: 320dpi), - only screen and (min-resolution: 2dppx) { - div.modal-container { - background: var(--bg); - } +h2.title { + font-size: 20px; + font-weight: 500; + line-height: 32px; + color: var(--fg); + display: flex; + align-items: center; + column-gap: 8px; } diff --git a/web/modals/modal.react.js b/web/modals/modal.react.js --- a/web/modals/modal.react.js +++ b/web/modals/modal.react.js @@ -6,25 +6,17 @@ import SWMansionIcon, { type Icon } from '../SWMansionIcon.react'; import css from './modal.css'; -export type ModalSize = 'small' | 'large'; +export type ModalSize = 'small' | 'large' | 'fit-content'; type Props = { - +name: React.Node, + +name: string, +icon?: Icon, +onClose: () => void, +children?: React.Node, +size?: ModalSize, - +fixedHeight?: boolean, }; function Modal(props: Props): React.Node { - const { - size = 'small', - children, - onClose, - fixedHeight = true, - name, - icon, - } = props; + const { size = 'small', children, onClose, name, icon } = props; const overlayRef = React.useRef(); const onBackgroundClick = React.useCallback( @@ -51,28 +43,14 @@ } }, []); - const overlayClasses = React.useMemo( - () => - classNames(css['modal-overlay'], { - [css['resizable-modal-overlay']]: !fixedHeight, - }), - [fixedHeight], - ); const modalContainerClasses = React.useMemo( () => - classNames(css['modal-container'], { - [css['large-modal-container']]: size === 'large', + classNames(css.modalContainer, { + [css.modalContainerLarge]: size === 'large', + [css.modalContainerSmall]: size === 'small', }), [size], ); - const modalClasses = React.useMemo( - () => - classNames(css['modal'], { - [css['fixed-height-modal']]: fixedHeight, - }), - [fixedHeight], - ); - const headerIcon = React.useMemo(() => { if (!icon) { return null; @@ -82,25 +60,23 @@ return (
-
-
- - × - -

- {headerIcon} - {name} -

+
+

+ {headerIcon} + {name} +

+
+
- {children}
+ {children}
); diff --git a/web/theme.css b/web/theme.css --- a/web/theme.css +++ b/web/theme.css @@ -139,4 +139,6 @@ --subchannels-modal-color: var(--shades-black-60); --subchannels-modal-color-hover: var(--shades-white-100); --color-selector-active-bg: var(--shades-black-80); + --modal-close-color: var(--shades-black-60); + --modal-close-color-hover: var(--shades-white-100); }