-
Notifications
You must be signed in to change notification settings - Fork 353
feat: show delivery status and read status on the message and channel preview #3258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
SDK Size
|
| import 'react-native-gesture-handler'; | ||
| import { AppRegistry } from 'react-native'; | ||
| import { enableScreens } from 'react-native-screens'; | ||
| import './src/utils/bootstrapBackgroundMessageHandler'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this before RNGH and all of the other imports please, it's important that the very first thing encountered whenever App.tsx is hit is the bootstrapping
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
| <plist version="1.0"> | ||
| <dict> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert these changes when you can, they do not seem correct
| const areEqual = (prevProps: MessagePropsWithContext, nextProps: MessagePropsWithContext) => { | ||
| const { | ||
| chatContext: { mutedUsers: prevMutedUsers }, | ||
| deliveredBy: prevDeliveredBy, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be deliveredTo or deliveredToCount or something similar ?
|
|
||
| export const MessageStatus = (props: MessageStatusProps) => { | ||
| const { message, readBy, threadList } = useMessageContext(); | ||
| const { channel } = useChannelContext(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're only really using the channel to see if the members length is greater than 2, perhaps we could precalculate this elsewhere and just pass it to be used as an atomic value ? That way we won't have to worry about unstable references changing (nor probably need to run useChannelContext() like this downstream (which will trigger many changes). Having it here pre-memoization is definitely an improvement but we can still move it outside since we were anyway never passing it as a prop so it isn't breaking either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from the couple of comments I don't have any other concrete objections ! We have to refactor the ChannelPreview at some point, it feels like it's slowly getting out of hand and it could use some love.
Please profile the PR on both platforms to make sure we aren't degrading performance further (it doesn't look like it at first glance, but let's be sure of it)
No description provided.