Skip to content

Commit d6aee5b

Browse files
ChaosExAnimaClearlyClaire
authored andcommitted
[Glitch] Refactor: Relative timestamp component
Port cffa8de to glitch-soc Signed-off-by: Claire <claire.github-309c@sitedethib.com>
1 parent f2d834c commit d6aee5b

12 files changed

Lines changed: 454 additions & 315 deletions

File tree

app/javascript/flavours/glitch/components/account/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ export const Account: React.FC<AccountProps> = ({
276276
if (account?.mute_expires_at) {
277277
muteTimeRemaining = (
278278
<>
279-
· <RelativeTimestamp timestamp={account.mute_expires_at} futureDate />
279+
· <RelativeTimestamp timestamp={account.mute_expires_at} />
280280
</>
281281
);
282282
}

app/javascript/flavours/glitch/components/edited_timestamp/index.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,7 @@ export const EditedTimestamp: React.FC<{
6060
const renderItem = useCallback(
6161
(item: HistoryItem, index: number, onClick: React.MouseEventHandler) => {
6262
const formattedDate = (
63-
<RelativeTimestamp
64-
timestamp={item.get('created_at') as string}
65-
short={false}
66-
/>
63+
<RelativeTimestamp timestamp={item.get('created_at') as string} long />
6764
);
6865
const formattedName = (
6966
<InlineAccount accountId={item.get('account') as string} />

app/javascript/flavours/glitch/components/poll.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export const Poll: React.FC<PollProps> = ({ pollId, disabled, status }) => {
7070
if (expired) {
7171
return intl.formatMessage(messages.closed);
7272
}
73-
return <RelativeTimestamp timestamp={poll.expires_at} futureDate />;
73+
return <RelativeTimestamp timestamp={poll.expires_at} />;
7474
}, [expired, intl, poll]);
7575
const votesCount = useMemo(() => {
7676
if (!poll) {

app/javascript/flavours/glitch/components/relative_timestamp.tsx

Lines changed: 0 additions & 288 deletions
This file was deleted.

0 commit comments

Comments
 (0)