Skip to content

Commit

Permalink
style: revert renaming of checked property in Switch component
Browse files Browse the repository at this point in the history
  • Loading branch information
axe312ger committed Feb 26, 2024
1 parent e7a4c93 commit 3528668
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/interface-default/src/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ const ConsentForm: React.FC<ConsentFormProps> = ({
styles={styles}
key={integration.id}
Switch={Switch}
defaultChecked={formState[integration.id]}
checked={formState[integration.id]}
onChange={cbToggleIntegration}
{...integration}
/>
Expand Down
6 changes: 3 additions & 3 deletions packages/interface-default/src/integration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Styles } from '.'
export interface IntegrationProps extends IntegrationConfigOptions {
styles: Styles
Switch?: React.FC<SwitchProps>
defaultChecked: boolean
checked: boolean
onChange: React.ChangeEventHandler
}

Expand All @@ -34,7 +34,7 @@ export const Integration: React.FC<IntegrationProps> = ({
color,
contrastColor,
Icon,
defaultChecked,
checked,
onChange,
}) => (
<>
Expand All @@ -43,7 +43,7 @@ export const Integration: React.FC<IntegrationProps> = ({
onChange={onChange}
name={id}
styles={styles}
defaultChecked={defaultChecked}
checked={checked}
>
<h2 className={clsx(styles.integrationFieldCategory)}>
<Trans
Expand Down
10 changes: 5 additions & 5 deletions packages/interface-default/src/switch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import { Styles } from '.'
export interface SwitchProps {
children: React.ReactNode
className: string
defaultChecked: boolean
checked: boolean
name: string
styles: Styles
onChange: React.ChangeEventHandler
}

export const Switch: React.FC<SwitchProps> = ({
children,
defaultChecked,
checked,
className,
name,
styles,
Expand All @@ -33,20 +33,20 @@ export const Switch: React.FC<SwitchProps> = ({
id={key}
name={name}
type="checkbox"
defaultChecked={defaultChecked}
defaultChecked={checked}
onChange={onChange}
className={styles.switchInput}
/>
<div
className={clsx(
styles.switchSlide,
defaultChecked && styles.switchSlideEnabled
checked && styles.switchSlideEnabled
)}
/>
<div
className={clsx(
styles.switchNodge,
defaultChecked && styles.switchNodgeEnabled
checked && styles.switchNodgeEnabled
)}
/>
</div>
Expand Down

0 comments on commit 3528668

Please sign in to comment.