chore: include more quotes, new quote for each day, add to features section, dynamic theme_color

This commit is contained in:
Kyle Gill
2019-05-21 21:18:17 -06:00
parent 90250e7a98
commit 4a27d6fc5f
10 changed files with 171 additions and 57 deletions

View File

@@ -19,3 +19,63 @@ export const wrapRootElement = ({ element }) => {
</FirebaseContext.Provider>
)
}
export const onServiceWorkerUpdateFound = () => {
const showNotification = () => {
Notification.requestPermission(result => {
if (result === "granted") {
navigator.serviceWorker.ready.then(registration => {
registration.showNotification("Update", {
body: "New content is available!",
icon: "../images/sol-journal-logo.png",
vibrate: [200, 100, 200, 100, 200, 100, 400],
tag: "request",
actions: [
// you can customize these actions as you like
{
action: alert("update!"), // you should define this
title: "update",
},
{
action: alert("ignore"), // you should define this
title: "ignore",
},
],
})
})
}
})
}
showNotification()
}
export const onServiceWorkerInstalled = () => {
const showNotification = () => {
Notification.requestPermission(result => {
if (result === "granted") {
navigator.serviceWorker.ready.then(registration => {
registration.showNotification("Installed", {
body: "New content is available!",
icon: "../images/sol-journal-logo.png",
vibrate: [200, 100, 200, 100, 200, 100, 400],
tag: "request",
actions: [
// you can customize these actions as you like
{
action: alert("update!"), // you should define this
title: "update",
},
{
action: alert("ignore"), // you should define this
title: "ignore",
},
],
})
})
}
})
}
showNotification()
}