1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-04 00:18:01 +01:00

fix: react-timeago issue (#7936)

This commit is contained in:
Tymoteusz Czech 2024-08-20 14:03:05 +02:00 committed by GitHub
parent 74133395cc
commit 0d97f8b7c1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 19 additions and 3 deletions

View File

@ -307,6 +307,7 @@ export const ApplicationChart = ({ data }: IApplicationChartProps) => {
<StyledCell>
{environment.lastSeen && (
<TimeAgo
key={`${environment.lastSeen}`}
minPeriod={60}
date={
new Date(

View File

@ -38,6 +38,7 @@ export const FeatureArchivedCell: VFC<IFeatureArchivedCellProps> = ({
>
<Typography noWrap variant='body2' data-loading>
<TimeAgo
key={`${archivedAt}`}
date={new Date(archivedAt)}
title=''
live={false}

View File

@ -37,6 +37,7 @@ export const ChangeRequestComment: FC<{ comment: IChangeRequestComment }> = ({
<Typography color='text.secondary' component='span'>
commented{' '}
<TimeAgo
key={`${comment.createdAt}`}
minPeriod={60}
date={new Date(comment.createdAt)}
/>

View File

@ -40,6 +40,7 @@ export const ChangeRequestHeader: FC<{ changeRequest: ChangeRequestType }> = ({
>
Created{' '}
<TimeAgo
key={`${changeRequest.createdAt}`}
minPeriod={60}
date={new Date(changeRequest.createdAt)}
/>{' '}

View File

@ -158,6 +158,7 @@ export const Notification = ({
<StyledTimeAgoTypography>
<TimeAgo
key={`${notification.createdAt}`}
date={new Date(notification.createdAt)}
minPeriod={60}
/>

View File

@ -98,6 +98,7 @@ export const FeatureSeenCell: VFC<IFeatureSeenCellProps> = ({
condition={Boolean(lastSeenAt)}
show={
<TimeAgo
key={`${lastSeenAt}`}
date={lastSeenAt!}
title=''
live={false}

View File

@ -99,6 +99,7 @@ export const LastSeenTooltip = ({
condition={Boolean(lastSeenAt)}
show={
<TimeAgo
key={`${lastSeenAt}`}
date={lastSeenAt!}
title=''
live={false}

View File

@ -1,6 +1,6 @@
import { Tooltip, Typography } from '@mui/material';
import { useLocationSettings } from 'hooks/useLocationSettings';
import type { VFC } from 'react';
import type { FC } from 'react';
import { formatDateYMD } from 'utils/formatDate';
import { TextCell } from '../TextCell/TextCell';
import TimeAgo from 'react-timeago';
@ -13,7 +13,7 @@ interface ITimeAgoCellProps {
dateFormat?: (value: string | number | Date, locale: string) => string;
}
export const TimeAgoCell: VFC<ITimeAgoCellProps> = ({
export const TimeAgoCell: FC<ITimeAgoCellProps> = ({
value,
live = false,
emptyText,
@ -35,7 +35,12 @@ export const TimeAgoCell: VFC<ITimeAgoCellProps> = ({
variant='body2'
data-loading
>
<TimeAgo date={new Date(value)} live={live} title={''} />
<TimeAgo
key={`${value}`}
date={new Date(value)}
live={live}
title={''}
/>
</Typography>
</Tooltip>
</TextCell>

View File

@ -89,6 +89,7 @@ export const FeatureEnvironmentSeen = ({
<>
{lastSeen ? (
<TimeAgo
key={`${lastSeen}`}
date={lastSeen}
title=''
live={false}

View File

@ -117,6 +117,7 @@ const LastSeenIcon: FC<{
return (
<TimeAgo
key={`${lastSeen}`}
date={lastSeen}
title=''
live={false}
@ -230,6 +231,7 @@ const Environments: FC<{
</CenteredBox>
<CenteredBox>
<TimeAgo
key={`${environment.lastSeenAt}`}
minPeriod={60}
date={environment.lastSeenAt}
/>

View File

@ -91,6 +91,7 @@ export const ProjectArchiveCard: FC<ProjectArchiveCardProps> = ({
<p data-loading>
Archived:{' '}
<TimeAgo
key={`${archivedAt}`}
minPeriod={60}
date={
new Date(archivedAt as string)