From 581fbd440a0d0d532412f2a86c2b667531276f2b Mon Sep 17 00:00:00 2001 From: OtavioStasiak Date: Wed, 30 Sep 2026 23:32:26 -0300 Subject: [PATCH 1/3] feat: match date separator with web --- app/containers/Separator/MessageSeparator.tsx | 46 ++++++++----------- 1 file changed, 18 insertions(+), 28 deletions(-) diff --git a/app/containers/Separator/MessageSeparator.tsx b/app/containers/Separator/MessageSeparator.tsx index 5a4e1bf519..88661e37aa 100644 --- a/app/containers/Separator/MessageSeparator.tsx +++ b/app/containers/Separator/MessageSeparator.tsx @@ -2,7 +2,6 @@ import { type ReactElement } from 'react'; import { StyleSheet, Text, View } from 'react-native'; import I18n from '~/i18n'; -import { formatLongDate } from '~/lib/dayjs'; import sharedStyles from '~/views/Styles'; import { useTheme } from '~/theme'; import DateSeparator from './DateSeparator'; @@ -10,43 +9,34 @@ import { separatorStyles } from './styles'; const styles = StyleSheet.create({ text: { - fontSize: 14, - ...sharedStyles.textMedium - }, - marginRight: { - marginRight: 14 - }, - marginHorizontal: { - marginHorizontal: 14 + fontSize: 12, + lineHeight: 16, + marginLeft: 8, + ...sharedStyles.textBold } }); -const MessageSeparator = ({ ts, unread }: { ts?: Date | string | null; unread?: boolean }): ReactElement | null => { +const UnreadSeparator = (): ReactElement => { const { colors } = useTheme(); + return ( + + + {I18n.t('unread_messages')} + + ); +}; + +const MessageSeparator = ({ ts, unread }: { ts?: Date | string | null; unread?: boolean }): ReactElement | null => { if (!ts && !unread) { return null; } - const unreadLine = { backgroundColor: colors.buttonBackgroundDangerDefault }; - const unreadText = { color: colors.fontDanger }; - if (ts && unread) { - return ( - - {I18n.t('unread_messages')} - - {formatLongDate(ts)} - - ); - } - if (ts) { - return ; - } return ( - - {I18n.t('unread_messages')} - - + <> + {ts ? : null} + {unread ? : null} + ); }; From 8f89e7b1e64ed148a5935f0f2e30f3fbb95b6a72 Mon Sep 17 00:00:00 2001 From: OtavioStasiak Date: Wed, 30 Sep 2026 23:32:33 -0300 Subject: [PATCH 2/3] test --- .../__snapshots__/Message.test.tsx.snap | 268 ++++++++++++------ 1 file changed, 188 insertions(+), 80 deletions(-) diff --git a/app/containers/message/components/__tests__/__snapshots__/Message.test.tsx.snap b/app/containers/message/components/__tests__/__snapshots__/Message.test.tsx.snap index d61b74ca5d..1c3a3eaebb 100644 --- a/app/containers/message/components/__tests__/__snapshots__/Message.test.tsx.snap +++ b/app/containers/message/components/__tests__/__snapshots__/Message.test.tsx.snap @@ -23090,34 +23090,67 @@ exports[`Story Snapshots: DateAndUnreadSeparators should match snapshot 1`] = ` - + - unread - + + November 10, 2017 + + + + + - November 10, 2017 + unread + unread - - + - unread - + + November 10, 2017 + + + + + - November 10, 2017 + unread + unread - Date: Thu, 1 Oct 2026 19:53:27 -0300 Subject: [PATCH 3/3] match unread separator with web --- app/containers/Separator/MessageSeparator.tsx | 29 ++- .../__snapshots__/Message.test.tsx.snap | 184 +++++++----------- 2 files changed, 92 insertions(+), 121 deletions(-) diff --git a/app/containers/Separator/MessageSeparator.tsx b/app/containers/Separator/MessageSeparator.tsx index 88661e37aa..bd20d746f2 100644 --- a/app/containers/Separator/MessageSeparator.tsx +++ b/app/containers/Separator/MessageSeparator.tsx @@ -4,7 +4,7 @@ import { StyleSheet, Text, View } from 'react-native'; import I18n from '~/i18n'; import sharedStyles from '~/views/Styles'; import { useTheme } from '~/theme'; -import DateSeparator from './DateSeparator'; +import DateSeparator, { DateSeparatorLabel } from './DateSeparator'; import { separatorStyles } from './styles'; const styles = StyleSheet.create({ @@ -13,15 +13,27 @@ const styles = StyleSheet.create({ lineHeight: 16, marginLeft: 8, ...sharedStyles.textBold + }, + dateLabel: { + marginHorizontal: 12 } }); -const UnreadSeparator = (): ReactElement => { +const UnreadSeparator = ({ ts }: { ts?: Date | string | null }): ReactElement => { const { colors } = useTheme(); + const lineStyle = { backgroundColor: colors.strokeError }; return ( - + + {ts ? ( + <> + + + + + + ) : null} {I18n.t('unread_messages')} ); @@ -32,12 +44,11 @@ const MessageSeparator = ({ ts, unread }: { ts?: Date | string | null; unread?: return null; } - return ( - <> - {ts ? : null} - {unread ? : null} - - ); + if (unread) { + return ; + } + + return ; }; export default MessageSeparator; diff --git a/app/containers/message/components/__tests__/__snapshots__/Message.test.tsx.snap b/app/containers/message/components/__tests__/__snapshots__/Message.test.tsx.snap index 1c3a3eaebb..de402e89cb 100644 --- a/app/containers/message/components/__tests__/__snapshots__/Message.test.tsx.snap +++ b/app/containers/message/components/__tests__/__snapshots__/Message.test.tsx.snap @@ -23090,16 +23090,11 @@ exports[`Story Snapshots: DateAndUnreadSeparators should match snapshot 1`] = ` - - November 10, 2017 - + + November 10, 2017 + + - - - - - November 10, 2017 - + + November 10, 2017 + + - - -