PageSourceSearch

https://tokensforgood.ai/build/assets/AppLayout-BBqBm-cI.js

js tokensforgood.ai collected 2026-10-05 13:57:15 UTC 8,343 bytes, 1 lines download raw bytes

1import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{d as t,l as n,s as r}from"./react-core-C0RTCiLt.js";import{_ as i,v as a}from"./markdown-CBy1fUPi.js";import{t as o}from"./ApplicationLogo-BnvKk4NE.js";var s=e(a(),1),c=i();function l(){let{props:e}=t(),n=e.flash,r=n?.error??n?.status??null,i=!!n?.error,[a,o]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{if(!r){o(!1);return}o(!0);let e=setTimeout(()=>o(!1),6e3);return()=>clearTimeout(e)},[n,r]),!r||!a?null:(0,c.jsx)(`div`,{className:`max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 pt-4`,children:(0,c.jsxs)(`div`,{role:`status`,"aria-live":`polite`,className:`flex items-start gap-3 rounded-xl border px-4 py-3 text-sm ${i?`border-red-200 bg-red-50 text-red-800`:`border-green-200 bg-green-50 text-green-800`}`,children:[(0,c.jsx)(`span`,{className:`flex-1`,children:r}),(0,c.jsx)(`button`,{onClick:()=>o(!1),"aria-label":`Dismiss notification`,className:`opacity-60 hover:opacity-100 text-lg leading-none`,children:`×`})]})})}function u({activeTab:e,children:i}){let{url:a,props:u}=t(),d=u.auth?.user??null,f=u.isReviewer,p=u.isAdmin,m=u.isContributor,h=u.canViewAsUser,g=u.viewingAsUser,[_,v]=(0,s.useState)(!1),y=(0,s.useRef)(null),b=e||(a.startsWith(`/admin`)?`admin`:a.startsWith(`/review/`)?`review`:a.startsWith(`/contributor`)?`dashboard`:a.startsWith(`/saved`)?`saved`:a.startsWith(`/directory`)?`directory`:``),x=[...m?[{key:`dashboard`,label:`Dashboard`,href:`/contributor/dashboard`}]:[],{key:`directory`,label:`Directory`,href:`/directory`},...f?[{key:`review`,label:`Review`,href:`/review/contributions`}]:[],...p?[{key:`admin`,label:`Admin`,href:`/admin/users`}]:[]];return(0,s.useEffect)(()=>{function e(e){y.current&&!y.current.contains(e.target)&&v(!1)}function t(e){e.key===`Escape`&&v(!1)}return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[]),(0,c.jsxs)(`div`,{className:`min-h-screen bg-gray-50 flex flex-col`,children:[g&&(0,c.jsx)(`div`,{className:`sticky top-0 z-50 bg-amber-600 text-white text-sm`,children:(0,c.jsxs)(`div`,{className:`max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-1.5 flex items-center justify-center gap-3`,children:[(0,c.jsx)(`span`,{children:`Viewing as a normal user; admin features are hidden.`}),(0,c.jsx)(`button`,{onClick:()=>n.post(`/view-as-user/toggle`,{},{preserveScroll:!0}),className:`underline font-medium hover:text-amber-100`,children:`Exit user view`})]})}),(0,c.jsx)(`header`,{className:`bg-white border-b border-gray-200`,children:(0,c.jsxs)(`div`,{className:`max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 pt-6 sm:pt-8 pb-0`,children:[(0,c.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,c.jsxs)(r,{href:`/`,className:`flex items-center gap-3 group min-w-0 flex-shrink`,children:[(0,c.jsx)(o,{className:`w-10 h-10 sm:w-12 sm:h-12 shrink-0`}),(0,c.jsxs)(`div`,{className:`min-w-0`,children:[(0,c.jsx)(`div`,{className:`text-xl sm:text-3xl font-bold tracking-snug text-fierce-600`,children:`Tokens for Good`}),(0,c.jsx)(`p`,{className:`mt-1 sm:mt-1.5 text-gray-500 text-xs sm:text-sm`,children:`Evidence-based directory of social impact organizations`})]})]}),(0,c.jsx)(`div`,{className:`flex items-center gap-2 sm:gap-3 pt-1 flex-shrink-0`,children:d?(0,c.jsxs)(`div`,{className:`relative`,ref:y,children:[(0,c.jsxs)(`button`,{onClick:()=>v(!_),"aria-label":`Open account menu`,"aria-haspopup":`menu`,"aria-expanded":_,className:`flex items-center gap-2 min-h-[44px] px-2 sm:px-3 py-1.5 rounded-lg text-sm text-gray-700 hover:bg-gray-100 transition-colors`,children:[(0,c.jsx)(`div`,{className:`w-8 h-8 sm:w-7 sm:h-7 rounded-full bg-fierce-100 text-fierce-600 flex items-center justify-center text-xs font-bold`,children:d.name.charAt(0).toUpperCase()}),(0,c.jsx)(`span`,{className:`hidden sm:inline font-medium`,children:d.name}),(0,c.jsx)(`svg`,{className:`w-4 h-4 text-gray-400`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,children:(0,c.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M19 9l-7 7-7-7`})})]}),_&&(0,c.jsxs)(`div`,{className:`absolute right-0 mt-1 w-48 bg-white rounded-lg shadow-lg border border-gray-200 py-1 z-50`,children:[(0,c.jsxs)(`div`,{className:`px-3 py-2 border-b border-gray-100`,children:[(0,c.jsx)(`p`,{className:`text-sm font-medium text-gray-900 truncate`,children:d.name}),(0,c.jsx)(`p`,{className:`text-xs text-gray-500 truncate`,children:d.email}),(0,c.jsx)(`span`,{className:`inline-block mt-1 px-1.5 py-0.5 text-[10px] font-medium rounded capitalize ${g?`bg-amber-100 text-amber-700`:`bg-fierce-50 text-fierce-600`}`,children:g?`Viewing as user`:d.role.replace(`_`,` `)})]}),h&&(0,c.jsx)(`button`,{onClick:()=>{v(!1),n.post(`/view-as-user/toggle`,{},{preserveScroll:!0})},className:`block w-full text-left px-3 py-2 text-sm text-gray-700 hover:bg-gray-50`,children:g?`Exit user view`:`View as User`}),(0,c.jsx)(r,{href:`/saved`,className:`block px-3 py-2 text-sm text-gray-700 hover:bg-gray-50`,onClick:()=>v(!1),children:`Saved Organizations`}),(0,c.jsx)(r,{href:`/profile`,className:`block px-3 py-2 text-sm text-gray-700 hover:bg-gray-50`,onClick:()=>v(!1),children:`Profile`}),(0,c.jsx)(r,{href:`/support`,className:`block px-3 py-2 text-sm text-gray-700 hover:bg-gray-50`,onClick:()=>v(!1),children:`Help & support`}),(0,c.jsx)(`button`,{onClick:()=>{v(!1),n.post(`/logout`)},className:`block w-full text-left px-3 py-2 text-sm text-gray-700 hover:bg-gray-50`,children:`Log Out`})]})]}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(r,{href:`/login`,className:`inline-flex items-center min-h-[44px] px-3 py-2 text-sm font-medium text-gray-600 hover:text-gray-800 transition-colors`,children:`Log In`}),(0,c.jsx)(r,{href:`/register`,className:`inline-flex items-center min-h-[44px] px-4 py-2 text-sm font-medium text-white bg-fierce-600 rounded-lg hover:bg-fierce-700 transition-colors`,children:`Sign Up`})]})})]}),(0,c.jsx)(`nav`,{className:`mt-4 sm:mt-6 flex gap-4 sm:gap-6 border-b border-gray-200 -mb-px overflow-x-auto overscroll-x-contain [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,"aria-label":`Primary`,children:x.map(e=>{let t=`pb-3 pt-1 px-1 text-sm font-medium border-b-2 whitespace-nowrap min-h-[44px] inline-flex items-center transition-colors ${b===e.key?`border-fierce-600 text-fierce-600`:`border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300`}`;return e.external?(0,c.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,className:t,children:[e.label,(0,c.jsx)(`svg`,{"aria-hidden":`true`,className:`ml-1 w-3.5 h-3.5 text-gray-400`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:(0,c.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M7 17L17 7M17 7H9m8 0v8`})})]},e.key):(0,c.jsx)(r,{href:e.href,prefetch:`hover`,className:t,children:e.label},e.key)})})]})}),(0,c.jsxs)(`main`,{className:`flex-1`,children:[(0,c.jsx)(l,{}),i]}),(0,c.jsx)(`footer`,{className:`bg-white border-t border-gray-100 mt-12`,children:(0,c.jsx)(`div`,{className:`max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8`,children:(0,c.jsxs)(`div`,{className:`flex flex-col sm:flex-row justify-between gap-6`,children:[(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`p`,{className:`text-sm font-semibold text-gray-900`,children:`Tokens for Good`}),(0,c.jsx)(`p`,{className:`text-xs text-gray-400 mt-1`,children:`Evidence-based directory of social impact organizations`})]}),(0,c.jsxs)(`div`,{className:`flex flex-wrap gap-x-6 gap-y-2`,children:[(0,c.jsx)(r,{href:`/methodology`,className:`text-sm text-gray-500 hover:text-gray-700`,children:`Methodology`}),(0,c.jsx)(r,{href:`/how-research-works`,className:`text-sm text-gray-500 hover:text-gray-700`,children:`How Research Works`}),(0,c.jsx)(`a`,{href:`/docs`,className:`text-sm text-gray-500 hover:text-gray-700`,children:`Docs`}),(0,c.jsx)(`a`,{href:`/security`,className:`text-sm text-gray-500 hover:text-gray-700`,children:`Security`}),(0,c.jsx)(`a`,{href:`/guides`,className:`text-sm text-gray-500 hover:text-gray-700`,children:`Guides`}),(0,c.jsx)(r,{href:`/contributors`,className:`text-sm text-gray-500 hover:text-gray-700`,children:`Contributors`}),(0,c.jsx)(r,{href:`/submit`,className:`text-sm text-gray-500 hover:text-gray-700`,children:`Submit an Org`})]})]})})})]})}export{u as t};

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.