diff --git a/packages/fakeyou.com/src/components/common/Checkbox/Checkbox.scss b/packages/fakeyou.com/src/components/common/Checkbox/Checkbox.scss index a2980e3fbb..39b426b633 100644 --- a/packages/fakeyou.com/src/components/common/Checkbox/Checkbox.scss +++ b/packages/fakeyou.com/src/components/common/Checkbox/Checkbox.scss @@ -1,43 +1,57 @@ @import "scss/colours.scss"; .fy-checkbox-frame { - margin-bottom: .5rem; + margin-bottom: 0.5rem; white-space: nowrap; cursor: pointer; label { - margin-left: .5rem; - cursor: pointer; + margin-left: 0.6rem; + cursor: pointer; } } -.fy-checkbox-primary-unchecked, .fy-checkbox-primary-checked { +.fy-checkbox-primary-unchecked, +.fy-checkbox-primary-checked { .fy-checkbox { background-color: $primary; } - &:hover { + &:hover { .fy-checkbox { background-color: lighten($primary, 5%); } } } -.fy-checkbox-secondary-unchecked, .fy-checkbox-secondary-checked { +.fy-checkbox-secondary-unchecked, +.fy-checkbox-secondary-checked { .fy-checkbox { background-color: $secondary; } - &:hover { + &:hover { .fy-checkbox { background-color: $secondary-light; } } } +.fy-checkbox-secondary-checked { + .fy-checkbox { + background-color: $primary; + } + &:hover { + .fy-checkbox { + background-color: lighten($primary, 5%); + } + } +} + .fy-checkbox { - border-radius: .5rem; + border-radius: 0.35rem; display: inline-block; vertical-align: middle; - height: 2rem; - width: 2rem; + height: 1.5rem; + width: 1.5rem; stroke: white; -} \ No newline at end of file + transition: 0.2s; +} diff --git a/packages/fakeyou.com/src/components/common/Checkbox/Checkbox.tsx b/packages/fakeyou.com/src/components/common/Checkbox/Checkbox.tsx index 7611848b7e..65ab69e22f 100644 --- a/packages/fakeyou.com/src/components/common/Checkbox/Checkbox.tsx +++ b/packages/fakeyou.com/src/components/common/Checkbox/Checkbox.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React from "react"; import { Check } from "components/svg"; import { useId } from "hooks"; import makeClass from "resources/makeClass"; @@ -10,18 +10,45 @@ interface Props { label?: string; name?: string; onChange?: any; - variant?: "primary" | "secondary"; + variant?: "primary" | "secondary"; } -export default function Checkbox({ checked, className = "", label = "", name = "", onChange, variant = "secondary" }: Props) { - const onClick = ({ target }: any) => onChange({ target: { checked: !checked, name, type: 'checkbox' } }); +export default function Checkbox({ + checked, + className = "", + label = "", + name = "", + onChange, + variant = "secondary", +}: Props) { + const onClick = ({ target }: any) => + onChange({ target: { checked: !checked, name, type: "checkbox" } }); const id = "checkbox-" + useId(); - return