<img src={star} alt="star" onClick={() => addFavoriteChanel(index)} id={index} className={`star ${favorite <b>=== index</b> ? 'active' : ''}`} />
const [favorite, setFavorite] = useState(0);
const addFavoriteChanel = (index) => {
if(favorite === index) {
setFavorite(0);
} else {
setFavorite(index)
}
}
{ questionnaireSteps.contactUs && (<StepOneForm
statusStepOneForm={(value) => {setQuestionnaireSteps({...questionnaireSteps, contactUs: value}); console.log(value)}}
statusSmsPhone={(value) => setQuestionnaireSteps({...questionnaireSteps, phoneNumberVerification: value})}
phoneNumber={setPhoneNumber}
/>)}
const myFunc = (type, value) => {
console.log(value)
if(type === 'step') setQuestionnaireSteps({...questionnaireSteps, contactUs: value});
if(type === 'sms') (value) => setQuestionnaireSteps({...questionnaireSteps, phoneNumberVerification: value})
};
{ questionnaireSteps.contactUs && (<StepOneForm
statusStepOneForm={value => myFunc('step', value)}
statusSmsPhone={value => myFunc('sms', value)}
phoneNumber={setPhoneNumber}
/>)}
const socket = io("https://server-domain.com");
localhost:3000
<div className={styles.social}>
<div className={`${styles.socItem} fab fa-vk`} onClick={(e) => activeSoc(e, 'vk')}/>
<div className={`${styles.socItem} fab fa-twitter`} onClick={(e) => activeSoc(e)}/>
<div className={`${styles.socItem} fab fa-telegram`} onClick={(e) => activeSoc(e)}/>
<div className={`${styles.socItem} fab fa-facebook`} onClick={(e) => activeSoc(e, 'facebook')}/>
<div className={`${styles.socItem} fab fa-google`} onClick={(e) => activeSoc(e)}/>
<div className={`${styles.socItem} fab fa-yandex`} onClick={(e) => activeSoc(e)}/>
<div className={`${styles.socItem} fas fa-envelope`} onClick={(e) => activeSoc(e)}/>
</div></button>