// @flow import React from 'react'; import styled from 'styled-components'; import { zIndex } from 'src/components/globals'; import { MEDIA_BREAK } from 'src/components/layout'; /* eslint no-eval: 0 */ export const InlineSvg = styled.svg` position: absolute; top: auto; right: 0; bottom: 0; left: 0; width: 100%; color: inherit; fill: currentColor; pointer-events: none; > g { position: absolute; bottom: 0; left: 0; right: 0; top: auto; } `; export const SvgWrapper = styled.div` position: absolute; flex: none; z-index: ${zIndex.base}; height: 80px; width: 110%; bottom: -4px; left: -5%; right: -5%; display: ${props => (props.goop === 0 ? 'none' : 'inline-block')}; color: ${props => eval(`props.theme.${props.color}`)}; pointer-events: none; @media (max-width: ${MEDIA_BREAK}px) { width: 150%; left: -25%; right: -25%; } `; type Props = { color: string, goop: number, goopHeight: number, }; class Goop extends React.Component { returnGoop() { switch (this.props.goop) { default: case 0: return null; case 1: return ( ); case 2: return ( ); case 3: return ( ); case 4: return ( ); case 5: return ( ); case 6: return ( ); case 7: return ( ); } } render() { const { color = 'bg.default', goopHeight, goop } = this.props; return ( goop {this.returnGoop()} ); } } export default Goop;