mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-09 00:18:00 +01:00
fix: react-timeago issue (#7936)
This commit is contained in:
parent
74133395cc
commit
0d97f8b7c1
@ -307,6 +307,7 @@ export const ApplicationChart = ({ data }: IApplicationChartProps) => {
|
|||||||
<StyledCell>
|
<StyledCell>
|
||||||
{environment.lastSeen && (
|
{environment.lastSeen && (
|
||||||
<TimeAgo
|
<TimeAgo
|
||||||
|
key={`${environment.lastSeen}`}
|
||||||
minPeriod={60}
|
minPeriod={60}
|
||||||
date={
|
date={
|
||||||
new Date(
|
new Date(
|
||||||
|
@ -38,6 +38,7 @@ export const FeatureArchivedCell: VFC<IFeatureArchivedCellProps> = ({
|
|||||||
>
|
>
|
||||||
<Typography noWrap variant='body2' data-loading>
|
<Typography noWrap variant='body2' data-loading>
|
||||||
<TimeAgo
|
<TimeAgo
|
||||||
|
key={`${archivedAt}`}
|
||||||
date={new Date(archivedAt)}
|
date={new Date(archivedAt)}
|
||||||
title=''
|
title=''
|
||||||
live={false}
|
live={false}
|
||||||
|
@ -37,6 +37,7 @@ export const ChangeRequestComment: FC<{ comment: IChangeRequestComment }> = ({
|
|||||||
<Typography color='text.secondary' component='span'>
|
<Typography color='text.secondary' component='span'>
|
||||||
commented{' '}
|
commented{' '}
|
||||||
<TimeAgo
|
<TimeAgo
|
||||||
|
key={`${comment.createdAt}`}
|
||||||
minPeriod={60}
|
minPeriod={60}
|
||||||
date={new Date(comment.createdAt)}
|
date={new Date(comment.createdAt)}
|
||||||
/>
|
/>
|
||||||
|
@ -40,6 +40,7 @@ export const ChangeRequestHeader: FC<{ changeRequest: ChangeRequestType }> = ({
|
|||||||
>
|
>
|
||||||
Created{' '}
|
Created{' '}
|
||||||
<TimeAgo
|
<TimeAgo
|
||||||
|
key={`${changeRequest.createdAt}`}
|
||||||
minPeriod={60}
|
minPeriod={60}
|
||||||
date={new Date(changeRequest.createdAt)}
|
date={new Date(changeRequest.createdAt)}
|
||||||
/>{' '}
|
/>{' '}
|
||||||
|
@ -158,6 +158,7 @@ export const Notification = ({
|
|||||||
|
|
||||||
<StyledTimeAgoTypography>
|
<StyledTimeAgoTypography>
|
||||||
<TimeAgo
|
<TimeAgo
|
||||||
|
key={`${notification.createdAt}`}
|
||||||
date={new Date(notification.createdAt)}
|
date={new Date(notification.createdAt)}
|
||||||
minPeriod={60}
|
minPeriod={60}
|
||||||
/>
|
/>
|
||||||
|
@ -98,6 +98,7 @@ export const FeatureSeenCell: VFC<IFeatureSeenCellProps> = ({
|
|||||||
condition={Boolean(lastSeenAt)}
|
condition={Boolean(lastSeenAt)}
|
||||||
show={
|
show={
|
||||||
<TimeAgo
|
<TimeAgo
|
||||||
|
key={`${lastSeenAt}`}
|
||||||
date={lastSeenAt!}
|
date={lastSeenAt!}
|
||||||
title=''
|
title=''
|
||||||
live={false}
|
live={false}
|
||||||
|
@ -99,6 +99,7 @@ export const LastSeenTooltip = ({
|
|||||||
condition={Boolean(lastSeenAt)}
|
condition={Boolean(lastSeenAt)}
|
||||||
show={
|
show={
|
||||||
<TimeAgo
|
<TimeAgo
|
||||||
|
key={`${lastSeenAt}`}
|
||||||
date={lastSeenAt!}
|
date={lastSeenAt!}
|
||||||
title=''
|
title=''
|
||||||
live={false}
|
live={false}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Tooltip, Typography } from '@mui/material';
|
import { Tooltip, Typography } from '@mui/material';
|
||||||
import { useLocationSettings } from 'hooks/useLocationSettings';
|
import { useLocationSettings } from 'hooks/useLocationSettings';
|
||||||
import type { VFC } from 'react';
|
import type { FC } from 'react';
|
||||||
import { formatDateYMD } from 'utils/formatDate';
|
import { formatDateYMD } from 'utils/formatDate';
|
||||||
import { TextCell } from '../TextCell/TextCell';
|
import { TextCell } from '../TextCell/TextCell';
|
||||||
import TimeAgo from 'react-timeago';
|
import TimeAgo from 'react-timeago';
|
||||||
@ -13,7 +13,7 @@ interface ITimeAgoCellProps {
|
|||||||
dateFormat?: (value: string | number | Date, locale: string) => string;
|
dateFormat?: (value: string | number | Date, locale: string) => string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const TimeAgoCell: VFC<ITimeAgoCellProps> = ({
|
export const TimeAgoCell: FC<ITimeAgoCellProps> = ({
|
||||||
value,
|
value,
|
||||||
live = false,
|
live = false,
|
||||||
emptyText,
|
emptyText,
|
||||||
@ -35,7 +35,12 @@ export const TimeAgoCell: VFC<ITimeAgoCellProps> = ({
|
|||||||
variant='body2'
|
variant='body2'
|
||||||
data-loading
|
data-loading
|
||||||
>
|
>
|
||||||
<TimeAgo date={new Date(value)} live={live} title={''} />
|
<TimeAgo
|
||||||
|
key={`${value}`}
|
||||||
|
date={new Date(value)}
|
||||||
|
live={live}
|
||||||
|
title={''}
|
||||||
|
/>
|
||||||
</Typography>
|
</Typography>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</TextCell>
|
</TextCell>
|
||||||
|
@ -89,6 +89,7 @@ export const FeatureEnvironmentSeen = ({
|
|||||||
<>
|
<>
|
||||||
{lastSeen ? (
|
{lastSeen ? (
|
||||||
<TimeAgo
|
<TimeAgo
|
||||||
|
key={`${lastSeen}`}
|
||||||
date={lastSeen}
|
date={lastSeen}
|
||||||
title=''
|
title=''
|
||||||
live={false}
|
live={false}
|
||||||
|
@ -117,6 +117,7 @@ const LastSeenIcon: FC<{
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<TimeAgo
|
<TimeAgo
|
||||||
|
key={`${lastSeen}`}
|
||||||
date={lastSeen}
|
date={lastSeen}
|
||||||
title=''
|
title=''
|
||||||
live={false}
|
live={false}
|
||||||
@ -230,6 +231,7 @@ const Environments: FC<{
|
|||||||
</CenteredBox>
|
</CenteredBox>
|
||||||
<CenteredBox>
|
<CenteredBox>
|
||||||
<TimeAgo
|
<TimeAgo
|
||||||
|
key={`${environment.lastSeenAt}`}
|
||||||
minPeriod={60}
|
minPeriod={60}
|
||||||
date={environment.lastSeenAt}
|
date={environment.lastSeenAt}
|
||||||
/>
|
/>
|
||||||
|
@ -91,6 +91,7 @@ export const ProjectArchiveCard: FC<ProjectArchiveCardProps> = ({
|
|||||||
<p data-loading>
|
<p data-loading>
|
||||||
Archived:{' '}
|
Archived:{' '}
|
||||||
<TimeAgo
|
<TimeAgo
|
||||||
|
key={`${archivedAt}`}
|
||||||
minPeriod={60}
|
minPeriod={60}
|
||||||
date={
|
date={
|
||||||
new Date(archivedAt as string)
|
new Date(archivedAt as string)
|
||||||
|
Loading…
Reference in New Issue
Block a user