tupuio / tupuapp

Tupu web application based on Next.js & Xata.io
https://tupu.io
Apache License 2.0
4 stars 3 forks source link

Unify `MentorshipsList` and `MenteesList` into `MentorshipsList` #118

Open lorepirri opened 1 year ago

lorepirri commented 1 year ago

Problem

PR #116 and PR #112 created code duplication

these two are basically the same:

components/MentorshipsList/MentorshipCard.js
components/MentorshipsList/index.js

and

components/MenteesList/MenteeCard.js
components/MenteesList/index.js

Feature Description

just unify them into one

components/MentorshipsList/MentorshipCard.js
components/MentorshipsList/index.js

and render Mentee or Mentor info according to which mode the user is into (mentor or mentee)

the endpoint already support the param mode to be mentee or mentor (see pages/api/mentorships.js).

also address this comment: https://github.com/tupuio/tupuapp/pull/112#discussion_r1111271883 from @maranta1

Describe the feature/solution you'd like. A clear and concise description of what you want to happen.