Added build version to the intro screen

This commit is contained in:
Przemek Wiech
2019-11-26 23:43:52 +01:00
parent ea04c6dc7a
commit 1bf315ebdf
3 changed files with 24 additions and 2 deletions

View File

@@ -51,3 +51,7 @@ div.ui.card.intro {
width: 600px;
margin: auto;
}
.version {
color: #888;
}

View File

@@ -15,6 +15,13 @@ function GedcomLink(props: {url: string; text: string}) {
);
}
function formatBuildDate(dateString: string) {
return new Date(dateString)
.toISOString()
.slice(0, 16)
.replace('T', ' ');
}
/** The intro page. */
export function Intro() {
return (
@@ -111,6 +118,17 @@ export function Intro() {
}}
/>
</p>
<p className="ui right aligned version">
version: {formatBuildDate(process.env.REACT_APP_GIT_TIME!)} (
<a
href={`https://github.com/PeWu/topola-viewer/commit/${
process.env.REACT_APP_GIT_SHA
}`}
>
{process.env.REACT_APP_GIT_SHA}
</a>
)
</p>
</Card.Content>
</Card>
);