diff --git a/app/containers/Separator/MessageSeparator.tsx b/app/containers/Separator/MessageSeparator.tsx index 5a4e1bf519..bd20d746f2 100644 --- a/app/containers/Separator/MessageSeparator.tsx +++ b/app/containers/Separator/MessageSeparator.tsx @@ -2,52 +2,53 @@ 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'; +import DateSeparator, { DateSeparatorLabel } from './DateSeparator'; import { separatorStyles } from './styles'; const styles = StyleSheet.create({ text: { - fontSize: 14, - ...sharedStyles.textMedium + fontSize: 12, + lineHeight: 16, + marginLeft: 8, + ...sharedStyles.textBold }, - marginRight: { - marginRight: 14 - }, - marginHorizontal: { - marginHorizontal: 14 + dateLabel: { + marginHorizontal: 12 } }); -const MessageSeparator = ({ ts, unread }: { ts?: Date | string | null; unread?: boolean }): ReactElement | null => { +const UnreadSeparator = ({ ts }: { ts?: Date | string | null }): ReactElement => { const { colors } = useTheme(); + const lineStyle = { backgroundColor: colors.strokeError }; + + return ( + + + {ts ? ( + <> + + + + + + ) : null} + {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 ; + if (unread) { + return ; } - return ( - - {I18n.t('unread_messages')} - - - ); + + 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 d61b74ca5d..de402e89cb 100644 --- a/app/containers/message/components/__tests__/__snapshots__/Message.test.tsx.snap +++ b/app/containers/message/components/__tests__/__snapshots__/Message.test.tsx.snap @@ -23097,27 +23097,63 @@ exports[`Story Snapshots: DateAndUnreadSeparators should match snapshot 1`] = ` } } > - + - unread - + + + November 10, 2017 + + + @@ -23140,11 +23173,13 @@ exports[`Story Snapshots: DateAndUnreadSeparators should match snapshot 1`] = ` { "backgroundColor": "transparent", "fontFamily": "Inter", - "fontSize": 14, + "fontSize": 12, "fontVariant": [ "tabular-nums", ], - "fontWeight": "500", + "fontWeight": "700", + "lineHeight": 16, + "marginLeft": 8, "textAlign": "left", }, { @@ -23153,7 +23188,7 @@ exports[`Story Snapshots: DateAndUnreadSeparators should match snapshot 1`] = ` ] } > - November 10, 2017 + unread + unread - - + - unread - + + + November 10, 2017 + + + @@ -25381,11 +25448,13 @@ exports[`Story Snapshots: DateAndUnreadSeparatorsLargeFont should match snapshot { "backgroundColor": "transparent", "fontFamily": "Inter", - "fontSize": 14, + "fontSize": 12, "fontVariant": [ "tabular-nums", ], - "fontWeight": "500", + "fontWeight": "700", + "lineHeight": 16, + "marginLeft": 8, "textAlign": "left", }, { @@ -25394,7 +25463,7 @@ exports[`Story Snapshots: DateAndUnreadSeparatorsLargeFont should match snapshot ] } > - November 10, 2017 + unread + unread -