// Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import type { ReactChild } from 'react'; import React from 'react'; import moment from 'moment'; import { Modal } from './Modal'; import { Intl } from './Intl'; import type { LocalizerType } from '../types/Util'; export type PropsType = { hideWhatsNewModal: () => unknown; i18n: LocalizerType; }; type ReleaseNotesType = { date: Date; version: string; features: Array; }; export function WhatsNewModal({ i18n, hideWhatsNewModal, }: PropsType): JSX.Element { let contentNode: ReactChild; const releaseNotes: ReleaseNotesType = { date: new Date(window.getBuildCreation?.() || Date.now()), version: window.getVersion?.(), features: [], }; if (releaseNotes.features.length === 1) { contentNode =

{releaseNotes.features[0]}

; } else { contentNode = ( ); } return ( <> {moment(releaseNotes.date).format('LL')} ·{' '} {releaseNotes.version} {contentNode} ); }