add webmanifest and notification handler in service worker
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { Document, Html, DocumentHead, Main, BlitzScript /*DocumentContext*/ } from "blitz";
|
||||
import { Document, Html, DocumentHead, Main, BlitzScript, Head /*DocumentContext*/ } from "blitz";
|
||||
|
||||
class MyDocument extends Document {
|
||||
// Only uncomment if you need to customize this behaviour
|
||||
@ -11,6 +11,19 @@ class MyDocument extends Document {
|
||||
return (
|
||||
<Html lang="en">
|
||||
<DocumentHead />
|
||||
<Head>
|
||||
<link rel="manifest" href="/manifest.webmanifest" />
|
||||
|
||||
<meta name="mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="application-name" content="Shellphone" />
|
||||
<meta name="apple-mobile-web-app-title" content="Shellphone" />
|
||||
<meta name="theme-color" content="#663399" />
|
||||
<meta name="msapplication-navbutton-color" content="#663399" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
||||
<meta name="msapplication-starturl" content="/" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
||||
</Head>
|
||||
<body>
|
||||
<Main />
|
||||
<BlitzScript />
|
||||
|
22
app/pages/_offline.tsx
Normal file
22
app/pages/_offline.tsx
Normal file
@ -0,0 +1,22 @@
|
||||
import { useRouter } from "blitz";
|
||||
|
||||
import Layout from "../core/layouts/layout";
|
||||
|
||||
export default function Offline() {
|
||||
const router = useRouter();
|
||||
return (
|
||||
<Layout title="App went offline">
|
||||
<h2 className="mt-6 text-center text-3xl leading-9 font-extrabold text-gray-900">
|
||||
Oops, looks like you went offline.
|
||||
</h2>
|
||||
<p className="mt-2 text-center text-lg leading-5 text-gray-600">
|
||||
Once you're back online,{" "}
|
||||
<button className="inline-flex space-x-2 items-center text-left" onClick={router.reload}>
|
||||
<span className="transition-colors duration-150 border-b border-primary-200 hover:border-primary-500">
|
||||
reload the page
|
||||
</span>
|
||||
</button>
|
||||
</p>
|
||||
</Layout>
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user