Skip to content

Commit ee0aa05

Browse files
committed
Removes gatsby-plugin-offline, adds offline page + PWA compliant app
1 parent 7fd86c5 commit ee0aa05

File tree

3 files changed

+19
-17
lines changed

3 files changed

+19
-17
lines changed
Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
const React = require("react");
22

33
exports.onRenderBody = ({ pathname, setHeadComponents }) => {
4-
setHeadComponents([
5-
<script
6-
type="module"
7-
dangerouslySetInnerHTML={{
8-
__html: `import 'https://cdn.jsdelivr.net/npm/@pwabuilder/pwaupdate';`,
9-
}}
10-
></script>,
11-
<style
12-
dangerouslySetInnerHTML={{
13-
__html: `pwa-update {
4+
if (!pathname.includes("/amp/")) {
5+
setHeadComponents([
6+
<script
7+
type="module"
8+
dangerouslySetInnerHTML={{
9+
__html: `import 'https://cdn.jsdelivr.net/npm/@pwabuilder/pwaupdate';`,
10+
}}
11+
></script>,
12+
<style
13+
dangerouslySetInnerHTML={{
14+
__html: `pwa-update {
1415
display: none;
1516
}`,
16-
}}
17-
></style>,
18-
<pwa-update showOfflineToast="false"></pwa-update>,
19-
]);
17+
}}
18+
></style>,
19+
<pwa-update showOfflineToast="false"></pwa-update>,
20+
]);
21+
}
2022
};

gatsby-wordpress-theme-libre/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@draftbox-co/gatsby-wordpress-theme-libre",
3-
"version": "1.0.37",
3+
"version": "1.0.38",
44
"license": "MIT",
55
"resolutions": {
66
"sharp": "0.23.4"

gatsby-wordpress-theme-libre/src/pages/offline.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from "react";
22
import { Link } from "gatsby";
33

4-
const NotFound = () => {
4+
const OfflinePage = () => {
55
return (
66
<div className="error-message-container">
77
<div className="error-message">
@@ -17,4 +17,4 @@ const NotFound = () => {
1717
);
1818
};
1919

20-
export default NotFound;
20+
export default OfflinePage;

0 commit comments

Comments
 (0)