Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. render() {
  2. // Determine the number of cards from the Airtable rows
  3. const count = this.state.cards.length;
  4. // Check to see if cards have loaded from the Airtable API
  5. if (count == 0) {
  6. const placeHolderTitle = <h2 style={titleStyle}>{"Airtable Cards"}</h2>;
  7. const placeHolderContent = (
  8. <p style={paragraphStyle}>{"connecting to the API"}</p>
  9. );
  10. return (
  11. <div style={emptyStyle}>
  12. {placeHolderTitle}
  13. {placeHolderContent}
  14. </div>
  15. );
  16. }
  17. // Check to see if the card number is higher than the number on the Airtable API
  18. if (this.props.number > count) {
  19. const placeHolderTitle = <h2 style={titleStyle}>{"Too many!"}</h2>;
  20. const placeHolderContent = (
  21. <p style={paragraphStyle}>
  22. {"add more to your Airtable or reduce the number"}
  23. </p>
  24. );
  25. return (
  26. <div style={emptyStyle}>
  27. {placeHolderTitle}
  28. {placeHolderContent}
  29. </div>
  30. );
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement