Skip to content

Instantly share code, notes, and snippets.

@mrcthms
Created April 17, 2019 11:43
Show Gist options
  • Save mrcthms/6b75c5e3a05790d9ed02df90667385d8 to your computer and use it in GitHub Desktop.
Save mrcthms/6b75c5e3a05790d9ed02df90667385d8 to your computer and use it in GitHub Desktop.
Local panel component
import React from 'react'
import { Root } from './styles'
export default ({ withPadding, children, ...props }) => (
<Root {...props} withPadding={withPadding}>{children}</Root>
)
import styled from 'react-emotion'
export const Root = styled.div`
${({ theme, withPadding }) => `
border-radius: ${theme.radii.rounded};
padding: ${withPadding ? theme.spacing.l : 0};
// Change this to whichever color you need!
background: ${theme.palette.structure.white};
box-shadow: ${theme.elevations.low};
`};
`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment