Skip to content

Commit bb855d0

Browse files
committed
feat: migrate to RelativeTime component
Signed-off-by: Adam Setch <[email protected]>
1 parent 13a019e commit bb855d0

File tree

4 files changed

+709
-208
lines changed

4 files changed

+709
-208
lines changed

src/renderer/components/notifications/NotificationFooter.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { FC, MouseEvent } from 'react';
22

33
import { FeedPersonIcon, MarkGithubIcon } from '@primer/octicons-react';
4-
import { Avatar, RelativeTime } from '@primer/react';
4+
import { Avatar, RelativeTime, Stack, Text } from '@primer/react';
55

66
import { IconColor, Opacity, Size } from '../../types';
77
import type { Notification } from '../../typesGitHub';
@@ -21,7 +21,7 @@ export const NotificationFooter: FC<INotificationFooter> = ({
2121
const reason = formatReason(notification.reason);
2222

2323
return (
24-
<div className="flex flex-wrap items-center gap-1">
24+
<Stack direction="horizontal" align="center" gap="condensed" wrap="wrap">
2525
{notification.subject.user ? (
2626
<Avatar
2727
title={`View profile: ${notification.subject.user.login}`}
@@ -46,13 +46,14 @@ export const NotificationFooter: FC<INotificationFooter> = ({
4646
</>
4747
)}
4848
<span className={cn('text-xs', Opacity.MEDIUM)}>
49-
<span className={'capitalize'} title={reason.description}>
50-
{reason.title}
51-
</span>
52-
<span></span>
53-
<RelativeTime datetime={notification.updated_at} />
49+
<Stack direction="horizontal" gap="condensed">
50+
<Text title={reason.description}>{reason.title}</Text>
51+
<Text>&bull;</Text>
52+
<RelativeTime datetime={notification.updated_at} />
53+
</Stack>
5454
</span>
55+
5556
<Pills notification={notification} />
56-
</div>
57+
</Stack>
5758
);
5859
};

src/renderer/components/notifications/__snapshots__/AccountNotifications.test.tsx.snap

Lines changed: 140 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)