Skip to content

Commit

Permalink
refactor: improve readability
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackGlory committed Dec 31, 2023
1 parent 9c22eeb commit f35a7e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/options.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ export function Options() {
/>
<Switch
value={rule.enabled}
onClick={value => updateConfig(config => {
onChange={value => updateConfig(config => {
config.rules![i].enabled = value
})}
/>
Expand Down
6 changes: 3 additions & 3 deletions src/components/switch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import classNames from 'classnames'

interface ISwitchProps {
value: boolean
onClick: (value: boolean) => void
onChange: (value: boolean) => void
}

export function Switch({ value, onClick }: ISwitchProps) {
export function Switch({ value, onChange }: ISwitchProps) {
return (
<HeadlessSwitch
checked={value}
onChange={onClick}
onChange={onChange}
className={classNames(
'inline-flex h-6 w-11 items-center rounded-full'
, value ? 'bg-gray-700' : 'bg-gray-300'
Expand Down

0 comments on commit f35a7e0

Please sign in to comment.