Skip to content

Commit 3528668

Browse files
committed
style: revert renaming of checked property in Switch component
1 parent e7a4c93 commit 3528668

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

packages/interface-default/src/form.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ const ConsentForm: React.FC<ConsentFormProps> = ({
145145
styles={styles}
146146
key={integration.id}
147147
Switch={Switch}
148-
defaultChecked={formState[integration.id]}
148+
checked={formState[integration.id]}
149149
onChange={cbToggleIntegration}
150150
{...integration}
151151
/>

packages/interface-default/src/integration.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { Styles } from '.'
1010
export interface IntegrationProps extends IntegrationConfigOptions {
1111
styles: Styles
1212
Switch?: React.FC<SwitchProps>
13-
defaultChecked: boolean
13+
checked: boolean
1414
onChange: React.ChangeEventHandler
1515
}
1616

@@ -34,7 +34,7 @@ export const Integration: React.FC<IntegrationProps> = ({
3434
color,
3535
contrastColor,
3636
Icon,
37-
defaultChecked,
37+
checked,
3838
onChange,
3939
}) => (
4040
<>
@@ -43,7 +43,7 @@ export const Integration: React.FC<IntegrationProps> = ({
4343
onChange={onChange}
4444
name={id}
4545
styles={styles}
46-
defaultChecked={defaultChecked}
46+
checked={checked}
4747
>
4848
<h2 className={clsx(styles.integrationFieldCategory)}>
4949
<Trans

packages/interface-default/src/switch.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ import { Styles } from '.'
55
export interface SwitchProps {
66
children: React.ReactNode
77
className: string
8-
defaultChecked: boolean
8+
checked: boolean
99
name: string
1010
styles: Styles
1111
onChange: React.ChangeEventHandler
1212
}
1313

1414
export const Switch: React.FC<SwitchProps> = ({
1515
children,
16-
defaultChecked,
16+
checked,
1717
className,
1818
name,
1919
styles,
@@ -33,20 +33,20 @@ export const Switch: React.FC<SwitchProps> = ({
3333
id={key}
3434
name={name}
3535
type="checkbox"
36-
defaultChecked={defaultChecked}
36+
defaultChecked={checked}
3737
onChange={onChange}
3838
className={styles.switchInput}
3939
/>
4040
<div
4141
className={clsx(
4242
styles.switchSlide,
43-
defaultChecked && styles.switchSlideEnabled
43+
checked && styles.switchSlideEnabled
4444
)}
4545
/>
4646
<div
4747
className={clsx(
4848
styles.switchNodge,
49-
defaultChecked && styles.switchNodgeEnabled
49+
checked && styles.switchNodgeEnabled
5050
)}
5151
/>
5252
</div>

0 commit comments

Comments
 (0)