1 line
3.3 KiB
JavaScript
1 line
3.3 KiB
JavaScript
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3751],{5263:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/unsubscribe",function(){return s(9911)}])},9625:(e,t,s)=>{"use strict";s.d(t,{A:()=>c});var r=s(4848),n=s(6540);function c(e){let{pageTitle:t,pageDescription:s,pagePathname:c,aceEditor:a}=e;return(0,r.jsxs)(n.Fragment,{children:[(0,r.jsx)("link",{rel:"canonical",href:"http://localhost:7070"+c}),(0,r.jsx)("meta",{property:"og:url",content:"http://localhost:7070"+c}),(0,r.jsx)("meta",{itemProp:"url",content:"http://localhost:7070"+c}),(0,r.jsx)("meta",{name:"twitter:url",content:"http://localhost:7070"+c}),(0,r.jsx)("meta",{property:"og:title",content:t}),(0,r.jsx)("meta",{property:"og:description",content:s}),(0,r.jsx)("meta",{itemProp:"name",content:t}),(0,r.jsx)("meta",{itemProp:"description",content:s}),(0,r.jsx)("meta",{name:"twitter:title",content:t}),(0,r.jsx)("meta",{name:"twitter:description",content:s}),a&&(0,r.jsxs)(n.Fragment,{children:[(0,r.jsx)("script",{src:"https://cdnjs.cloudflare.com/ajax/libs/ace/1.22.0/ace.min.js",integrity:"sha512-q6CTB0jS+VuJnSct82rVcWlI06LGzNjaG3CWenHWVUncRvc4UQMFkA3a5Ip880xr+lBx38FcHDclOxPdSg+sBw==",crossOrigin:"anonymous",referrerPolicy:"no-referrer"}),(0,r.jsx)("script",{src:"https://cdnjs.cloudflare.com/ajax/libs/ace/1.22.0/ext-language_tools.min.js",integrity:"sha512-6g6cvocV7eT/J8L44lL8gJKqq9onqQeYGgJO0DmrsYFcCfRl6wYkYA/KHS768r4QVTB4JxsCcMQ9gIezxpTCZw==",crossOrigin:"anonymous",referrerPolicy:"no-referrer"})]})]})}},9911:(e,t,s)=>{"use strict";s.r(t),s.d(t,{__N_SSP:()=>o,default:()=>m});var r=s(4848),n=s(6540),c=s(1710),a=s(9625),l=s(9020),i=s(4252),o=!0;function m(e){let{user:t,email:s,productionEnvironment:o,existingAlerts:m}=e,x="Unsubscribe | Datasquirel",h="Unsubscribe from email alerts",d=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("title",{children:x}),(0,r.jsx)("meta",{name:"description",content:h}),(0,r.jsx)(a.A,{pageTitle:x,pageDescription:h,pagePathname:"/unsubscribe"})]}),[u,p]=n.useState(!1);return(0,r.jsx)(n.Fragment,{children:(0,r.jsx)(i.A,{head:d,user:t,productionEnvironment:o,children:(0,r.jsx)("main",{children:(0,r.jsxs)("section",{children:[u&&(0,r.jsx)(c.A,{}),(0,r.jsxs)("div",{className:"flex-col",children:[(0,r.jsx)("h1",{className:"text-2xl",children:"Unsubscribe from Email alerts"}),!s&&(0,r.jsxs)("p",{className:"max-w-md",children:["No email please ",(0,r.jsx)("a",{href:"/login",children:"Login"})," ","to Access Email Subscriptions or click on"," ",(0,r.jsx)("i",{children:'"unsubscribe"'})," from your mail box"]}),s&&(0,r.jsxs)("form",{className:"flex flex-col items-start gap-4",onSubmit:e=>{e.preventDefault(),p(!0);let r=e.target;(0,l.A)("/api/unsubscribe",{method:"post",body:{email:s,alerts:r.alerts_checkbox.checked,userId:(null==t?void 0:t.id)?t.id:null}}).then(e=>{console.log(e),p(!1)})},children:[(0,r.jsx)("span",{className:"bg-slate-100 py-1 px-3 rounded-full",children:s}),(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsx)("input",{type:"checkbox",name:"alerts_checkbox",id:"alerts_checkbox",defaultChecked:!!m,className:"w-6 h-6"}),(0,r.jsx)("label",{htmlFor:"alerts_checkbox",className:"text-base whitespace-nowrap text-slate-800",children:"Alerts"})]}),(0,r.jsx)("button",{children:"Save Settings"})]})]})]})})})})}}},e=>{var t=t=>e(e.s=t);e.O(0,[636,6593,8792],()=>t(5263)),_N_E=e.O()}]); |