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 22, 2:49 AM
Unknown Object (File)
Fri, Nov 22, 2:49 AM
Unknown Object (File)
Fri, Nov 22, 2:49 AM
Unknown Object (File)
Fri, Nov 22, 2:47 AM
Unknown Object (File)
Nov 15 2024, 6:50 PM
Unknown Object (File)
Nov 15 2024, 6:35 PM
Unknown Object (File)
Nov 15 2024, 4:33 PM
Unknown Object (File)
Nov 8 2024, 2:59 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