PageSourceSearch

https://myka.ng/assets/NotificationsPage-Ch7XLDJ9.js

js myka.ng collected 2026-10-09 22:41:54 UTC 3,758 bytes, 1 lines download raw bytes

1import{j as e}from"./vendor-react-DfYGAhtm.js";import{aV as S,o as N,aW as T,aX as w}from"./vendor-icons-1odZwi-b.js";import{t as f,e as u,m as i}from"./index-DsBgCU7r.js";import{f as C,g as P,h as R}from"./vendor-state-BsBVN-fX.js";import{h as c,a as d,i as v,T as l,s as x,F as p,v as O,ah as I,ai as W,aj as k,ak as A}from"./vendor-ui-DA_r9yXk.js";import"./vendor-forms-BP-7CbAP.js";const b=["notification-settings"],E=async()=>{const{data:t}=await u.get("/api/v1/notifications/settings");return t.data},z=async t=>{try{const{data:s}=await u.patch("/api/v1/notifications/settings/toggle",{channel:t});return s.data}catch(s){const o=s;throw o.response?.data?.message??o.message}},F=()=>{const{data:t,isLoading:s,isError:o}=C({queryKey:b,queryFn:E});return{settings:t,isLoading:s,isError:o}},L=()=>{const t=P(),{mutate:s,isPending:o}=R({mutationFn:z,onSuccess:a=>{t.setQueryData(b,a),f.success("Notification settings updated")},onError:a=>{f.error(a||"Failed to update notification settings")}});return{toggle:s,isToggling:o}},m=({icon:t,label:s,description:o,enabled:a,isDisabled:n=!1,onToggle:r})=>e.jsxs(p,{align:{base:"flex-start",sm:"center"},justify:"space-between",direction:{base:"column",sm:"row"},py:3,gap:4,w:"100%",minW:0,children:[e.jsxs(p,{align:"center",gap:3,minW:0,flex:1,children:[e.jsx(p,{align:"center",justify:"center",w:8,h:8,borderRadius:"lg",bg:i.gray[100],flexShrink:0,children:e.jsx(O,{as:t,boxSize:4,color:i.text.primary})}),e.jsxs(d,{children:[e.jsx(l,{fontSize:"sm",fontWeight:"medium",color:i.text.primary,children:s}),e.jsx(l,{fontSize:"xs",color:i.text.info,children:o})]})]}),e.jsxs(I,{alignSelf:{base:"flex-end",sm:"center"},checked:a,onCheckedChange:r,colorPalette:"green",size:"md",disabled:n,flexShrink:0,children:[e.jsx(W,{}),e.jsx(k,{children:e.jsx(A,{})})]})]}),j=[{channel:"IN_APP",icon:S,label:"In-App Notifications",description:"Receive notifications inside the app"},{channel:"PUSH",icon:N,label:"Push Notifications",description:"Receive push notifications on your device"},{channel:"WHATSAPP",icon:T,label:"WhatsApp Notifications",description:"Receive notifications via WhatsApp"}],y=[{type:"PROMOTIONAL",icon:w,label:"Promotions & Offers",description:"Special deals, discounts, and product offers"}],_=j.length+y.length,q=()=>{const{settings:t,isLoading:s}=F(),{toggle:o,isToggling:a}=L();return e.jsxs(c,{gap:6,children:[e.jsxs(d,{children:[e.jsx(v,{fontSize:{base:"2xl",md:"28px"},fontWeight:"bold",color:i.text.label,children:"Notifications"}),e.jsx(l,{fontSize:"md",color:i.text.info,mt:1,children:"Control which notifications you receive"})]}),e.jsxs(d,{border:`1px solid ${i.border.secondary}`,background:`linear-gradient(145deg, white 80%, ${i.orange[50]} 100%)`,borderRadius:"xl",p:4,children:[e.jsx(l,{fontSize:"sm",fontWeight:"semibold",color:i.text.primary,mb:2,children:"Delivery Channels"}),s?e.jsx(c,{gap:3,pt:2,children:Array.from({length:_}).map((n,r)=>e.jsx(x,{height:"48px",borderRadius:"md"},r))}):e.jsx(c,{gap:0,divideY:`1px solid ${i.border.primary}`,children:j.map(({channel:n,icon:r,label:g,description:h})=>e.jsx(m,{icon:r,label:g,description:h,enabled:t?.channels[n]??!1,isDisabled:a,onToggle:()=>o(n)},n))})]}),e.jsxs(d,{border:`1px solid ${i.border.secondary}`,background:`linear-gradient(145deg, white 80%, ${i.orange[50]} 100%)`,borderRadius:"xl",p:4,children:[e.jsx(l,{fontSize:"sm",fontWeight:"semibold",color:i.text.primary,mb:2,children:"Notification Types"}),s?e.jsx(c,{gap:3,pt:2,children:e.jsx(x,{height:"48px",borderRadius:"md"})}):e.jsx(c,{gap:0,divideY:`1px solid ${i.border.primary}`,children:y.map(({type:n,icon:r,label:g,description:h})=>e.jsx(m,{icon:r,label:g,description:h,enabled:t?.types?.[n]??!1,isDisabled:a,onToggle:()=>o(n)},n))})]})]})};export{q as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.