mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +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>
 | 
			
		||||
                                                {environment.lastSeen && (
 | 
			
		||||
                                                    <TimeAgo
 | 
			
		||||
                                                        key={`${environment.lastSeen}`}
 | 
			
		||||
                                                        minPeriod={60}
 | 
			
		||||
                                                        date={
 | 
			
		||||
                                                            new Date(
 | 
			
		||||
 | 
			
		||||
@ -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}
 | 
			
		||||
 | 
			
		||||
@ -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)}
 | 
			
		||||
                        />
 | 
			
		||||
 | 
			
		||||
@ -40,6 +40,7 @@ export const ChangeRequestHeader: FC<{ changeRequest: ChangeRequestType }> = ({
 | 
			
		||||
                >
 | 
			
		||||
                    Created{' '}
 | 
			
		||||
                    <TimeAgo
 | 
			
		||||
                        key={`${changeRequest.createdAt}`}
 | 
			
		||||
                        minPeriod={60}
 | 
			
		||||
                        date={new Date(changeRequest.createdAt)}
 | 
			
		||||
                    />{' '}
 | 
			
		||||
 | 
			
		||||
@ -158,6 +158,7 @@ export const Notification = ({
 | 
			
		||||
 | 
			
		||||
                    <StyledTimeAgoTypography>
 | 
			
		||||
                        <TimeAgo
 | 
			
		||||
                            key={`${notification.createdAt}`}
 | 
			
		||||
                            date={new Date(notification.createdAt)}
 | 
			
		||||
                            minPeriod={60}
 | 
			
		||||
                        />
 | 
			
		||||
 | 
			
		||||
@ -98,6 +98,7 @@ export const FeatureSeenCell: VFC<IFeatureSeenCellProps> = ({
 | 
			
		||||
            condition={Boolean(lastSeenAt)}
 | 
			
		||||
            show={
 | 
			
		||||
                <TimeAgo
 | 
			
		||||
                    key={`${lastSeenAt}`}
 | 
			
		||||
                    date={lastSeenAt!}
 | 
			
		||||
                    title=''
 | 
			
		||||
                    live={false}
 | 
			
		||||
 | 
			
		||||
@ -99,6 +99,7 @@ export const LastSeenTooltip = ({
 | 
			
		||||
                                        condition={Boolean(lastSeenAt)}
 | 
			
		||||
                                        show={
 | 
			
		||||
                                            <TimeAgo
 | 
			
		||||
                                                key={`${lastSeenAt}`}
 | 
			
		||||
                                                date={lastSeenAt!}
 | 
			
		||||
                                                title=''
 | 
			
		||||
                                                live={false}
 | 
			
		||||
 | 
			
		||||
@ -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>
 | 
			
		||||
 | 
			
		||||
@ -89,6 +89,7 @@ export const FeatureEnvironmentSeen = ({
 | 
			
		||||
        <>
 | 
			
		||||
            {lastSeen ? (
 | 
			
		||||
                <TimeAgo
 | 
			
		||||
                    key={`${lastSeen}`}
 | 
			
		||||
                    date={lastSeen}
 | 
			
		||||
                    title=''
 | 
			
		||||
                    live={false}
 | 
			
		||||
 | 
			
		||||
@ -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}
 | 
			
		||||
                            />
 | 
			
		||||
 | 
			
		||||
@ -91,6 +91,7 @@ export const ProjectArchiveCard: FC<ProjectArchiveCardProps> = ({
 | 
			
		||||
                                    <p data-loading>
 | 
			
		||||
                                        Archived:{' '}
 | 
			
		||||
                                        <TimeAgo
 | 
			
		||||
                                            key={`${archivedAt}`}
 | 
			
		||||
                                            minPeriod={60}
 | 
			
		||||
                                            date={
 | 
			
		||||
                                                new Date(archivedAt as string)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user