Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
feat(pwa): adds pwa support
Browse files Browse the repository at this point in the history
fix #1711
  • Loading branch information
jackcmeyer committed Jan 11, 2020
1 parent 1ef36b3 commit 8ce17ca
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 11 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
"commit": "npx git-cz",
"start": "react-scripts start",
"build": "react-scripts build",
"start:serve": "npm run build && serve -s build",
"prepublishOnly": "npm run build",
"test": "react-scripts test --detectOpenHandles",
"test:ci": "cross-env CI=true react-scripts test",
Expand Down
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" />
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="theme-color" content="#1abc9c" />
<meta
name="description"
content="HospitalRun"
Expand Down
8 changes: 4 additions & 4 deletions public/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
"src": "logo.png",
"type": "image/png",
"sizes": "512x512"
}
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
"display": "fullscreen",
"theme_color": "#1abc9c",
"background_color": "#fdfffc"
}
14 changes: 9 additions & 5 deletions src/i18n.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import i18n from 'i18next'
import Backend from 'i18next-xhr-backend'
import LanguageDetector from 'i18next-browser-languagedetector'
import { initReactI18next } from 'react-i18next'

import translationEN from './locales/en-US/translation'

const resources = {
en: {
translation: translationEN,
},
}

i18n
// load translation using xhr -> see /public/locales
// learn more: https://github.com/i18next/i18next-xhr-backend
.use(Backend)
// detect user language
// learn more: https://github.com/i18next/i18next-browser-languageDetector
.use(LanguageDetector)
Expand All @@ -17,7 +21,7 @@ i18n
.init({
fallbackLng: 'en',
debug: true,

resources,
interpolation: {
escapeValue: false, // not needed for react as it escapes by default
},
Expand Down
3 changes: 2 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ ReactDOM.render(<App />, document.getElementById('root'))
// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister()
serviceWorker.register()
serviceWorker.register({})
File renamed without changes.

0 comments on commit 8ce17ca

Please sign in to comment.