more merge
This commit is contained in:
@ -216,15 +216,24 @@ function PwaManager() {
|
|||||||
{isPWAInstalled && <p>App is installed!</p>}
|
{isPWAInstalled && <p>App is installed!</p>}
|
||||||
{isStandAlone && <p>PWA App</p>}
|
{isStandAlone && <p>PWA App</p>}
|
||||||
<button
|
<button
|
||||||
onClick={isSubscribed ? unsubscribeFromNotifications : subscribeToNotifications}
|
onClick={subscribeToNotifications}
|
||||||
disabled={false} // Since the button itself acts as a toggle, the disabled attribute might not be needed
|
disabled={isSubscribed}
|
||||||
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'
|
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'
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
{isSubscribed ? 'Unsubscribe from Notifications' : 'Subscribe to 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>
|
</button>
|
||||||
|
|
||||||
</div >
|
|
||||||
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button
|
||||||
onClick={sendTestNotification}
|
onClick={sendTestNotification}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
|
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
|
||||||
//we're currently using next-pwa (which uses GeneraeSW automatically), so we don't need to use workbox-webpack-plugin
|
//we're currently using next-pwa (which uses GeneraeSW automatically), so we don't need to use workbox-webpack-plugin
|
||||||
const { InjectManifest, GenerateSW } = require('workbox-webpack-plugin');
|
// const { InjectManifest, GenerateSW } = require('workbox-webpack-plugin');
|
||||||
|
|
||||||
const withPWA = require('next-pwa')({
|
const withPWA = require('next-pwa')({
|
||||||
dest: 'public',
|
dest: 'public',
|
||||||
|
Reference in New Issue
Block a user