1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-11-22 01:46:51 +01:00
blog/gatsby-browser.tsx
Matthias Kretschmann 0aaf874538
refactor (#733)
* refactor

* fixes

* fixes

* fix

* package updates
2022-11-11 02:31:54 +00:00

19 lines
831 B
TypeScript

import { GatsbyBrowser } from 'gatsby'
import './src/global/global.css'
import './src/global/imports.css'
import wrapPageElementWithLayout from './src/helpers/wrapPageElement'
export const wrapPageElement: GatsbyBrowser['wrapPageElement'] =
wrapPageElementWithLayout
// Display a message when a service worker updates
// https://www.gatsbyjs.org/docs/add-offline-support-with-a-service-worker/#displaying-a-message-when-a-service-worker-updates
export const onServiceWorkerUpdateReady: GatsbyBrowser['onServiceWorkerUpdateReady'] =
() => {
const div = document.createElement('div')
div.id = 'toast'
div.classList.add('alert', 'alert-info')
div.innerHTML = `<button onClick="window.location.reload()">This application has been updated. <span>Click to Reload</span>.</button>`
document.body.append(div)
}