ucsb-cs156-f23 / proj-happycows-f23-5pm-1

https://ucsb-cs156-f23.github.io/proj-happycows-f23-5pm-1/
0 stars 0 forks source link

Draft PR: Jonathan better profits display #23

Closed pingyujc closed 10 months ago

pingyujc commented 10 months ago

Overview

In this PR, I updated the profit display so that it now shows 5 profits only. Users also have the option of checking other profits by clicking next and previous buttons. How I implmented it was that I merged Profits.js and ProfitsTable.js simply into one file: Profits.js

Before, it requires us to pass in a profits parameter manually. Now, no parameters are needed, we call the API and backend directly.

Screenshots

Before making the change:

image

After the implementation:

image

https://github.com/ucsb-cs156-f23/proj-happycows-f23-5pm-1/assets/75823989/2a97b564-252c-485e-a31b-150d9090c78d

Feedback Request (Optional)

I talked to a TA and we agreed that merging profits and profits table into one file might be a good practice since it will be easier to maintain. However, I am still facing a lot of issues in the test file becuase I now need to change all the instances of how I called the Profits component. I am not sure if the way I am doing it is a suitable way for this issue.

Future Possibilities (Optional)

Some possible points could be:

Validation (Optional)

  1. Download this branch.
  2. Run the project.
  3. Go to this page.
  4. Test this function.

Tests

Linked Issues