diff --git a/src/screens/EmailThreadScreen.tsx b/src/screens/EmailThreadScreen.tsx index c17e32a3..b3fe5927 100644 --- a/src/screens/EmailThreadScreen.tsx +++ b/src/screens/EmailThreadScreen.tsx @@ -36,8 +36,13 @@ type Props = NativeStackScreenProps; function formatHeaderDate(iso: string): string { const d = new Date(iso); - return d.toLocaleString(undefined, { + return d.toLocaleDateString(undefined, { weekday: 'short', year: 'numeric', month: 'short', day: 'numeric', + }); +} + +function formatHeaderTime(iso: string): string { + return new Date(iso).toLocaleTimeString(undefined, { hour: '2-digit', minute: '2-digit', }); } @@ -722,22 +727,14 @@ function EmailPane({ {/* Subject block */} - - onToggleStar(email)} hitSlop={8} style={styles.subjectStar}> - - - {subject} - - - {formatHeaderDate(email.receivedAt)} - {email.size > 0 && ( - {formatSize(email.size)} - )} - + {subject} + onToggleStar(email)} hitSlop={8} style={styles.subjectStar}> + + @@ -761,6 +758,13 @@ function EmailPane({ {email.to?.map((t) => t.name || t.email).join(', ') || '-'} + + {formatHeaderDate(email.receivedAt)} + + {formatHeaderTime(email.receivedAt)} + {email.size > 0 ? ` ยท ${formatSize(email.size)}` : ''} + + {attachmentPosition === 'beside-sender' && renderAttachments()} @@ -800,8 +804,7 @@ function EmailPaneSkeleton({ styles }: { styles: ReturnType } return ( - - + @@ -811,6 +814,10 @@ function EmailPaneSkeleton({ styles }: { styles: ReturnType } + + + + @@ -1160,12 +1167,6 @@ function makeStyles(c: ThemePalette) { alignItems: 'flex-start', gap: spacing.sm, }, - subjectMain: { - flex: 1, - flexDirection: 'row', - alignItems: 'flex-start', - gap: spacing.sm, - }, subjectStar: { paddingTop: 4, }, @@ -1177,18 +1178,6 @@ function makeStyles(c: ThemePalette) { color: c.text, letterSpacing: -0.2, }, - subjectMeta: { - alignItems: 'flex-end', - }, - subjectDate: { - ...typography.caption, - color: c.textSecondary, - }, - subjectSize: { - ...typography.caption, - color: c.textMuted, - marginTop: 2, - }, // Sender block senderBlock: { @@ -1221,6 +1210,19 @@ function makeStyles(c: ThemePalette) { senderRecipientsLabel: { color: c.textMuted, }, + senderMeta: { + alignItems: 'flex-end', + paddingTop: 1, + }, + senderDate: { + ...typography.caption, + color: c.textSecondary, + }, + senderTime: { + ...typography.caption, + color: c.textMuted, + marginTop: 2, + }, // Attachments attachmentsBlock: {