Page MenuHomePhabricator

[landing] add size prop to logo components
ClosedPublic

Authored by ginsu on May 23 2023, 7:06 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 29, 7:07 AM
Unknown Object (File)
Sun, Nov 17, 2:19 AM
Unknown Object (File)
Sun, Nov 17, 1:36 AM
Unknown Object (File)
Sun, Nov 17, 1:36 AM
Unknown Object (File)
Sun, Nov 17, 1:36 AM
Unknown Object (File)
Sun, Nov 17, 1:36 AM
Unknown Object (File)
Sun, Nov 17, 1:36 AM
Unknown Object (File)
Sat, Nov 16, 11:27 PM
Subscribers

Details

Summary

In the figma designs we have different sizes for the competitor logos. For example in feature cards the logos are 30x30px but in the comparison selector component the logos are 50x50px. To make the size of the logos dynamic I added an optional size prop to each component. If the size field is not passed then we will default the size of the logo to 50x50 (the original size from Figma)

Depends on D7943

Test Plan

Please see the screenshots to see that I was able to change the sizes of the logos

Screenshot 2023-05-23 at 4.16.34 PM.png (2×3 px, 700 KB)

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

ginsu requested review of this revision.May 23 2023, 7:24 AM

Can we change || to ?? before landing

landing/assets/comm-logo.react.js
9–15 ↗(On Diff #26887)

Because 0 is falsey, if someone passed in size={0}, this would actually display the equivalent of size={50}. Could we instead do size ?? 50?

746a2c.png (602×786 px, 71 KB)

In practice I really doubt it matters since I don't imagine anyone passing in size={0}, but just for correctness I guess.

This revision is now accepted and ready to land.May 24 2023, 9:29 AM

rebase with updated comm logo

This revision was automatically updated to reflect the committed changes.