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

[feat] Create my plants and all plants tabs #13

Merged
merged 22 commits into from
Oct 26, 2024

Conversation

SashankBalusu
Copy link
Contributor

What's new in this PR 🧑‍🌾

Description

  • created the functionality so you can view user plants as well as all plants
  • pulls from db based on user id to view user plants, displays add plants button if nothing is there
  • pulls from db to view all plants

Screenshots

How to review

  • can test through view-plants directory

Next steps

  • need to style will add in next commit

Relevant links

Online sources

Related PRs

CC: @ccatherinetan

Copy link
Collaborator

@ccatherinetan ccatherinetan left a comment

Choose a reason for hiding this comment

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

looking great so far, thanks for the great work! a couple things

  1. the current get_plant_by_id query doesn't seem to be working; i left some code for a new query if you want to use that
  2. we can use ternary statements to simplify the logic (see comments)
  3. if you have time: try to use styled components instead of css (this might be something you want to do on the previous PlantCard sprint)

kylezryr and others added 2 commits October 21, 2024 14:56
Co-authored-by: Catherine Tan <[email protected]>
Co-authored-by: rachaelch3n <[email protected]>
Co-authored-by: Catherine Tan <[email protected]>
@ccatherinetan ccatherinetan linked an issue Oct 22, 2024 that may be closed by this pull request
Copy link
Collaborator

@ccatherinetan ccatherinetan left a comment

Choose a reason for hiding this comment

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

looking great, sashank! to summarize the most important points:

  1. rebase for the updated getAllPlants and getPlantById queries
  2. add extra filter in the supabase query to ensure that we're not fetching plants that are alr harvested (check that date_harvested is not null)
  3. check that the fetchUserPlants function works correctly
  4. we might consider creating separate components that takes in the seeMyPlants to simplify the toggling logic between the two (let's discuss in worksesh!)

app/view-plants/page.tsx Outdated Show resolved Hide resolved
@ccatherinetan ccatherinetan merged commit 93821bc into main Oct 26, 2024
2 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.

Create My Plants and All Plants Tabs
5 participants