cometchat / cometchat-uikit-react-native

Ready-to-use Chat UI Components for React Native
https://www.cometchat.com
Other
40 stars 24 forks source link

Issue 45, 49 and other related issues #50

Closed rigAITe closed 5 months ago

rigAITe commented 1 year ago

I was able to fix some little and time-related issues we noticed after the integration of React Native UI kit and an open issue on github regarding multiline in chat in the CometChatMessageComposer component. Most especially in Chat and ConversationListItem which are all related to displaying 'AM' instead of 'PM' and 'PM' instead of 'AM'. 

  1. They are stated below; 'AM' instead of 'PM' in CometChatConversationListItem component: the solution was to comment out from Line 191 - 209 since the timestamp variable returns the exact time in 'AM' and 'PM' if it's not yesterday or any other day. Check 'AM' and 'PM' attachment for confirmation of accurate time being displayed.

  2.  In the chat section under CometChatReadReceipt component immediately its past (13:00) which is 'PM', the time changes to 'AM' but if its 12:45 for example its 'PM'.  After reading the logic that led to the returned timestamp value, I had to comment out from Line 69 -90 since the timestamp variable returns the exact time in 'AM' and 'PM' if it's not yesterday or any other day. Check 'AM' and 'PM' attachment for confirmation of accurate time being displayed.

  3. I also fixed an open github issue (#45) regarding multiline and set a minHeight and maxHeight for better experience in the CometChatComposer component. Check Multiline attachment for before and after confirmation

  4. I was also able to fix the shadow properties stylings in iOS since elevation was already set in android in CometChatMessageHeader so as to make sure both android and iOS are similar. Check CometChatMessageHeader attachment for before and after confirmation

  5. Fixed marginBottom styling for message composer on android. It looks absurd on users' mobile and to make it similar with iOS which looks great. Check CometChatComposerMarginBottom attachment for before and after confirmation. 

AM and PM.zip CometChatComposeMarginBottom.zip CometChatMessageHeader.zip Multiline.zip