Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- render() {
- // Determine the number of cards from the Airtable rows
- const count = this.state.cards.length;
- // Check to see if cards have loaded from the Airtable API
- if (count == 0) {
- const placeHolderTitle = <h2 style={titleStyle}>{"Airtable Cards"}</h2>;
- const placeHolderContent = (
- <p style={paragraphStyle}>{"connecting to the API"}</p>
- );
- return (
- <div style={emptyStyle}>
- {placeHolderTitle}
- {placeHolderContent}
- </div>
- );
- }
- // Check to see if the card number is higher than the number on the Airtable API
- if (this.props.number > count) {
- const placeHolderTitle = <h2 style={titleStyle}>{"Too many!"}</h2>;
- const placeHolderContent = (
- <p style={paragraphStyle}>
- {"add more to your Airtable or reduce the number"}
- </p>
- );
- return (
- <div style={emptyStyle}>
- {placeHolderTitle}
- {placeHolderContent}
- </div>
- );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement