Are you first timer at lazacode.org? Why not join us and start exchange your programming knowledge with everyone. Register today!

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

0 votes
12 views
added Apr 20 in React by lcjr Second Warrant Officer (5,360 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>
  )}

 

Please log in or register to response this reference.

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