Skip to content

Commit

Permalink
ci: updated App to display DATE_TIME stamp from index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
dcpesses committed Feb 29, 2024
1 parent 5d2cc69 commit b7de1d4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@
</head>
<body>
<div id="root"></div>
<script type="text/javascript">
window.lastUpdated = 'Last Updated: DATE_TIME';
if (window.lastUpdated.indexOf('_') !== -1) {
window.lastUpdated = 'Last Reloaded: ' + (new Date()).toLocaleString();
}
</script>
<script type="module" src="/src/main.tsx"></script>
</body>
<!-- Last Updated: DATE_TIME -->
Expand Down
7 changes: 7 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ import logo from '@/assets/logo.svg';

import '@/App.css';

declare global {
interface Window {
lastUpdated: string;
}
}

const Home = () => (
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
Expand Down Expand Up @@ -36,6 +42,7 @@ const Home = () => (
</p>
<p className="last-updated">
<small>
{ window.lastUpdated }
</small>
</p>
</header>
Expand Down

0 comments on commit b7de1d4

Please sign in to comment.