chingu-voyages / v43-tier2-team-21

Skill Tracker | Voyage-43 | https://chingu.io/ | Twitter: https://twitter.com/ChinguCollabs
https://skill-tracker-b900e.firebaseapp.com/landingpage
1 stars 0 forks source link

Skill card edit button #54

Open MattRueter opened 1 year ago

MattRueter commented 1 year ago
MattRueter commented 1 year ago

@Melton-Paul @tylerthietje @Pavubrar

Working on the first of the two tasks related to this. (open SkillForm in 'edit' mode with prepopulatedData). I'm having a tricky time passing props into the SkillForm. It is being called from a Link component in SkillCard. As a work around I've used the useLocation() hook from 'react-router-dom' library and that works for getting the given skill's data into the component. However it meant adding a bit of confusing (and possibly buggy code...see my code for example ! ) which then assigns this to the prepopulatedData variable which seems a bit hacky and odd. Any ideas on how to better handle this?

*I'm referring to branch: _fetch-userdata files: src/components/SkillCard and src/components/SkillForm

MattRueter commented 1 year ago

@Pavubrar I'll probably re-configure the UserContext (and therefore the skills object this edit button makes use of). But will send a message around (on Discord) once I've done that. My goal is to have that done by Tuesday April, 11th (13:00).

When that is ready the < on submit> logic for this form when in will need to update state and update the DB on firebase. The relevant files are components/SkillForm.js & store/UserContext.js