Page MenuHomePhabricator

[native] Extract community drawer button for nux tips, create community drawer tip
ClosedPublic

Authored by inka on Aug 14 2024, 5:43 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Dec 20, 11:26 AM
Unknown Object (File)
Fri, Dec 20, 6:53 AM
Unknown Object (File)
Fri, Dec 20, 6:18 AM
Unknown Object (File)
Fri, Dec 20, 6:15 AM
Unknown Object (File)
Fri, Dec 20, 6:05 AM
Unknown Object (File)
Fri, Dec 20, 5:54 AM
Unknown Object (File)
Fri, Dec 20, 12:19 AM
Unknown Object (File)
Mon, Dec 16, 3:21 AM
Subscribers

Details

Summary

issue: ENG-8542
We need to be able to display the button without it navigating to the drawer and without the effect being run

Test Plan

Tested that the community drawer button looks like it used to. Tested with later diffs that the tip works correctly

Diff Detail

Repository
rCOMM Comm
Branch
inka/nux
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

inka retitled this revision from [native] Extract community drawer button for nux tips to [native] Extract community drawer button for nux tips, create community drawer tip.Aug 14 2024, 5:46 AM
inka edited the test plan for this revision. (Show Details)
inka requested review of this revision.Aug 14 2024, 6:13 AM
tomek added inline comments.
native/navigation/community-drawer-button-base.react.js
9 ↗(On Diff #43384)

Why do we need to have the props present and ignored?

9 ↗(On Diff #43384)

How about renaming it?

This revision is now accepted and ready to land.Aug 14 2024, 9:34 AM

Adding @ashoat as blocking because of the copy.

This revision now requires review to proceed.Aug 14 2024, 9:37 AM

Rename

native/navigation/community-drawer-button-base.react.js
9 ↗(On Diff #43384)

Why do we need to have the props present and ignored?

Because ButtonComponent is typed as React.ComponentType<NUXTipsOverlayProps<Route>>,
typing it as ButtonComponent: React.ComponentType<void | NUXTipsOverlayProps<Route>>, doesn't help with the error

Cannot call createNUXTipsOverlay with CommunityDrawerButtonIcon bound to ButtonComponent because property route is
missing in function type [1] but exists in props [2]. [prop-missing]

     navigation/community-drawer-tip.react.js
      15│
      16│ const CommunityDrawerTip: React.ComponentType<
      17│   NUXTipsOverlayProps<'CommunityDrawerTip'>,
      18│ > = createNUXTipsOverlay(CommunityDrawerButtonIcon, communityDrawerText);
      19│
      20│ export default CommunityDrawerTip;
      21│

     navigation/community-drawer-button-icon.react.js
 [1]   8│ export default function CommunityDrawerButtonIcon(): React.Node {

     tooltip/nux-tips-overlay.react.js
 [2] 124│   ButtonComponent: React.ComponentType<void | NUXTipsOverlayProps<Route>>,
native/navigation/community-drawer-button-base.react.js
9 ↗(On Diff #43384)

Makes sense! How about having an exact type with route and navigation?

native/navigation/community-drawer-button-base.react.js
9 ↗(On Diff #43384)

Then I would have to pass them creating more useless code, and the eslint-disable-next-line would still have to be here. What for?

native/navigation/community-drawer-button-base.react.js
9 ↗(On Diff #43384)

Ok, let's keep the current approach.

Let's make sure to always use proper apostrophes in copy instead of single quotes

native/navigation/community-drawer-tip.react.js
14 ↗(On Diff #43473)

Can we use a proper apostrophe character instead of a single quote here?

I mean this character: ’

Rather than this character: '

This revision is now accepted and ready to land.Aug 20 2024, 1:07 PM