From 60815b4eaca60d3721f52ae3228ee8b303709488 Mon Sep 17 00:00:00 2001 From: Victor Lin <13424970+victorlin@users.noreply.github.com> Date: Thu, 19 Oct 2023 16:26:55 -0700 Subject: [PATCH] Move "Date updated" to byline This seems like important information that shouldn't be buried at the bottom of the page. Suggested by @joverlee521. --- src/components/framework/fine-print.js | 9 --------- src/components/info/byline.js | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/components/framework/fine-print.js b/src/components/framework/fine-print.js index 35430d553..9ed0277a2 100644 --- a/src/components/framework/fine-print.js +++ b/src/components/framework/fine-print.js @@ -70,13 +70,6 @@ class FinePrint extends React.Component { return false; } - getUpdated() { - const { t } = this.props; - if (this.props.metadata.updated) { - return ({t("Data updated")} {this.props.metadata.updated}); - } - return null; - } downloadDataButton() { const { t } = this.props; return ( @@ -97,8 +90,6 @@ class FinePrint extends React.Component {
- {this.getUpdated()} - {dot} {this.downloadDataButton()} {dot} {"Auspice v" + version} diff --git a/src/components/info/byline.js b/src/components/info/byline.js index 6dd008260..83f136611 100644 --- a/src/components/info/byline.js +++ b/src/components/info/byline.js @@ -22,6 +22,7 @@ class Byline extends React.Component { {renderAvatar(t, this.props.metadata)} {renderBuildInfo(t, this.props.metadata)} {renderMaintainers(t, this.props.metadata)} + {renderDataUpdated(t, this.props.metadata)} {renderDataProvenance(t, this.props.metadata)} ); @@ -101,6 +102,20 @@ function renderMaintainers(t, metadata) { return null; } +/** + * Returns a React component detailing the date the data was last updated. + * Renders a containing "Data updated X", where X derives from `metadata.updated` + */ +function renderDataUpdated(t, metadata) { + if (metadata.updated) { + return ( + + {`${t("Data updated")} ${metadata.updated}. `} + + ); + } + return null; +} /** * Returns a React component detailing the data provenance of the build (pipeline).