Set bg color for toggle only when checked

This commit is contained in:
navaneeth 2021-08-30 22:19:12 +05:30
parent a98eda9f95
commit 347403edbd

View file

@ -16,7 +16,7 @@ export const Toggle = ({readOnly, value, onChange, activeColor, options }) => {
className="form-check-input"
type="checkbox"
checked={on}
style={{ backgroundColor: activeColor}}
style={ on ? { backgroundColor: activeColor} : {}}
onClick={() => {if(!readOnly) toggle()}}
/>
</label>