This commit is contained in:
41666 2021-06-05 16:14:05 -05:00
parent 471ed9cf93
commit be16da1686
9 changed files with 57 additions and 33 deletions

View file

@ -19,7 +19,7 @@ export const ToggleState = styled.div`
export const ToggleSwitch = styled.div<{ state: boolean }>`
display: inline-block;
background-color: ${(props) => (props.state ? palette.green200 : palette.taupe100)};
background-color: ${(props) => (props.state ? palette.green200 : 'rgba(0,0,0,0.45)')};
height: 1.3em;
width: 2.6em;
border-radius: 1.3em;
@ -28,6 +28,7 @@ export const ToggleSwitch = styled.div<{ state: boolean }>`
top: 0.23em;
transition: background-color ${transitions.in2in}s ease-in-out;
cursor: pointer;
margin-right: 0.5em;
${ToggleState} {
${(props) =>

View file

@ -12,9 +12,9 @@ export const Toggle = (props: ToggleProps) => (
props.onChange?.(!props.state);
}}
>
{props.children}{' '}
<ToggleSwitch state={props.state}>
<ToggleState />
</ToggleSwitch>
{props.children}
</div>
);