diff --git a/app/containers/UIKit/Button.tsx b/app/containers/UIKit/Button.tsx index e16a7d13d9..eb2c570ff2 100644 --- a/app/containers/UIKit/Button.tsx +++ b/app/containers/UIKit/Button.tsx @@ -42,7 +42,11 @@ const UIKitButton: FC = ({ title, onPress, type = 'primary', accessibilityLabel={title} accessibilityRole='button' style={({ pressed }) => [styles.container, { backgroundColor }, style, pressed && styles.pressed]}> - {loading ? : {title}} + {loading ? ( + + ) : ( + {title} + )} ); }; diff --git a/app/containers/markdown/Markdown.stories.tsx b/app/containers/markdown/Markdown.stories.tsx index 9a5b4a6161..cfbd3ac72e 100644 --- a/app/containers/markdown/Markdown.stories.tsx +++ b/app/containers/markdown/Markdown.stories.tsx @@ -222,13 +222,23 @@ export const Lists = () => ( export const Timestamp = () => ( - - - - - - - + + + + + + + + + + + + + + + + + ); diff --git a/app/containers/markdown/__snapshots__/Markdown.test.tsx.snap b/app/containers/markdown/__snapshots__/Markdown.test.tsx.snap index 9cf0b862ba..4197902da2 100644 --- a/app/containers/markdown/__snapshots__/Markdown.test.tsx.snap +++ b/app/containers/markdown/__snapshots__/Markdown.test.tsx.snap @@ -10036,7 +10036,7 @@ exports[`Story Snapshots: Timestamp should match snapshot 1`] = ` } > - t: + Unix timestamp formats + + + + + + + + + t - Short time: + + + 12:00 AM + + + + + + + + + T - Long time: + + + 12:00:00 AM + + + + + + + + + d - Short date: + + + 01/01/2025 + + + + + + + + + D - Long date: + + + Wednesday, Jan 01, 2025 + + + + + + + + + f - Short date/time: + + + Wednesday, Jan 01, 2025 12:00 AM + + + + + + + + + F - Long date/time: + + + Wednesday, Jan 01, 2025 12:00:00 AM + + + + + + + + + R - Relative time: + + + a year ago + + + + + + + + + ISO timestamp formats + + + + + + + + + t - Short time: - 12:00 PM + 12:00 AM @@ -10119,7 +10822,7 @@ exports[`Story Snapshots: Timestamp should match snapshot 1`] = ` } > - T: + T - Long time: - 12:00:00 PM + 12:00:00 AM @@ -10202,7 +10905,7 @@ exports[`Story Snapshots: Timestamp should match snapshot 1`] = ` } > - d: + d - Short date: - D: + D - Long date: - f: + f - Short date/time: - Wednesday, Jan 01, 2025 12:00 PM + Wednesday, Jan 01, 2025 12:00 AM @@ -10451,7 +11154,7 @@ exports[`Story Snapshots: Timestamp should match snapshot 1`] = ` } > - F: + F - Long date/time: - Wednesday, Jan 01, 2025 12:00:00 PM + Wednesday, Jan 01, 2025 12:00:00 AM @@ -10534,7 +11237,7 @@ exports[`Story Snapshots: Timestamp should match snapshot 1`] = ` } > - R: + R - Relative time: { const { colors } = useTheme(); - const timestampMs = useMemo(() => parseInt(value.timestamp, 10) * 1000, [value.timestamp]); + const timestampMs = useMemo(() => { + const ts = value.timestamp; + + // RC API returns Unix timestamps in seconds; dayjs expects milliseconds + if (/^-?\d{10}$/.test(ts)) return Number(ts) * 1000; + if (/^-?\d{13}$/.test(ts)) return Number(ts); + + return dayjs(ts).valueOf(); + }, [value.timestamp]); const formatDate = useMemo(() => { if (value.format === 't') {