diff --git a/src/components/blocks/Modal.js b/src/components/blocks/Modal.js index d28c796..da6edff 100644 --- a/src/components/blocks/Modal.js +++ b/src/components/blocks/Modal.js @@ -2,6 +2,7 @@ import React, { useEffect, useContext } from 'react'; import { ModalDispatchContext } from '../../contexts/ModalContext'; import styled from 'styled-components/macro'; import Button from '../elements/Button'; +import Loader from '../blocks/Loader'; const Overlay = styled.div` position: fixed; @@ -30,6 +31,22 @@ const ModalContainer = styled.div` } `; +const ContentContainer = styled.div` + position: relative; +`; + +const LoaderContainer = styled.div` + position: absolute; + top: 0; + left: -1.5rem; + height: 100%; + width: calc(100% + 3rem); + background: #FFF; + display: flex; + justify-content: center; + align-items: center; +`; + const ButtonContainer = styled.div` display: flex; justify-content: flex-end; @@ -76,15 +93,26 @@ const Modal = props => { e.stopPropagation()}>

{props.title}

- {props.content} - - - - + + {props.content} + + + + + {props.loader && ( + + + + )} +
); diff --git a/src/components/blocks/TableContent.js b/src/components/blocks/TableContent.js index 68f6b5d..0a2ee71 100644 --- a/src/components/blocks/TableContent.js +++ b/src/components/blocks/TableContent.js @@ -161,33 +161,32 @@ const TableContent = props => { {contentToDelete && (contentToDelete.name || contentToDelete.number) && ( - :
- - - {props.formatContentToDelete(contentToDelete).map((d, i) => ( - - - - - ))} - -
{d.name} - {typeof d.content === 'string' - ? d.content - :
    - {d.content.map((c, i) => ( -
  • {c}
  • - ))} -
- } -
- {errorMessage && ( - - )} -
+
+ + + {props.formatContentToDelete(contentToDelete).map((d, i) => ( + + + + + ))} + +
{d.name} + {typeof d.content === 'string' + ? d.content + :
    + {d.content.map((c, i) => ( +
  • {c}
  • + ))} +
+ } +
+ {errorMessage && ( + + )} +
} handleCancel={() => { setContentToDelete({}); diff --git a/src/components/elements/Button.js b/src/components/elements/Button.js index fd6c172..ee79cda 100644 --- a/src/components/elements/Button.js +++ b/src/components/elements/Button.js @@ -260,7 +260,7 @@ const Button = (props, ref) => { {props.children}