Skip to content
This repository has been archived by the owner on Dec 6, 2022. It is now read-only.

Commit

Permalink
add checkbox type to input
Browse files Browse the repository at this point in the history
  • Loading branch information
SiAdcock committed Oct 8, 2020
1 parent f547911 commit e504db4
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/core/components/checkbox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ const CheckboxGroup = ({
children,
...props
}: CheckboxGroupProps) => {
const legend = label ? <Legend text={label} supporting={supporting} hideLabel={hideLabel} /> : ""
const legend = label ? (
<Legend text={label} supporting={supporting} hideLabel={hideLabel} />
) : (
""
)

const message =
typeof error === "string" ? (
Expand Down Expand Up @@ -155,6 +159,7 @@ const Checkbox = ({
const box = (
<>
<input
type="checkbox"
css={(theme) => [
checkbox(theme.checkbox && theme),
error ? errorCheckbox(theme.checkbox && theme) : "",
Expand Down Expand Up @@ -196,8 +201,8 @@ const Checkbox = ({
<SupportingText>{supporting}</SupportingText>
</div>
) : (
<LabelText>{labelContent}</LabelText>
)}
<LabelText>{labelContent}</LabelText>
)}
</label>
)

Expand All @@ -206,13 +211,12 @@ const Checkbox = ({

const checkboxDefaultProps = {
disabled: false,
type: "checkbox",
indeterminate: false,
error: false,
}

const checkboxGroupDefaultProps = {
hideLabel: false
hideLabel: false,
}

Checkbox.defaultProps = { ...checkboxDefaultProps }
Expand Down

0 comments on commit e504db4

Please sign in to comment.