mirror of
https://github.com/PeWu/topola-viewer.git
synced 2026-03-17 04:53:45 +00:00
Added build version to the intro screen
This commit is contained in:
@@ -48,8 +48,8 @@
|
|||||||
"typescript": "latest"
|
"typescript": "latest"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "react-scripts start",
|
"start": "REACT_APP_GIT_SHA=`git rev-parse --short HEAD` REACT_APP_GIT_TIME=`git log -1 --format=%ci` react-scripts start",
|
||||||
"build": "react-scripts build",
|
"build": "REACT_APP_GIT_SHA=`git rev-parse --short HEAD` REACT_APP_GIT_TIME=`git log -1 --format=%ci` react-scripts build",
|
||||||
"test": "react-scripts test --env=jsdom",
|
"test": "react-scripts test --env=jsdom",
|
||||||
"prettier": "prettier --write src/**/*.{ts,tsx,json}",
|
"prettier": "prettier --write src/**/*.{ts,tsx,json}",
|
||||||
"predeploy": "npm run build",
|
"predeploy": "npm run build",
|
||||||
|
|||||||
@@ -51,3 +51,7 @@ div.ui.card.intro {
|
|||||||
width: 600px;
|
width: 600px;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.version {
|
||||||
|
color: #888;
|
||||||
|
}
|
||||||
@@ -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. */
|
/** The intro page. */
|
||||||
export function Intro() {
|
export function Intro() {
|
||||||
return (
|
return (
|
||||||
@@ -111,6 +118,17 @@ export function Intro() {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</p>
|
</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.Content>
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user