Old TODOs / PWA work (#866)

* old TODOs

* fix up old next-offline TODO

* undo changes

* add apple touch icon
main
Michael Fix 5 years ago committed by repo-ranger[bot]
parent 0ee3df5792
commit 3abed8be72

@ -69,7 +69,7 @@ class Editor extends React.Component {
const { queryState } = getRouteState(this.props.router)
const newState = {
// TODO we could create an interface for loading this config, so that it looks identical
// IDEA: we could create an interface for loading this config, so that it looks identical
// whether config is loaded from localStorage, gist, or even something like IndexDB
// Load options from gist or localStorage
...(this.props.snippet ? null : getSettings(localStorage)),

@ -57,6 +57,7 @@ export const MetaTags = React.memo(() => (
<meta name="theme-color" content="#121212" />
<title>{title}</title>
<link rel="shortcut icon" href="/static/favicon.ico" />
<link rel="apple-touch-icon" href="/static/brand/apple-touch-icon.png" />
<link rel="manifest" href="/static/manifest.json" />
</Head>
))

@ -36,7 +36,6 @@ const parse = v => {
export const toggle = stateField => state => ({ [stateField]: !state[stateField] })
// https://gist.github.com/alexgibson/1704515
// TODO use https://github.com/sindresorhus/escape-goat/
export const escapeHtml = s => {
if (typeof s === 'string') {
return s

@ -10,11 +10,11 @@ const config = withOffline({
granularChunks: true
},
dontAutoRegisterSw: true,
// https://github.com/hanford/next-offline/blob/master/packages/now2-example/next.config.js
workboxOpts: {
// TODO get default config from `next-offline`?
swDest: 'static/service-worker.js',
globPatterns: ['static/**/*'],
globDirectory: '.',
globPatterns: ['static/**/*'],
runtimeCaching: [
{
urlPattern: /^https?.*/,

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Loading…
Cancel
Save