diff --git a/.gitignore b/.gitignore index 738df3e..9df2aeb 100644 --- a/.gitignore +++ b/.gitignore @@ -10,8 +10,16 @@ lerna-debug.log* .yarn-integrity .npm -.eslintcache +# PWA files +**/public/sw.js +**/public/workbox-*.js +**/public/worker-*.js +**/public/sw.js.map +**/public/workbox-*.js.map +**/public/worker-*.js.map + +.eslintcache *.tsbuildinfo next-env.d.ts diff --git a/next.config.js b/next.config.js index 32d4f12..687075b 100644 --- a/next.config.js +++ b/next.config.js @@ -1,6 +1,10 @@ const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer'); -module.exports = { +const withPWA = require('next-pwa')({ + dest: 'public' +}) + +module.exports = withPWA({ typescript: { // !! WARN !! // Dangerously allow production builds to successfully complete even if @@ -42,4 +46,4 @@ module.exports = { return config; }, -} \ No newline at end of file +}) \ No newline at end of file diff --git a/pages/_app.tsx b/pages/_app.tsx index 6538651..396c3d5 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -1,4 +1,5 @@ import { SessionProvider } from "next-auth/react" +import type { Metadata } from "next" import "../styles/styles.css" import "../styles/global.css" import "tailwindcss/tailwind.css" @@ -13,6 +14,39 @@ import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs' // Use of the is mandatory to allow components that call // `useSession()` anywhere in your application to access the `session` object. +export const metadata: Metadata = { + title: "Специално Свидетелстване София", + description: "Специално Свидетелстване София", + /// manifest: "/manifest.json", + // manifest: { + // theme_color: "#000000", + // background_color: "#ffffff", + // icons: [ + // { + // purpose: "maskable", + // sizes: "512x512", + // src: "favicon.png", + // type: "image/png" + // }, + // { + // purpose: "any", + // sizes: "512x512", + // src: "favicon.png", + // type: "image/png" + // } + // ], + // orientation: "any", + // display: "standalone", + // dir: "auto", + // lang: "en-US", + // name: "Специално Свидетелстване София", + // short_name: "ССС", + // start_url: "/", + // scope: "/cart" + // }, +} + + export default function App({ Component, pageProps: { session, ...pageProps }, @@ -28,13 +62,6 @@ export default function App({ return ( <> - - {/* Other tags */} - - diff --git a/pages/_document.tsx b/pages/_document.tsx new file mode 100644 index 0000000..e2a517a --- /dev/null +++ b/pages/_document.tsx @@ -0,0 +1,27 @@ +import Document, { Html, Head, Main, NextScript } from "next/document"; + +class MyDocument extends Document { + render() { + return ( + + + + + + + + + + +
+ + + + ); + } +} + +export default MyDocument; diff --git a/public/manifest.json b/public/manifest.json new file mode 100644 index 0000000..8e0cc91 --- /dev/null +++ b/public/manifest.json @@ -0,0 +1,26 @@ +{ + "theme_color": "#ffffff", + "background_color": "#e36600", + "icons": [ + { + "purpose": "maskable", + "sizes": "512x512", + "src": "favicon.png", + "type": "image/png" + }, + { + "purpose": "any", + "sizes": "512x512", + "src": "favicon.png", + "type": "image/png" + } + ], + "orientation": "any", + "display": "standalone", + "dir": "auto", + "lang": "en-US", + "name": "Специално Свидетелстване София", + "short_name": "ССС", + "start_url": "/", + "scope": "/cart" +} \ No newline at end of file