Page MenuHomePhabricator

[web] Added `react-icons` dependency to `web`
ClosedPublic

Authored by ginsu on Sep 11 2022, 8:39 AM.
Tags
None
Referenced Files
Unknown Object (File)
Nov 11 2024, 2:51 AM
Unknown Object (File)
Nov 2 2024, 1:15 PM
Unknown Object (File)
Nov 2 2024, 1:15 PM
Unknown Object (File)
Nov 2 2024, 1:15 PM
Unknown Object (File)
Nov 2 2024, 1:12 PM
Unknown Object (File)
Oct 14 2024, 5:28 PM
Unknown Object (File)
Oct 14 2024, 4:44 PM
Unknown Object (File)
Oct 14 2024, 4:44 PM

Details

Summary

add react-icons dependency so we can use Ionicons icon pack

Test Plan

N/A

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ginsu added a reviewer: atul.
ginsu attached a referenced file: F166176: image.png. (Show Details)
ginsu requested review of this revision.Sep 11 2022, 8:49 AM
atul retitled this revision from [web] added elpises icon to the left of see more... text to [web] Add ellipsis icon to the left of "see more..." text.Sep 12 2022, 10:28 AM
atul requested changes to this revision.Sep 12 2022, 11:22 AM

Visually looks great!

...but, we should probably use the same icon pack as we are on native for consistency.

web/chat/chat-thread-list-see-more-sidebars.react.js
42 ↗(On Diff #16569)

I think we typically want to use icons from the SWMansion icon pack... but it looks like their ellipsis icons have holes in them?

4bbd98.png (402×776 px, 30 KB)

The icons we use on native do not have holes in them, and I think matching native is more of a priority than sticking to SWMansion icons.

It looks like the icons we're using on native are from the Ionicons pack, which aren't included in web so you're using react-feather instead. In this case I think it's okay since the icon is very simple and web and native look similar side-by-side:

Screen Shot 2022-09-12 at 2.12.49 PM.png (288×1 px, 54 KB)

However, to keep things consistent across web and native it'd be good to use Ionicons on web as well. Based on a quick Google search it looks like react-icons (https://github.com/react-icons/react-icons) might be the easiest/best-supported way to include Ionicons on web.

Could you try including Ionicons via react-icons and see if we can use their ellipsis icon (I believe named ios-more) instead?

I'd personally create a separate diff to add the react-icons dependency so the changes to package.json and yarn.lock don't clutter up this existing diff.


CC @ashoat since I'm proposing including react-icons dependency (https://github.com/react-icons/react-icons)

web/chat/chat-thread-list.css
175 ↗(On Diff #16569)

Setting padding-left to 20px looks like it leads to better alignment:


Before:

Screen Shot 2022-09-12 at 2.08.23 PM.png (288×1 px, 43 KB)

After:

Screen Shot 2022-09-12 at 2.10.39 PM.png (288×1 px, 19 KB)

This revision now requires changes to proceed.Sep 12 2022, 11:22 AM

added react-icons dependency

ginsu retitled this revision from [web] Add ellipsis icon to the left of "see more..." text to [web] Added `react-icons` dependency to `web`.Sep 14 2022, 11:22 PM
ginsu edited the summary of this revision. (Show Details)
ginsu edited the test plan for this revision. (Show Details)
atul added 1 blocking reviewer(s): ashoat.

Looks good, adding @ashoat as blocking because dependency

Reasonable, although an alternate option would've been to move native to use whatever @ginsu was initially using for web here (which would potentially avoid adding a new dependency to web)

Note – if we move forward with react-icons, it's critical that we make sure it doesn't bloat the size of our JS bundle. We should compare JS bundle size before/after the relevant import from react-icons is added

This revision is now accepted and ready to land.Sep 15 2022, 12:39 PM

@ashoat used this import cost tool to calculate the bundle size of react-icons and got a size of 2.2kb (1kb when gZipped). I think this is pretty reasonable in terms of size, but your idea of switching the icons from native to web is also solid. Let me know what you think, and I'll go in the direction you think is best

{F171155}

That's totally reasonable!! Okay either way, do whatever you prefer / is easier