All files / components/Modal styled.js

100% Statements 7/7
100% Branches 2/2
100% Functions 2/2
100% Lines 7/7

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51                1x           1x     4x                           1x 4x               1x         1x          
// @flow
/* eslint-disable no-ternary */
 
import styled, { type StyledComponent } from "styled-components"
import type { Theme } from "@bluframe/blublocks"
import colors from "styles/colors"
import { rgba } from "polished"
 
const BACKDROP_ALPHA = 0.2
 
export const Wrapper: StyledComponent<
  {| +$isOpen: boolean |},
  Theme,
  HTMLDivElement
> = styled.div`
  background: ${rgba(colors.black, BACKDROP_ALPHA)};
  display: ${({ $isOpen }: { $isOpen: boolean }) =>
    $isOpen ? "block" : "none"};
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
`
 
export const Container: StyledComponent<
  {||},
  Theme,
  HTMLDivElement
> = styled.div`
  background: ${({ theme }: { theme: Theme }) => theme.palette.text.contrast};
  display: grid;
  margin: 15% auto;
  padding: 10px 10px 50px;
  row-gap: 10px;
  width: 80%;
`
 
export const Top: StyledComponent<{||}, Theme, HTMLDivElement> = styled.div`
  display: grid;
  justify-items: end;
`
 
export const Content: StyledComponent<{||}, Theme, HTMLDivElement> = styled.div`
  align-items: center;
  display: grid;
  justify-items: center;
`