You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 15, 2020. It is now read-only.
Warren edited this page Apr 27, 2019
·
3 revisions
State Variables
winners: In this component, we store the result of querying /api/winners in the winners JSON. We set the state in the componentDidMount function. The JSON maps each category to a list of projects sorted by their respective scores.
dropdownButtons: We store the list of dropdown buttons for each collapsible in this array. Each dropdown button initially points up and upon clicking the collapsible, we point the button upwards by changing this state variable.
Functions
flipButtonUp(i): This callback function is passed down to the child component WinnerCollapsible. we take the ith button in our list of dropDownButtons and flip its orientation pointing up, resetting the state variable dropdownButtons.
flipButtonDown(i): This callback function is passed down to the child component WinnerCollapsible. we take the ith button in our list of dropDownButtons and flip its orientation pointing down, resetting the state variable dropdownButtons.
getWinners: This function queries the api at the endpoint of /api/winners