# All files / src/EmptyState EmptyState.styles.tsx

100% Statements 19/19
95.45% Branches 21/22
100% Functions 3/3
100% Lines 16/16

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
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    764x
    4x
    4x
    4x

    4x
    4x

    4x

    4x

    4x

    4x

    4x

    4x

    21x
    21x

    21x
    21x

     import styled, { css } from 'styled-components'
    import { getTypographyIntent } from '../Typography/Typography.styles'
    import { colors } from '../_styles/colors'
    import { spacing } from '../_styles/spacing'

    const emptyStateWidth = 440
    const emptyStateWidthCompact = 352

    export const StyledSvg = styled.svg`
      width: 200px;
      height: 200px;
    `

    export const StyledImage = styled.div``

    export const StyledTitle = styled.div`
      margin-top: ${spacing.xl}px;
      text-align: center;
      color: ${colors.gray15};
      width: ${emptyStateWidth}px;
      ${getTypographyIntent('h2')}
    `

    export const StyledDescription = styled.div`
      margin-top: ${spacing.lg}px;
      text-align: center;
      color: ${colors.gray45};
      width: ${emptyStateWidth}px;
      ${getTypographyIntent('h3')}
    `

    export const StyledActions = styled.div`
      margin-top: ${spacing.xl}px;
    `

    export const StyledEmptyState = styled.div<{ compact: boolean }>`
      display: flex;
      justify-content: center;
      align-items: center;
      flex-direction: column;
      margin-top: ${({ compact }) => (compact ? 0 : 96)}px;
      margin-bottom: ${({ compact }) => (compact ? 0 : 64)}px;

      ${StyledImage} {
        > img {
          max-width: 200px;
        }
      }

      ${({ compact = false }) =>
        compact &&
        css`
          ${StyledImage} {
            > img {
              max-width: 120px;
            }
          }

          ${StyledSvg} {
            width: 120px;
            height: 120px;
          }

          ${StyledTitle} {
            width: ${emptyStateWidthCompact}px;
            ${getTypographyIntent('h3')}
          }

          ${StyledDescription} {
            width: ${emptyStateWidthCompact}px;
            ${getTypographyIntent('body')}
          }
        `}
    }
    `