merge leftovers
This commit is contained in:
@ -216,22 +216,13 @@ function PwaManager() {
|
||||
{isPWAInstalled && <p>App is installed!</p>}
|
||||
{isStandAlone && <p>PWA App</p>}
|
||||
<button
|
||||
onClick={subscribeToNotifications}
|
||||
disabled={isSubscribed}
|
||||
className={`text-xs py-1 px-2 rounded-full focus:outline-none transition duration-150 ease-in-out ${isSubscribed ? 'cursor-not-allowed bg-gray-300 text-gray-500' : 'bg-green-500 hover:bg-green-700 text-white'
|
||||
onClick={isSubscribed ? unsubscribeFromNotifications : subscribeToNotifications}
|
||||
disabled={false} // Since the button itself acts as a toggle, the disabled attribute might not be needed
|
||||
className={`text-xs py-1 px-2 rounded-full focus:outline-none transition duration-150 ease-in-out ${isSubscribed ? 'bg-red-500 hover:bg-red-700 text-white' : 'bg-green-500 hover:bg-green-700 text-white'
|
||||
}`}
|
||||
>
|
||||
Subscribe to Notifications
|
||||
{isSubscribed ? 'Unsubscribe from Notifications' : 'Subscribe to Notifications'}
|
||||
</button>
|
||||
<button
|
||||
onClick={unsubscribeFromNotifications}
|
||||
disabled={!isSubscribed}
|
||||
className={`text-xs py-1 px-2 rounded-full focus:outline-none transition duration-150 ease-in-out ${!isSubscribed ? 'cursor-not-allowed bg-gray-300 text-gray-500' : 'bg-red-500 hover:bg-red-700 text-white'
|
||||
}`}
|
||||
>
|
||||
Unsubscribe from Notifications
|
||||
</button>
|
||||
|
||||
|
||||
</div >
|
||||
<div>
|
||||
|
@ -18,7 +18,7 @@ module.exports = withPWA({
|
||||
// !! WARN !!
|
||||
ignoreBuildErrors: true,
|
||||
},
|
||||
compress: false,
|
||||
compress: true,
|
||||
pageExtensions: ['ts', 'tsx', 'md', 'mdx'], // Replace `jsx?` with `tsx?`
|
||||
env: {
|
||||
env: process.env.APP_ENV,
|
||||
@ -52,7 +52,24 @@ module.exports = withPWA({
|
||||
//config.productionBrowserSourceMaps = true;
|
||||
// Enable source maps based on non-production environments
|
||||
if (!dev) {
|
||||
config.devtool = 'source-map';
|
||||
//config.devtool = 'source-map';
|
||||
/* ⨯ TypeError: Invalid character in header content ["Location"]
|
||||
at ServerResponse.setHeader (node:_http_outgoing:655:3)
|
||||
at _res.setHeader (D:\DEV\workspace\REPOS\git.d-popov.com\mwhitnessing\node_modules\next\dist\server\base-server.js:481:24)
|
||||
at NodeNextResponse.setHeader (D:\DEV\workspace\REPOS\git.d-popov.com\mwhitnessing\node_modules\next\dist\server\base-http\node.js:74:19)
|
||||
at NodeNextResponse.redirect (D:\DEV\workspace\REPOS\git.d-popov.com\mwhitnessing\node_modules\next\dist\server\base-http\index.js:43:14)
|
||||
at handleRedirect (D:\DEV\workspace\REPOS\git.d-popov.com\mwhitnessing\node_modules\next\dist\server\base-server.js:1208:17)
|
||||
at DevServer.renderToResponseWithComponentsImpl (D:\DEV\workspace\REPOS\git.d-popov.com\mwhitnessing\node_modules\next\dist\server\base-server.js:1666:23)
|
||||
at async DevServer.renderPageComponent (D:\DEV\workspace\REPOS\git.d-popov.com\mwhitnessing\node_modules\next\dist\server\base-server.js:1856:24)
|
||||
at async DevServer.renderToResponseImpl (D:\DEV\workspace\REPOS\git.d-popov.com\mwhitnessing\node_modules\next\dist\server\base-server.js:1894:32)
|
||||
at async DevServer.pipeImpl (D:\DEV\workspace\REPOS\git.d-popov.com\mwhitnessing\node_modules\next\dist\server\base-server.js:911:25)
|
||||
at async NextNodeServer.handleCatchallRenderRequest (D:\DEV\workspace\REPOS\git.d-popov.com\mwhitnessing\node_modules\next\dist\server\next-server.js:271:17)
|
||||
at async DevServer.handleRequestImpl (D:\DEV\workspace\REPOS\git.d-popov.com\mwhitnessing\node_modules\next\dist\server\base-server.js:807:17)
|
||||
at async D:\DEV\workspace\REPOS\git.d-popov.com\mwhitnessing\node_modules\next\dist\server\dev\next-dev-server.js:331:20
|
||||
at async Span.traceAsyncFn (D:\DEV\workspace\REPOS\git.d-popov.com\mwhitnessing\node_modules\next\dist\trace\trace.js:151:20)
|
||||
at async DevServer.handleRequest (D:\DEV\workspace\REPOS\git.d-popov.com\mwhitnessing\node_modules\next\dist\server\dev\next-dev-server.js:328:24) {
|
||||
code: 'ERR_INVALID_CHAR',
|
||||
page: '/cart/publishers/edit/react_devtools_backend_compact.js.map' */
|
||||
}
|
||||
// Add custom fallbacks
|
||||
config.resolve.fallback = { ...config.resolve.fallback, fs: false };
|
||||
|
@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "pwwa",
|
||||
"version": "1.2.2",
|
||||
"name": "smws",
|
||||
"version": "1.2.4",
|
||||
"private": true,
|
||||
"description": "JW PW Web App",
|
||||
"description": "SMWS | ССОМ | Специално Свидетелстване София",
|
||||
"repository": "http://git.d-popov.com/popov/next-cart-app.git",
|
||||
"bugs": {
|
||||
"url": "https://git.d-popov.com/popov/next-cart-app/issues"
|
||||
|
@ -120,6 +120,8 @@ nextApp
|
||||
next();
|
||||
});
|
||||
server.use("/favicon.ico", express.static("public/favicon.png"));
|
||||
//all static files are served from the public folder, including subfolders
|
||||
server.use(express.static("public")); //ToDo: not working for some reason
|
||||
// server.use("/robots.txt", express.static("styles/favicon_io/robots.txt"));
|
||||
// server.use("/sitemap.xml", express.static("styles/favicon_io/sitemap.xml"));
|
||||
|
||||
|
@ -24,7 +24,8 @@ self.addEventListener('push', function (event) {
|
||||
event.waitUntil(
|
||||
registration.showNotification(data.title, {
|
||||
body: data.message,
|
||||
icon: '/icons/android-chrome-192x192.png'
|
||||
icon: '/favicon.ico',
|
||||
actions: data.actions,
|
||||
})
|
||||
)
|
||||
})
|
||||
|
Reference in New Issue
Block a user