Add PWA
|
@ -1,6 +1,14 @@
|
||||||
/** @type {import('next').NextConfig} */
|
/** @type {import('next').NextConfig} */
|
||||||
const nextConfig = {
|
|
||||||
|
const withPWA = require("next-pwa");
|
||||||
|
|
||||||
|
const nextConfig = withPWA({
|
||||||
reactStrictMode: true,
|
reactStrictMode: true,
|
||||||
}
|
pwa: {
|
||||||
|
dest: "public",
|
||||||
|
register: true,
|
||||||
|
skipWaiting: true,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
module.exports = nextConfig
|
module.exports = nextConfig
|
||||||
|
|
5774
package-lock.json
generated
11
package.json
|
@ -24,6 +24,7 @@
|
||||||
"cookies-next": "^2.0.4",
|
"cookies-next": "^2.0.4",
|
||||||
"js-file-download": "^0.4.12",
|
"js-file-download": "^0.4.12",
|
||||||
"next": "12.1.5",
|
"next": "12.1.5",
|
||||||
|
"next-pwa": "^5.5.2",
|
||||||
"node-appwrite": "^5.1.0",
|
"node-appwrite": "^5.1.0",
|
||||||
"react": "18.0.0",
|
"react": "18.0.0",
|
||||||
"react-dom": "18.0.0",
|
"react-dom": "18.0.0",
|
||||||
|
@ -35,16 +36,16 @@
|
||||||
"@types/node": "17.0.23",
|
"@types/node": "17.0.23",
|
||||||
"@types/react": "18.0.4",
|
"@types/react": "18.0.4",
|
||||||
"@types/react-dom": "18.0.0",
|
"@types/react-dom": "18.0.0",
|
||||||
"@types/uuid": "^8.3.4",
|
|
||||||
"@types/readline-sync": "^1.4.4",
|
"@types/readline-sync": "^1.4.4",
|
||||||
"@types/tar": "^6.1.1",
|
"@types/tar": "^6.1.1",
|
||||||
"eslint": "8.13.0",
|
"@types/uuid": "^8.3.4",
|
||||||
"eslint-config-next": "12.1.5",
|
|
||||||
"typescript": "^4.6.3",
|
|
||||||
"axios": "^0.26.1",
|
"axios": "^0.26.1",
|
||||||
"cookie": "^0.5.0",
|
"cookie": "^0.5.0",
|
||||||
|
"eslint": "8.13.0",
|
||||||
|
"eslint-config-next": "12.1.5",
|
||||||
"node-appwrite": "^5.1.0",
|
"node-appwrite": "^5.1.0",
|
||||||
"readline-sync": "^1.4.10",
|
"readline-sync": "^1.4.10",
|
||||||
"tar": "^6.1.11"
|
"tar": "^6.1.11",
|
||||||
|
"typescript": "^4.6.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
BIN
public/icons/icon-128x128.png
Normal file
After Width: | Height: | Size: 5.4 KiB |
BIN
public/icons/icon-144x144.png
Normal file
After Width: | Height: | Size: 6.4 KiB |
BIN
public/icons/icon-152x152.png
Normal file
After Width: | Height: | Size: 7.0 KiB |
BIN
public/icons/icon-192x192.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
public/icons/icon-384x384.png
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
public/icons/icon-48x48.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
public/icons/icon-512x512.png
Normal file
After Width: | Height: | Size: 44 KiB |
BIN
public/icons/icon-72x72.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
public/icons/icon-96x96.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
58
public/manifest.json
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
{
|
||||||
|
"name": "Pingvin Share",
|
||||||
|
"theme_color": "#46509e",
|
||||||
|
"background_color": "#ffffff",
|
||||||
|
"display": "standalone",
|
||||||
|
"orientation": "portrait",
|
||||||
|
"scope": "/",
|
||||||
|
"start_url": "/",
|
||||||
|
"icons": [
|
||||||
|
{
|
||||||
|
"src": "icons/icon-72x72.png",
|
||||||
|
"sizes": "72x72",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "icons/icon-96x96.png",
|
||||||
|
"sizes": "96x96",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "icons/icon-96x96.png",
|
||||||
|
"sizes": "96x96",
|
||||||
|
"type": "image/png",
|
||||||
|
"purpose": "maskable"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "icons/icon-128x128.png",
|
||||||
|
"sizes": "128x128",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "icons/icon-144x144.png",
|
||||||
|
"sizes": "144x144",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "icons/icon-152x152.png",
|
||||||
|
"sizes": "152x152",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "icons/icon-192x192.png",
|
||||||
|
"sizes": "192x192",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "icons/icon-384x384.png",
|
||||||
|
"sizes": "384x384",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "icons/icon-512x512.png",
|
||||||
|
"sizes": "512x512",
|
||||||
|
"type": "image/png"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"splash_pages": null
|
||||||
|
}
|
1
public/sw.js
Normal file
1
public/workbox-6316bd60.js
Normal file
|
@ -9,7 +9,11 @@ export default class _Document extends Document {
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<Html>
|
<Html>
|
||||||
<Head />
|
<Head>
|
||||||
|
<link rel="manifest" href="/manifest.json" />
|
||||||
|
<meta name="theme-color" content="#46509e" />
|
||||||
|
<link rel="apple-touch-icon" href="/icons/icon-128x128.png" />
|
||||||
|
</Head>
|
||||||
<body>
|
<body>
|
||||||
<Main />
|
<Main />
|
||||||
<NextScript />
|
<NextScript />
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { createContext } from "react";
|
import { createContext } from "react";
|
||||||
import aw from "./appwrite.util";
|
import aw from "./appwrite.util";
|
||||||
|
|
||||||
const isSignedIn = async() => {
|
const isSignedIn = async () => {
|
||||||
try {
|
try {
|
||||||
await aw.account.get();
|
await aw.account.get();
|
||||||
return true;
|
return true;
|
||||||
} catch {
|
} catch {
|
||||||
return false;
|
return false;
|
||||||
|
|