diff --git a/package.json b/package.json index d0815de..57830a6 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "license": "MIT", "description": "A tabbing app for small World Schools-like debating tournaments", "private": true, - "homepage": "https://rayo.dev/tacotab", + "homepage": ".", "dependencies": { "@types/jest": "^24.9.1", "@types/node": "^12.12.41", diff --git a/src/App.scss b/src/App.scss index 47b330a..879e886 100644 --- a/src/App.scss +++ b/src/App.scss @@ -204,4 +204,15 @@ outline: none; } } +} + + +.alert-global { + position: absolute; + right: 7px; + top: 7px; +} + +#alert-new-version-available { + display: none; } \ No newline at end of file diff --git a/src/App.tsx b/src/App.tsx index 9fa7ec6..e6fd9a6 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -16,7 +16,8 @@ import Container from 'react-bootstrap/Container'; import Tab from 'react-bootstrap/Tab'; import Nav from 'react-bootstrap/Nav'; import Collapse from 'react-bootstrap/Collapse'; -import { List } from 'react-bootstrap-icons'; +import Alert from 'react-bootstrap/Alert'; +import { List, ExclamationTriangle } from 'react-bootstrap-icons'; type AppProps = {} @@ -289,6 +290,14 @@ class App extends React.Component { + +    + A new version of TacoTab is available! window.location.reload()}>Click to reload. + + diff --git a/src/index.tsx b/src/index.tsx index 70e1f97..cb90a01 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -6,10 +6,20 @@ import App from './App'; import * as serviceWorker from './serviceWorker'; ReactDOM.render( - - - , - document.getElementById('root') + + + , + document.getElementById('root') ); serviceWorker.register(); + +// serviceWorker.register({ +// onUpdate: (registration: ServiceWorkerRegistration) => { +// document.getElementById("alert-new-version-available")?.classList.add("show"); +// if( registration && registration.waiting ) { +// registration.waiting.postMessage({type: 'SKIP_WAITING '}); +// } +// window.location.reload(true); +// } +// });