Skip to content

Commit

Permalink
refactor: restore modal bg color and give modal elements better names
Browse files Browse the repository at this point in the history
Signed-off-by: Elizabeth Kelen <[email protected]>
  • Loading branch information
ekelen committed Nov 9, 2020
1 parent 0bc8aef commit 9181af6
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 17 deletions.
8 changes: 4 additions & 4 deletions web/src/assets/modal-snippets.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
overflow: hidden;
}

.modalContainer {
.modalOverlay {
width: 120vw;
/* border: 1px solid green; */

Expand All @@ -33,7 +33,7 @@
margin-bottom: 100px;
}

.modalGuts {
.modalContainer {
composes: flexCol aiCenter;
position: relative;
margin: 1.75rem auto;
Expand All @@ -46,14 +46,14 @@

max-width: 80vw;
outline: 0;
background-color: var(--bg-block);
background-color: var(--bg-page);

box-shadow: -3rem 0.5rem 20px rgba(14, 16, 45, 0.2),
3rem 0.5rem 20px rgba(14, 16, 45, 0.2);
}

@media (min-width: tablet) {
.modalGuts {
.modalContainer {
box-shadow: none;
}
}
Expand Down
1 change: 1 addition & 0 deletions web/src/ui/components/FilterModal/FilterModal.module.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@value utils: "../../../assets/layout-utils.module.css";
@value modalContainer from "../../../assets/modal-snippets.module.css";
@value space_xs, space_sm, space_md, space_lg, space_xl, space_xxl from utils;
@value flexCol, childrenMrMd, childrenMbSm, flexRow, aiCenter, flexWrap, aiWrapCenter, jcCenter from utils;

Expand Down
4 changes: 2 additions & 2 deletions web/src/ui/components/MessageModal/MessageModal.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react";
import Modal from "../Modal/Modal";
import {
messageModalOverlay,
messageModalContainer,
messageModalGuts,
messageModalBody,
} from "./MessageModal.module.css";

Expand All @@ -15,8 +15,8 @@ const MessageModal = ({
<Modal
Title={Header}
Body={Body}
modalGutsClassName={messageModalGuts}
modalContainerClassName={messageModalContainer}
modalOverlayClassName={messageModalOverlay}
modalBodyClassName={messageModalBody}
Footer={Footer}
onClose={onClose}
Expand Down
14 changes: 7 additions & 7 deletions web/src/ui/components/MessageModal/MessageModal.module.css
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
@value utils: "../../../assets/layout-utils.module.css";
@value modal, modalGuts, modalContainer, modalBody from "../../../assets/modal-snippets.module.css";
@value modal, modalContainer, modalOverlay, modalBody from "../../../assets/modal-snippets.module.css";
@value space_xs, space_sm, space_md, space_lg, space_xl, space_xxl from utils;
@value aiCenter, aiWrapCenter, flexRow, wrapText, hideOnMobile, flexWrap, flexCol, aiCenter, jcCenter from utils;

.messageModalContainer {
composes: modalContainer;
.messageModalOverlay {
composes: modalOverlay;
composes: flexCol;
}

.messageModalGuts {
composes: modalGuts;
.messageModalContainer {
composes: modalContainer;
}

.messageModalBody {
Expand All @@ -21,10 +21,10 @@
}

@media (min-height: 21em) {
.messageModalContainer {
.messageModalOverlay {
justify-content: center;
}
.messageModalGuts {
.messageModalContainer {
margin-top: -2rem;
}
}
8 changes: 4 additions & 4 deletions web/src/ui/components/Modal/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React from "react";
import { X } from "react-feather";
import {
faded,
modalOverlay,
modalContainer,
modalGuts,
modalHeader,
modalClose,
modalTitle,
Expand All @@ -16,8 +16,8 @@ const Modal = ({
Body = null,
Footer = null,
onClose = () => {},
modalOverlayClassName = "",
modalContainerClassName = "",
modalGutsClassName = "",
modalHeaderClassName = "",
modalBodyClassName = "",
modalFooterClassName = "",
Expand All @@ -31,14 +31,14 @@ const Modal = ({
}}
/>
<div
className={modalContainerClassName || modalContainer}
className={modalOverlayClassName || modalOverlay}
onClick={(e) => {
e.stopPropagation();
onClose();
}}
>
<div
className={modalGutsClassName || modalGuts}
className={modalContainerClassName || modalContainer}
onClick={(e) => {
e.stopPropagation();
}}
Expand Down

0 comments on commit 9181af6

Please sign in to comment.