diff --git a/frontend/src/components/homepage/messages.js b/frontend/src/components/homepage/messages.js index ef6335e316..510a144155 100644 --- a/frontend/src/components/homepage/messages.js +++ b/frontend/src/components/homepage/messages.js @@ -170,9 +170,4 @@ export default defineMessages({ id: 'home.testimonials.ifrc.bio', defaultMessage: 'Remote Coordinator for the IFRC Information Management Team for Cyclone Idai', }, - statsTooltip: { - id: 'home.statsTooltip', - defaultMessage: - 'These statistics come from ohsomeNow Stats and were last updated at {formattedDate} ({timeZone}). Missing fields will be made available soon!', - }, }); diff --git a/frontend/src/components/statsTimestamp/index.js b/frontend/src/components/statsTimestamp/index.js index 88e6cd6288..447ac28351 100644 --- a/frontend/src/components/statsTimestamp/index.js +++ b/frontend/src/components/statsTimestamp/index.js @@ -25,7 +25,6 @@ function StatsTimestamp({ messageType }) { day: '2-digit', hour: 'numeric', minute: 'numeric', - timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone, }; return ( @@ -33,8 +32,7 @@ function StatsTimestamp({ messageType }) { { textComponent={React.Fragment} messages={getTranslatedMessages(props.locale)} timeZone={Intl.DateTimeFormat().resolvedOptions().timeZone} - // timeZone="America/Chicago" > {props.children} diff --git a/frontend/src/views/home.js b/frontend/src/views/home.js index 02d6c01a9d..1483a89474 100644 --- a/frontend/src/views/home.js +++ b/frontend/src/views/home.js @@ -1,8 +1,6 @@ -import React, { useState, useEffect } from 'react'; -import ReactTooltip from 'react-tooltip'; +import React from 'react'; import { ErrorBoundary } from 'react-error-boundary'; import { FormattedMessage } from 'react-intl'; -import { useIntl } from 'react-intl'; import { Jumbotron, SecondaryJumbotron } from '../components/homepage/jumbotron'; import { StatsSection } from '../components/homepage/stats'; @@ -11,32 +9,9 @@ import { WhoIsMapping } from '../components/homepage/whoIsMapping'; import { Testimonials } from '../components/homepage/testimonials'; import { Alert } from '../components/alert'; import homeMessages from '../components/homepage/messages'; -import { InfoIcon } from '../components/svgIcons'; -import { fetchExternalJSONAPI } from '../network/genericJSONRequest'; -import { OHSOME_STATS_BASE_URL } from '../config/'; -import messages from '../components/homepage/messages.js'; +import StatsTimestamp from '../components/statsTimestamp/'; export function Home() { - const intl = useIntl(); - const [lastUpdated, setLastUpdated] = useState(null); - - useEffect(() => { - fetchExternalJSONAPI(`${OHSOME_STATS_BASE_URL}/metadata`) - .then((res) => { - setLastUpdated(res.result.max_timestamp); - }) - .catch((error) => console.error(error)); - }, []); - - const dateOptions = { - year: 'numeric', - month: 'short', - day: '2-digit', - hour: 'numeric', - minute: 'numeric', - // timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone, - }; - return (
@@ -50,18 +25,8 @@ export function Home() { } > -
- - +
+