mercredi 28 juillet 2021

How to add my isLoading constant to this conditional statement?

I added this constant

    const isLoading = !templates;

In order to Change the color of my button and prevent a click if my cards are still loading.

However, I dont know how to add my isLoading constant to this conditional statement.

<MenuButton
    className={
    !firstTimeOnOnboarding || selectedTemplatesIds.length >= minNumOfOptions
    ? `${styles.actionBlue}`: `${styles.actionNormal}`}>
    {buttonText}
</MenuButton>

I tried doing this but it doesnt work.

className={
!isLoading && !firstTimeOnOnboarding || selectedTemplatesIds.length >= minNumOfOptions ? `${styles.actionBlue}`: `${styles.actionNormal}`}

Aucun commentaire:

Enregistrer un commentaire