Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sea Turtles - Adriana Gutierrez, Esther Annorzie, Joanna Dudley, & Lili Parra #29

Open
wants to merge 90 commits into
base: main
Choose a base branch
from

Conversation

jfdudley
Copy link

No description provided.

jfdudley and others added 30 commits June 27, 2022 14:27
… state into Board and BoardDropdown for processing - hopefully it works
…tries to run without the patch response data
lili4x4 and others added 29 commits July 21, 2022 11:27
… to named function to clean up return value of Board.js, reordered a couple things in App to make more sense
Copy link

@kelsey-steven-ada kelsey-steven-ada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last 🎉 Project 🎊 DONE!!! 🥳

Great work y'all! Feedback is going to be pretty light on this project, but I've left a few comments and suggestions around things you may want to take forward 😊.

Comment on lines +196 to +207
displayBoard = filterBoardsBySeason(boards, "Summer");
chooseBoard(displayBoard);
break;
case 8:
case 9:
case 10:
displayBoard = filterBoardsBySeason(boards, "Fall");
chooseBoard(displayBoard);
break;
default:
chooseBoard(blankBoard);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To reduce repeated chooseBoard calls, the switch could handle setting displayBoard for default as well, then we could call chooseBoard once after the switch, something like:

      ...
      case 8:
      case 9:
      case 10:
        displayBoard = filterBoardsBySeason(boards, "Fall");
        break;
      default:
        displayBoard = blankBoard;
    }
    chooseBoard(displayBoard);

title: PropTypes.string,
cards: PropTypes.arrayOf(PropTypes.shape(cardObjectShape)),
}).isRequired,
};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd probably want to include the 3rd prop deleteCardApp here as well.

Comment on lines +102 to +103
themeHeader.setAttribute("id", "summer-header");
themeBody.setAttribute("id", "summer-body");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice use of setting attributes to update the styles!

Comment on lines +10 to +33
const dropdownOptions = boardData.map((board) => {
if (board.title === chosenBoard.title) {
return (
<option
key={board.board_id}
id={board.board_id}
value={JSON.stringify(board)}
selected
>
{board.title}
</option>
);
} else {
return (
<option
key={board.board_id}
id={board.board_id}
value={JSON.stringify(board)}
>
{board.title}
</option>
);
}
});
Copy link

@kelsey-steven-ada kelsey-steven-ada Jul 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use the spread operator to pass a dictionary of values to an element as props. This allows us to reduce duplication when creating an element with a prop we want to set conditionally.

// Set the data that all option elements will have
const optionProps = { 
    key: board.board_id,
    id: board.board_id, 
    value: JSON.stringify(board)
}
    
// Conditionally add `selected` to the optionProps if chosenBoard is found
if (board.title === chosenBoard.title) {
    optionProps["selected"] = true
}
    
// return an option element with the props defined in optionProps
return (<option {...optionProps}>{board.title}</option>);

message: PropTypes.string,
};

const boardObjectShape = {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice use of variables to make the propTypes definition cleaner!

};

return (
<div id="all-MainContent">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would consider using main or section as the outer wrapper here. Like in raw HTML, with React we still want to make sure we're using semantic tags wherever possible and fallback to tags without semantic meaning like div when nothing else fits better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants