summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-05-16 11:05:37 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-05-16 11:05:37 +0700
commit24c444c51927886536f6701c7b7ba85890cc259c (patch)
tree3bf0135814a4fa995d730ed01b6b22420e7f0ff0
parentd0fa61c83fb50d504600ac8701ad3dc4c2de0f11 (diff)
add pwa
-rw-r--r--next.config.js9
-rw-r--r--package.json1
-rw-r--r--public/favicon.icobin1150 -> 4286 bytes
-rw-r--r--public/icon-192x192.pngbin0 -> 31481 bytes
-rw-r--r--public/icon-256x256.pngbin0 -> 31481 bytes
-rw-r--r--public/icon-384x384.pngbin0 -> 31481 bytes
-rw-r--r--public/icon-512x512.pngbin0 -> 31481 bytes
-rw-r--r--public/icon.pngbin0 -> 31481 bytes
-rw-r--r--public/loaderio-771e5c407ca162e7e90e487dfaa73477.txt1
-rw-r--r--public/manifest.json33
-rw-r--r--src/pages/_document.jsx5
11 files changed, 47 insertions, 2 deletions
diff --git a/next.config.js b/next.config.js
index d02aa9f0..2f3f4396 100644
--- a/next.config.js
+++ b/next.config.js
@@ -1,4 +1,11 @@
/** @type {import('next').NextConfig} */
+const withPWA = require('next-pwa')({
+ dest: 'public',
+ register: true,
+ disable: process.env.NODE_ENV === 'development',
+ skipWaiting: true
+})
+
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
@@ -25,4 +32,4 @@ const nextConfig = {
}
}
-module.exports = nextConfig
+module.exports = withPWA(nextConfig)
diff --git a/package.json b/package.json
index a4363bfd..cf46db5f 100644
--- a/package.json
+++ b/package.json
@@ -25,6 +25,7 @@
"midtrans-client": "^1.3.1",
"next": "13.0.0",
"next-progress": "^2.2.0",
+ "next-pwa": "^5.6.0",
"next-seo": "^5.15.0",
"nodemailer": "^6.8.0",
"react": "18.2.0",
diff --git a/public/favicon.ico b/public/favicon.ico
index 2fd36c90..0f30f234 100644
--- a/public/favicon.ico
+++ b/public/favicon.ico
Binary files differ
diff --git a/public/icon-192x192.png b/public/icon-192x192.png
new file mode 100644
index 00000000..23336bb3
--- /dev/null
+++ b/public/icon-192x192.png
Binary files differ
diff --git a/public/icon-256x256.png b/public/icon-256x256.png
new file mode 100644
index 00000000..23336bb3
--- /dev/null
+++ b/public/icon-256x256.png
Binary files differ
diff --git a/public/icon-384x384.png b/public/icon-384x384.png
new file mode 100644
index 00000000..23336bb3
--- /dev/null
+++ b/public/icon-384x384.png
Binary files differ
diff --git a/public/icon-512x512.png b/public/icon-512x512.png
new file mode 100644
index 00000000..23336bb3
--- /dev/null
+++ b/public/icon-512x512.png
Binary files differ
diff --git a/public/icon.png b/public/icon.png
new file mode 100644
index 00000000..23336bb3
--- /dev/null
+++ b/public/icon.png
Binary files differ
diff --git a/public/loaderio-771e5c407ca162e7e90e487dfaa73477.txt b/public/loaderio-771e5c407ca162e7e90e487dfaa73477.txt
deleted file mode 100644
index a6a8433a..00000000
--- a/public/loaderio-771e5c407ca162e7e90e487dfaa73477.txt
+++ /dev/null
@@ -1 +0,0 @@
-loaderio-771e5c407ca162e7e90e487dfaa73477 \ No newline at end of file
diff --git a/public/manifest.json b/public/manifest.json
new file mode 100644
index 00000000..987045b0
--- /dev/null
+++ b/public/manifest.json
@@ -0,0 +1,33 @@
+{
+ "theme_color" : "#F8C20A",
+ "background_color" : "#CC2020",
+ "display" : "standalone",
+ "scope" : "/",
+ "start_url" : "/",
+ "name" : "Indoteknik.com",
+ "short_name" : "Indoteknik.com",
+ "description" : "Indoteknik.com: B2B Industrial Supply & Solution",
+ "orientation": "portrait",
+ "icons": [
+ {
+ "src": "/icon-192x192.png",
+ "sizes": "192x192",
+ "type": "image/png"
+ },
+ {
+ "src": "/icon-256x256.png",
+ "sizes": "256x256",
+ "type": "image/png"
+ },
+ {
+ "src": "/icon-384x384.png",
+ "sizes": "384x384",
+ "type": "image/png"
+ },
+ {
+ "src": "/icon-512x512.png",
+ "sizes": "512x512",
+ "type": "image/png"
+ }
+ ]
+} \ No newline at end of file
diff --git a/src/pages/_document.jsx b/src/pages/_document.jsx
index dbe210aa..8d3904d0 100644
--- a/src/pages/_document.jsx
+++ b/src/pages/_document.jsx
@@ -8,6 +8,11 @@ export default function MyDocument() {
<Html>
<Head>
<link rel='icon' href='/favicon.ico' />
+ <link rel='manifest' href='/manifest.json' />
+ <link rel='apple-touch-icon' href='/icon.png'></link>
+
+ <meta name='mobile-web-app-capable' content='yes' />
+ <meta name='theme-color' content='#fff' />
<meta name='facebook-domain-verification' content='328wmjs7hcnz74rwsqzxvq50rmbtm2' />
<Script