Remove console noise from Toggle component

This commit is contained in:
Kurt Hutten
2021-10-12 20:38:16 +11:00
parent ea2671baa1
commit b88a7b2262

View File

@@ -1,7 +1,7 @@
const Toggle = ({ offLabel = 'off', onLabel = 'on', checked, onChange }) => { const Toggle = ({ offLabel = 'off', onLabel = 'on', checked, onChange }) => {
return ( return (
<div className="flex items-center text-sm cursor-pointer font-light"> <div className="flex items-center text-sm cursor-pointer font-light">
<span className={!checked && 'text-ch-gray-500'}>{offLabel}</span> <span className={`${!checked && 'text-ch-gray-500'}`}>{offLabel}</span>
<div <div
className={ className={
'mx-2 w-7 h-4 p-1 rounded-full border border-ch-gray-300 relative ' + 'mx-2 w-7 h-4 p-1 rounded-full border border-ch-gray-300 relative ' +
@@ -19,7 +19,7 @@ const Toggle = ({ offLabel = 'off', onLabel = 'on', checked, onChange }) => {
}} }}
></div> ></div>
</div> </div>
<span className={checked && 'text-ch-gray-500'}>{onLabel}</span> <span className={`${checked && 'text-ch-gray-500'}`}>{onLabel}</span>
<input <input
className="sr-only" className="sr-only"
type="checkbox" type="checkbox"