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

Missions🥼 #29

Merged
merged 5 commits into from
Oct 5, 2023
Merged

Missions🥼 #29

merged 5 commits into from
Oct 5, 2023

Conversation

evansnyamekye
Copy link
Collaborator

  • Missions that the user has joined already should show a badge "Active Member" instead of the default "NOT A MEMBER" and a button "Leave Mission" instead of the "Join Mission" button (as per design).

  • When a user clicks the "Join Mission" button, an action needs to be dispatched to update the store. You need to get the ID of the selected mission and update the state. Remember you mustn't mutate the state. Instead, you need to return a new state object with all missions, but the selected mission will have an extra key reserved with its value set to true. You could use a JS filter() or map() to set the value of the new state - i.e.:

  • Regardless of which method you choose, make sure you place all your logic in the reducer. In the React view file, you should only dispatch the action with the correct rocket ID as an argument.

  • Follow the same logic as with the "Join mission" - but you need to set the reserved key to false.

  • Dispatch these actions upon clicking on the corresponding buttons

@nilab-khwaja nilab-khwaja merged commit c4d4cda into dev Oct 5, 2023
1 of 3 checks passed
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.

2 participants