2021-06-02 11:50:34 +00:00
|
|
|
import * as Checkbox from '@radix-ui/react-checkbox'
|
|
|
|
import { CheckIcon } from '@radix-ui/react-icons'
|
2021-06-21 21:35:28 +00:00
|
|
|
import { strokes } from 'state/shape-styles'
|
2021-06-02 11:50:34 +00:00
|
|
|
import { Square } from 'react-feather'
|
2021-06-03 12:06:39 +00:00
|
|
|
import { IconWrapper, RowButton } from '../shared'
|
2021-06-02 11:50:34 +00:00
|
|
|
|
|
|
|
interface Props {
|
|
|
|
isFilled: boolean
|
2021-06-16 12:09:45 +00:00
|
|
|
onChange: (isFilled: boolean | string) => void
|
2021-06-02 11:50:34 +00:00
|
|
|
}
|
|
|
|
|
2021-06-21 21:35:28 +00:00
|
|
|
export default function IsFilledPicker({
|
|
|
|
isFilled,
|
|
|
|
onChange,
|
|
|
|
}: Props): JSX.Element {
|
2021-06-02 11:50:34 +00:00
|
|
|
return (
|
|
|
|
<Checkbox.Root
|
|
|
|
as={RowButton}
|
2021-06-03 16:13:23 +00:00
|
|
|
bp={{ '@initial': 'mobile', '@sm': 'small' }}
|
2021-06-02 11:50:34 +00:00
|
|
|
checked={isFilled}
|
2021-06-16 12:09:45 +00:00
|
|
|
onCheckedChange={onChange}
|
2021-06-02 11:50:34 +00:00
|
|
|
>
|
|
|
|
<label htmlFor="fill">Fill</label>
|
|
|
|
<IconWrapper>
|
|
|
|
{isFilled || <Square stroke={strokes.Black} />}
|
|
|
|
<Checkbox.Indicator as={CheckIcon} />
|
|
|
|
</IconWrapper>
|
|
|
|
</Checkbox.Root>
|
|
|
|
)
|
|
|
|
}
|