You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
4.3 KiB
1 lines
4.3 KiB
var U=Object.defineProperty;var g=(t,e,r)=>e in t?U(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var o=(t,e,r)=>g(t,typeof e!="symbol"?e+"":e,r);import{V as D,f as I,e as _,C as A,_ as x,g as w,h as c,i as n,j as a,k as l,w as h,l as j,F as P,x as d,z as k,t as u}from"./index-BLqts8WY.js";import{E as C}from"./EntityIcon-CF1RwQI5.js";import{G as N}from"./GiftedDialog-CFmou4Be.js";import{I as S}from"./InfiniteScroll-B5tl9k_n.js";import{Q as E}from"./QuickNav-DgCyvgDx.js";import{h as V,A as $,e as B,ay as T}from"./index-MyY_xqVN.js";import"./index-CsfPLOYu.js";var M=Object.defineProperty,R=Object.getOwnPropertyDescriptor,J=(t,e,r,f)=>{for(var i=f>1?void 0:f?R(e,r):e,m=t.length-1,p;m>=0;m--)(p=t[m])&&(i=(f?p(e,r,i):p(i))||i);return f&&i&&M(e,r,i),i};let O=class extends D{constructor(){super(...arguments);o(this,"$notify");o(this,"activeDid","");o(this,"allContacts",[]);o(this,"allMyDids",[]);o(this,"apiServer","");o(this,"lastAckedOfferToUserProjectsJwtId","");o(this,"newOffersToUserProjects",[]);o(this,"newOffersToUserProjectsAtEnd",!1);o(this,"showOffersDetails",!1);o(this,"showOffersToUserProjectsDetails",!1);o(this,"didInfo",V);o(this,"displayAmount",$)}async created(){try{const e=await I();this.apiServer=e.apiServer||"",this.activeDid=e.activeDid||"",this.lastAckedOfferToUserProjectsJwtId=e.lastAckedOfferToUserProjectsJwtId||"",this.allContacts=await _.contacts.toArray(),this.allMyDids=await B();const r=await T(this.axios,this.apiServer,this.activeDid,void 0,void 0);this.newOffersToUserProjects=r.data,this.newOffersToUserProjectsAtEnd=!r.hitLimit}catch(e){console.error("Error retrieving settings & contacts:",e),this.$notify({group:"alert",type:"danger",title:"Error",text:e.message||"There was an error retrieving your activity."},5e3)}}async loadMoreOffersToUserProjects(){if(this.newOffersToUserProjectsAtEnd)return;const e=await T(this.axios,this.apiServer,this.activeDid,void 0,this.newOffersToUserProjects[this.newOffersToUserProjects.length-1].jwtId);this.newOffersToUserProjects.push(...e.data),this.newOffersToUserProjectsAtEnd=!e.hitLimit}};O=J([A({components:{EntityIcon:C,GiftedDialog:N,InfiniteScroll:S,QuickNav:E}})],O);const Q={id:"Content",class:"p-6 pb-24 max-w-3xl mx-auto"},Y={id:"ViewBreadcrumb",class:"mb-8"},F={class:"text-lg text-center font-light relative px-7"},L={key:0},G={class:"mt-2"},z={class:"mt-2"},H={"data-testId":"listRecentOffersToUserProjects",class:"border-t border-slate-300"},q={key:0,class:"border-b border-slate-300 text-orange-400 pb-2 mb-2 font-bold text-sm"},K={key:1},W={key:2};function X(t,e,r,f,i,m){const p=w("QuickNav"),v=w("fa"),y=w("router-link"),b=w("InfiniteScroll");return d(),c(P,null,[n(p,{selected:"Home"}),a("section",Q,[a("div",Y,[a("h1",F,[n(v,{icon:"chevron-left",onClick:e[0]||(e[0]=s=>t.$router.back()),class:"fa-fw text-lg text-center px-2 py-1 absolute -left-2 -top-1"}),e[1]||(e[1]=l(" Offers to Your Projects "))])]),t.newOffersToUserProjects.length===0?(d(),c("div",L,[e[6]||(e[6]=a("p",null,"Nobody has given any offers to your projects.",-1)),a("p",G,[e[3]||(e[3]=l(" Maybe there are already some projects you can help on the ")),n(y,{to:"/discover",class:"text-blue-500"},{default:h(()=>[e[2]||(e[2]=l(" Discover page ")),n(v,{icon:"search"})]),_:1})]),a("p",z,[e[5]||(e[5]=l(" You can announce more of your own on ")),n(y,{to:"/contacts",class:"text-blue-500"},{default:h(()=>[e[4]||(e[4]=l(" Your Ideas page ")),n(v,{icon:"hand"})]),_:1})])])):j("",!0),n(b,{onReachedBottom:t.loadMoreOffersToUserProjects},{default:h(()=>[a("ul",H,[(d(!0),c(P,null,k(t.newOffersToUserProjects,s=>(d(),c("li",{key:s.jwtId,class:"mt-4 relative group"},[s.jwtId==t.lastAckedOfferToUserProjectsJwtId?(d(),c("div",q," You've already seen all the following ")):j("",!0),a("span",null,u(t.didInfo(s.offeredByDid,t.activeDid,t.allMyDids,t.allContacts)),1),e[7]||(e[7]=l(" offered ")),s.objectDescription?(d(),c("span",K,u(s.objectDescription),1)):j("",!0),l(u(s.objectDescription&&s.amount?", and ":"")+" ",1),s.amount?(d(),c("span",W,u(t.displayAmount(s.unit,s.amount)),1)):j("",!0),e[8]||(e[8]=l(" to ")),a("span",null,u(s.planName),1),n(y,{to:{path:"/claim/"+encodeURIComponent(s.jwtId)},class:"text-blue-500"},{default:h(()=>[n(v,{icon:"file-lines",class:"pl-2 text-blue-500 cursor-pointer"})]),_:2},1032,["to"])]))),128))])]),_:1},8,["onReachedBottom"])])],64)}const ie=x(O,[["render",X]]);export{ie as default};
|
|
|