mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
fix: order events by date
This commit is contained in:
@@ -32,7 +32,8 @@ function getWhoisRemoveTimelineEvent(whoisRemoveDateEstimate: Date, withRenewalP
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
color: withRenewalPeriod ? 'grey' : 'yellow',
|
date: whoisRemoveDateEstimate,
|
||||||
|
color: withRenewalPeriod ? 'yellow' : 'grey',
|
||||||
dot: <ThunderboltOutlined style={{fontSize: '16px'}}/>,
|
dot: <ThunderboltOutlined style={{fontSize: '16px'}}/>,
|
||||||
pending: true,
|
pending: true,
|
||||||
...text
|
...text
|
||||||
@@ -51,7 +52,7 @@ export function EventTimeline({events, expiresInDays, isRenewalPeriod}: {
|
|||||||
const locale = navigator.language.split('-')[0]
|
const locale = navigator.language.split('-')[0]
|
||||||
const rdapEventNameTranslated = rdapEventNameTranslation()
|
const rdapEventNameTranslated = rdapEventNameTranslation()
|
||||||
const rdapEventDetailTranslated = rdapEventDetailTranslation()
|
const rdapEventDetailTranslated = rdapEventDetailTranslation()
|
||||||
const items: TimeLineItemProps[] = []
|
const items: (TimeLineItemProps & { date: Date })[] = []
|
||||||
|
|
||||||
if (expiresInDays !== undefined) {
|
if (expiresInDays !== undefined) {
|
||||||
const whoisRemoveDateEstimate = new Date(new Date().getTime() + expiresInDays * 24 * 60 * 60 * 1e3)
|
const whoisRemoveDateEstimate = new Date(new Date().getTime() + expiresInDays * 24 * 60 * 60 * 1e3)
|
||||||
@@ -96,6 +97,7 @@ export function EventTimeline({events, expiresInDays, isRenewalPeriod}: {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
date: new Date(e.date),
|
||||||
color: e.deleted ? 'grey' : actionToColor(e.action),
|
color: e.deleted ? 'grey' : actionToColor(e.action),
|
||||||
dot: actionToIcon(e.action),
|
dot: actionToIcon(e.action),
|
||||||
pending: new Date(e.date).getTime() > new Date().getTime(),
|
pending: new Date(e.date).getTime() > new Date().getTime(),
|
||||||
@@ -107,6 +109,6 @@ export function EventTimeline({events, expiresInDays, isRenewalPeriod}: {
|
|||||||
|
|
||||||
return <Timeline
|
return <Timeline
|
||||||
mode={sm ? 'left' : 'right'}
|
mode={sm ? 'left' : 'right'}
|
||||||
items={items}
|
items={items.sort((a, b) => b.date.getTime() - a.date.getTime())}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user