chore: add code formatting and linting (#952)

This commit is contained in:
Caleb
2018-08-07 14:46:54 -06:00
committed by Shawn Erquhart
parent 32e0a9b2b5
commit f801b19221
265 changed files with 5988 additions and 4481 deletions

View File

@ -1,4 +1,4 @@
import React from 'react'
import React from 'react';
import styled, { css } from 'react-emotion';
import ReactToggled from 'react-toggled';
import { colors, colorsRaw, shadows, transitions } from './styles';
@ -11,7 +11,7 @@ const ToggleContainer = styled.span`
width: 40px;
height: 20px;
cursor: pointer;
`
`;
const ToggleHandle = styled.span`
${shadows.dropDeep};
@ -24,17 +24,19 @@ const ToggleHandle = styled.span`
background-color: ${colorsRaw.white};
transition: transform ${transitions.main};
${props => props.isActive && css`
transform: translateX(20px);
`}
`
${props =>
props.isActive &&
css`
transform: translateX(20px);
`};
`;
const ToggleBackground = styled.span`
width: 34px;
height: 14px;
border-radius: 10px;
background-color: ${colors.active};
`
`;
const Toggle = ({
active,
@ -47,7 +49,7 @@ const Toggle = ({
Handle = ToggleHandle,
}) => (
<ReactToggled on={active} onToggle={onChange}>
{({on, getElementTogglerProps}) => (
{({ on, getElementTogglerProps }) => (
<Container
role="switch"
aria-checked={on.toString()}
@ -56,8 +58,8 @@ const Toggle = ({
className={className}
{...getElementTogglerProps()}
>
<Background isActive={on}/>
<Handle isActive={on}/>
<Background isActive={on} />
<Handle isActive={on} />
</Container>
)}
</ReactToggled>