Page MenuHomePhabricator

[landing] populated investor page with investor data
ClosedPublic

Authored by ginsu on Oct 19 2022, 11:20 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 28 2024, 10:13 AM
Unknown Object (File)
Mar 28 2024, 10:05 AM
Unknown Object (File)
Mar 28 2024, 10:05 AM
Unknown Object (File)
Mar 28 2024, 10:05 AM
Unknown Object (File)
Mar 28 2024, 10:05 AM
Unknown Object (File)
Mar 28 2024, 10:04 AM
Unknown Object (File)
Mar 28 2024, 9:59 AM
Unknown Object (File)
Mar 27 2024, 1:17 PM

Details

Summary

last diff in the stack! let's gooo! populated the data from investor-data.js mapped the data into it's own investor profile card. When an investor profile card is clicked, the id of the investor is passed to the InvestorProfileModal as a prop then the InvestorProfileModal finds the investor in the data and displays it in the modal


Linear Task: ENG-1953
Figma: Investor Page

Depends on D5389 and D5391

Test Plan

Please watch the demo video to see how the investor page looks/performs:

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ginsu edited the test plan for this revision. (Show Details)
atul requested changes to this revision.Oct 19 2022, 11:42 AM

Let's create an object using lodash keyBy (https://lodash.com/docs/#keyBy) and index into that instead of iterating over the entire investors array every time an <InvestorProfile> is clicked on

landing/investor-profile-modal.react.js
21–23 ↗(On Diff #17662)

It's not ideal that we're iterating over every element to find one with matching id (O(n)) every time the user clicks on an investor.

What we can do instead is export an object (maybe called keyedInvestorData) from ./investorData created with the lodash keyBy utility: https://lodash.com/docs/#keyBy. Then we'll be able to index into that object in constant time (O(1)).

Let me know if you need help with this, but should be pretty simple change.

landing/investors.react.js
28 ↗(On Diff #17662)

We can use React.useCallback()

This revision now requires changes to proceed.Oct 19 2022, 11:42 AM
ginsu edited the summary of this revision. (Show Details)

addressed atul's comments

atul accepted this revision.EditedOct 19 2022, 1:45 PM
atul added a reviewer: ashoat.

Looks good, let's early exit where I left a comment and it should be ready to go.

Adding @ashoat as blocking reviewer since it's public facing change

landing/investor-profile-modal.react.js
21–33 ↗(On Diff #17667)

address atul's exit early feedback

Video looks great!!

last diff in the stack!

We're thinking of adding Twitter / LinkedIn links in a follow-up diff, yeah?

This revision is now accepted and ready to land.Oct 20 2022, 5:13 AM

We're thinking of adding Twitter / LinkedIn links in a follow-up diff, yeah?

Yeah, I wrote that in the description before we talked about the Twitter/LinkedIn links, but I just designed and submitted a potential design for the Investor Profile cards with those icons on linear