Page MenuHomePhabricator

[native] Use getMessagePreview in native MessagePreview
ClosedPublic

Authored by ashoat on Jan 23 2023, 2:55 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 8, 2:59 AM
Unknown Object (File)
Fri, Nov 8, 2:59 AM
Unknown Object (File)
Fri, Nov 8, 2:59 AM
Unknown Object (File)
Fri, Nov 8, 2:59 AM
Unknown Object (File)
Thu, Oct 31, 3:51 PM
Unknown Object (File)
Thu, Oct 24, 2:31 AM
Unknown Object (File)
Tue, Oct 22, 3:18 AM
Unknown Object (File)
Tue, Oct 22, 3:18 AM
Subscribers
None

Details

Summary

After D6357 updated getMessagePreview to return a style for each portion, we can update native to use that function to unify codepaths with web.

This should be a no-op. Compare to web's version of MessagePreview in D6358 – very similar code.

Depends on D6359

Test Plan
beforeafter
Screenshot 2023-01-23 at 5.47.44 PM.png (2×1 px, 936 KB)
Screenshot 2023-01-23 at 5.47.29 PM.png (2×1 px, 936 KB)

(should be identical)

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ashoat edited the summary of this revision. (Show Details)
ashoat edited the summary of this revision. (Show Details)
atul added inline comments.
native/chat/message-preview.react.js
50–55 ↗(On Diff #21237)

Could probably do

const usernameStyle =
  username.style === 'unread' ? styles.unread : styles.secondary;

?

This revision is now accepted and ready to land.Jan 24 2023, 11:26 AM
native/chat/message-preview.react.js
50–55 ↗(On Diff #21237)

I want to keep the invariant so people don't accidentally use something that's unsupported