fix: "Add to Twenty" button render fix (chrome-extension) (#5048)

fix - #5047
This commit is contained in:
Aditya Pimpalkar
2024-04-19 17:13:53 +01:00
committed by GitHub
parent d145684966
commit 14f97e2e80
13 changed files with 318 additions and 308 deletions

View File

@ -2,6 +2,8 @@ import { useEffect, useState } from 'react';
import styled from '@emotion/styled';
import { motion } from 'framer-motion';
import { isDefined } from '~/utils/isDefined';
export type ToggleSize = 'small' | 'medium';
type ContainerProps = {
@ -54,7 +56,7 @@ export const Toggle = ({
const handleChange = () => {
setIsOn(!isOn);
if (onChange) {
if (isDefined(onChange)) {
onChange(!isOn);
}
};