React - multiple conditional operator (ternary) - condition over condition

0 votes
158 views
added Apr 20, 2021 in React by lcjr First Warrant Officer (11,830 points)
<div className="d-flex align-items-start flex-column h-100">
  {!isBlue && !isRed && !isGreen ? (
    <h5 className="listing-price">
      {accounting.formatMoney(price, 'RM ', 0)}
      {isFeaturedOrExclusive &&
        (isFeatured ? (
          <span className="featured">{FeaturedText}</span>
        ) : (
          <span className="exclusive">LC Only</span>
        ))}
    </h5>
  ) : (
    <h5 className="listing-price">
      From {accounting.formatMoney(price, 'RM ', 0)}
      {isFeaturedOrExclusive &&
        (isFeatured ? (
          <span className="featured">{FeaturedText}</span>
        ) : (
          <span className="exclusive">LC Only</span>
        ))}
    </h5>
  )}

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...