PageSourceSearch

https://app.akindo.io/_next/static/chunks/pages/communities/[communityId]/members-7611c843e290e2de.js

js akindo.io collected 2026-10-04 00:10:13 UTC 10,105 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5036],{26308:(e,t,s)=>{"use strict";s.d(t,{w:()=>l});var a=s(37876),i=s(29255);let l=e=>{let{id:t,children:s}=e;return(0,a.jsx)(i.m_,{id:t,place:"bottom",positionStrategy:"fixed",style:{backgroundColor:"white",color:"black",borderRadius:"8px",padding:"12px 16px",zIndex:9999},className:"shadow-lg z-[9999] !opacity-100 max-w-[320px] md:max-w-[480px]",children:s})}},47937:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>k});var a=s(37876),i=s(50579),l=s(97831),r=s(46571),n=s(71225),d=s(94200),o=s(53432),m=s(14232),c=s(88992),x=s(99788),u=s(34129),h=s(26308);let p=e=>{let{communityId:t,closeModal:s}=e,{register:i,handleSubmit:m,setError:p,formState:{errors:v,isSubmitting:j},reset:f,watch:y}=(0,c.mN)({defaultValues:{role:l.W0.admin}}),g=async e=>{let{email:s,role:a}=e;try{let{data:e}=await r.FH.private.createCommunityInvitation({params:{communityId:t},data:{email:s,role:a}});null==N||N.push(e),f()}catch(e){(0,x.Py)(e,p)}},{data:N,refetch:w}=r.FH.private.useFetchCommunityInvitations({communityId:t});return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"font-bold text-base md:text-2xl text-center",children:"Invite member"}),(0,a.jsxs)("form",{onSubmit:m(g),className:"mt-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(u.l,{title:"Role"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"ml-2 md:ml-4 flex justify-center items-center bg-gray-500 text-white w-5 h-5 text-sm rounded-full","data-tooltip-id":"role",children:"?"}),(0,a.jsxs)(h.w,{id:"role",children:[(0,a.jsx)("div",{className:"text-sm font-bold",children:"What’s the difference?"}),(0,a.jsxs)("div",{className:"text-sm mt-3 space-y-2",children:[(0,a.jsxs)("p",{children:[(0,a.jsx)("strong",{children:"Admin:"})," Can edit pages, manage deposits, judge submissions, and change member roles."]}),(0,a.jsxs)("p",{children:[(0,a.jsx)("strong",{children:"Judge:"})," Can judge submissions (vote, label, comment) and input grant scores but cannot edit pages or manage deposits."]}),(0,a.jsxs)("p",{children:[(0,a.jsx)("strong",{children:"Product Reviewer:"})," Can open the judging modal and leave feedback but grant scores remain 0 automatically."]})]})]})]})]}),(0,a.jsxs)("div",{className:"mt-2 flex items-center gap-4",children:[(0,a.jsxs)("label",{className:"flex items-center gap-1",children:[(0,a.jsx)("input",{className:"input",type:"radio",value:l.W0.admin,...i("role")}),(0,a.jsx)("div",{className:"font-medium",children:"Admin"})]}),(0,a.jsxs)("label",{className:"flex items-center gap-1",children:[(0,a.jsx)("input",{className:"input",type:"radio",value:l.W0.judge,...i("role")}),(0,a.jsx)("div",{className:"font-medium",children:"Judge"})]}),(0,a.jsxs)("label",{className:"flex items-center gap-1",children:[(0,a.jsx)("input",{className:"input",type:"radio",value:l.W0.productReviewer,...i("role")}),(0,a.jsx)("div",{className:"font-medium",children:"Product Reviewer"})]})]}),v.role&&(0,a.jsx)(n.W,{children:v.role.message})]}),(0,a.jsxs)("div",{className:"mt-4",children:[(0,a.jsx)(u.l,{title:"Email"}),(0,a.jsx)("input",{className:"mt-1 input w-full",type:"email",...i("email",{required:{value:!0,message:"Email is required"}}),placeholder:"[email protected]"}),v.email&&(0,a.jsx)(n.W,{children:v.email.message})]}),(0,a.jsx)("div",{className:"mt-4 text-center",children:(0,a.jsx)("button",{className:"btn",disabled:j,children:"Invite"})})]}),(0,a.jsx)("div",{className:"mt-4 text-center",children:(0,a.jsx)(b,{communityId:t,role:y("role"),onSuccess:w,onError:e=>(0,x.Py)(e,p)})}),(0,a.jsxs)("div",{className:"mt-14 border-t pt-3 text-sm",children:[(0,a.jsx)("div",{className:"block md:hidden text-gray-500",children:"Invitee email/Invited by/Invited"}),(0,a.jsxs)("div",{className:"hidden md:flex flex-row md:gap-4 text-gray-500",children:[(0,a.jsx)("div",{className:"flex-1 ",children:"Invitee email"}),(0,a.jsx)("div",{className:"flex-1",children:"Invited by"}),(0,a.jsx)("div",{className:"flex-1",children:"Invited"}),(0,a.jsx)("div",{className:"w-[60px]"})]}),(0,a.jsx)("div",{className:"mt-6 flex flex-col gap-6 max-h-[200px] overflow-y-scroll",children:null==N?void 0:N.map(e=>(0,a.jsxs)("div",{className:"flex flex-col md:flex-row md:gap-4",children:[(0,a.jsx)("div",{className:"md:flex-1 break-all",children:e.email||"-"}),(0,a.jsx)("div",{className:"md:flex-1 break-all",children:e.invitedBy.slug}),(0,a.jsx)("div",{className:"md:flex-1 break-all",children:(0,d.GP)((0,o.H)(e.createdAt),"yyyy-MM-dd HH:mm")}
1),(0,a.jsx)("div",{className:"underline md:w-[60px] md:text-right",onClick:async()=>{await r.FH.private.deleteCommunityInvitation({params:{communityId:t,communityInvitationId:e.id}}),await w()},children:"Cancel"})]},e.id))})]}),(0,a.jsx)("div",{className:"flex justify-center mt-10",children:(0,a.jsx)("button",{type:"button",className:"btn btn-sm btn-tertiary",onClick:s,children:"close"})})]})};function b(e){let{communityId:t,role:s,onSuccess:i,onError:l}=e,[n,d]=(0,m.useState)(!1);return(0,a.jsxs)("div",{className:"inline-block relative",children:[(0,a.jsx)("button",{type:"button",className:"p-2 hover:opacity-80",onClick:async()=>{try{let{data:e}=await r.FH.private.createCommunityInvitation({params:{communityId:t},data:{role:s}}),a=e.otpToken;if(!a)throw Error("Token is not found in the invitation.");i();let l=new URLSearchParams({communityId:t,otpToken:a}).toString(),n="".concat("https://app.akindo.io","/join-community?").concat(l);navigator.clipboard.writeText(n),d(!0),setTimeout(()=>{d(!1)},3e3)}catch(e){l(e)}},children:"Copy the invitation link"}),n&&(0,a.jsx)("div",{className:"absolute z-10 -bottom-14 left-1/2 -translate-x-1/2 bg-gray-500 text-white py-3 px-5 rounded font-bold before:absolute before:-top-5 before:left-1/2 before:-translate-x-1/2 before:w-[24px] before:h-[24px] before:border-[12px] before:border-transparent before:border-b-[12px] before:border-b-gray-500 ",children:"Copied!"})]})}var v=s(88463),j=s(15349),f=s(69241),y=s(89099),g=s(89848);let N=()=>{let e=(0,y.useRouter)(),{loginUser:t}=(0,j.G)(e=>e.loginUser),[s,n]=(0,m.useState)(!1),[d,o]=(0,m.useState)(!1),c=e.query.communityId,{data:x,refetch:u}=r.FH.public.useFetchCommunityMembers({isEnabled:!!c,communityId:c}),h=null==x?void 0:x.find(e=>e.userId===(null==t?void 0:t.id));if(!h||!x)return(0,a.jsx)(a.Fragment,{});if(h.role!==l.W0.admin)return e.push(l.Ub.community({communityId:c})),(0,a.jsx)(a.Fragment,{});let b=async(e,t)=>{o(!0);try{await r.FH.private.updateCommunityMemberRole({params:{communityMemberId:e},data:{role:t}})}catch(e){console.error(e),alert("Failed to update role")}finally{await u(),o(!1)}},f=x.filter(e=>e.userId!==(null==t?void 0:t.id)).filter(e=>e.role===l.W0.admin);return(0,a.jsxs)("main",{children:[(0,a.jsxs)("div",{className:"container pt-4 md:pt-6 pb-6 md:pb-20",children:[(0,a.jsx)(v.n,{href:l.Ub.community({communityId:c}),label:"Team"}),(0,a.jsxs)("div",{className:"bg-white rounded-t mt-4 overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between py-4 px-3 md:px-6 bg-gray-200",children:[(0,a.jsx)("h1",{className:"text-lg font-medium",children:"Members"}),(0,a.jsx)("button",{type:"button",className:"btn btn-sm btn-tertiary",onClick:()=>{n(!s)},children:"Invite member"})]}),(0,a.jsx)("ul",{className:"border-t",children:x.map(e=>{var t,s,r,n;return(0,a.jsx)("li",{className:"border-b",children:(0,a.jsxs)("div",{className:"flex items-center justify-between py-4 px-3 md:px-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 min-w-0 flex-auto",children:[(0,a.jsx)(i.e,{src:null==(s=e.user)||null==(t=s.iconAsset)?void 0:t.url,alt:null==(r=e.user)?void 0:r.slug,size:"sm"}),(0,a.jsx)("div",{className:"break-words text-sm line-clamp-1 min-w-0 flex-auto",children:null==(n=e.user)?void 0:n.slug})]}),(0,a.jsxs)("div",{className:"flex-none",children:[(0,a.jsx)("select",{className:"input w-[180px]",disabled:d||e.id===h.id&&0===f.length,defaultValue:e.role,onChange:async t=>await b(e.id,t.target.value),children:[l.W0.admin,l.W0.judge,l.W0.productReviewer].map(e=>(0,a.jsx)("option",{value:e,children:l.l4[e].label},e))}),(e.role===l.W0.productReviewer||e.role===l.W0.judge)&&(0,a.jsx)("div",{className:"mt-2 flex justify-end",children:(0,a.jsx)(w,{communityMemberId:e.id,onSuccess:u})})]})]})},e.id)})})]}),(0,a.jsx)("div",{className:"mt-4 text-white text-center text-sm",children:"Leaving the Admin role will revoke access to this page."})]}),s&&(0,a.jsxs)("div",{className:"modal",children:[(0,a.jsx)("div",{className:"modal-backdrop",onClick:()=>{n(!1)}}),(0,a.jsx)("div",{className:"modal-body max-h-[80%] overflow-y-scroll",children:(0,a.jsx)("div",{className:"bg-white rounded-sm md:rounded-lg p-5 md:p-10 pb-10",children:(0,a.jsx)(p,{communityId:c,closeModal:()=>{n(!1)}})})})]})]})};
1function w(e){let{communityMemberId:t,onSuccess:s}=e,[i,l]=(0,m.useState)(!1),n=async()=>{if(l(!0),confirm("Are you sure you want to remove this member?"))try{await r.FH.private.deleteCommunityMember({params:{communityMemberId:t}}),g.oR.success("Member removed"),await s()}catch(e){console.error(e),g.oR.error("Failed to remove member")}finally{l(!1)}else l(!1)};return(0,a.jsx)("button",{type:"button",className:(0,f.A)("text-xs font-medium border px-4 py-1 rounded-sm duration-100","bg-gray-100 text-red border-gray-200","hover:bg-red hover:text-white hover:border-red","disabled:opacity-50 disabled:bg-gray-100 disabled:text-red disabled:border-gray-200"),onClick:n,disabled:i,children:i?"Removing...":"Remove"})}let k=N;N.isAuthRequired=!0},67372:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/communities/[communityId]/members",function(){return s(47937)}])},88463:(e,t,s)=>{"use strict";s.d(t,{n:()=>n});var a=s(37876),i=s(48230),l=s.n(i),r=s(43986);function n(e){let{href:t,label:s,color:i="white"}=e;return(0,a.jsxs)(l(),{href:t,className:"py-2 text-sm ".concat("white"===i?"text-white":"text-black"," inline-flex items-center gap-1"),children:[(0,a.jsx)(r.Qfe,{size:"24"}),(0,a.jsx)("div",{children:s})]})}}},e=>{e.O(0,[9255,636,6593,8792],()=>e(e.s=67372)),_N_E=e.O()}]);

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.