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.0 KiB
1 lines
4.0 KiB
var D=Object.defineProperty;var _=(t,e,s)=>e in t?D(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var o=(t,e,s)=>_(t,typeof e!="symbol"?e+"":e,s);import{V as I,f as A,e as x,C as k,_ as C,g as m,h as a,i as l,j as d,k as c,w as y,l as w,F as U,x as f,z as j,t as h}from"./index-BLqts8WY.js";import{G as S}from"./GiftedDialog-CFmou4Be.js";import{E as V}from"./EntityIcon-CF1RwQI5.js";import{I as E}from"./InfiniteScroll-B5tl9k_n.js";import{Q as N}from"./QuickNav-DgCyvgDx.js";import{h as $,A as B,e as R,ax as b}from"./index-MyY_xqVN.js";import"./index-CsfPLOYu.js";var M=Object.defineProperty,P=Object.getOwnPropertyDescriptor,J=(t,e,s,n)=>{for(var i=n>1?void 0:n?P(e,s):e,u=t.length-1,p;u>=0;u--)(p=t[u])&&(i=(n?p(e,s,i):p(i))||i);return n&&i&&M(e,s,i),i};let O=class extends I{constructor(){super(...arguments);o(this,"$notify");o(this,"activeDid","");o(this,"allContacts",[]);o(this,"allMyDids",[]);o(this,"apiServer","");o(this,"lastAckedOfferToUserJwtId","");o(this,"newOffersToUser",[]);o(this,"newOffersToUserAtEnd",!1);o(this,"showOffersDetails",!1);o(this,"showOffersToUserProjectsDetails",!1);o(this,"didInfo",$);o(this,"displayAmount",B)}async created(){try{const s=await A();this.apiServer=s.apiServer||"",this.activeDid=s.activeDid||"",this.lastAckedOfferToUserJwtId=s.lastAckedOfferToUserJwtId||"",this.allContacts=await x.contacts.toArray(),this.allMyDids=await R();const n=await b(this.axios,this.apiServer,this.activeDid,void 0,void 0);this.newOffersToUser=n.data,this.newOffersToUserAtEnd=!n.hitLimit}catch(s){console.error("Error retrieving settings & contacts:",s),this.$notify({group:"alert",type:"danger",title:"Error",text:s.message||"There was an error retrieving your activity."},5e3)}}async loadMoreOffersToUser(){if(this.newOffersToUserAtEnd)return;const s=await b(this.axios,this.apiServer,this.activeDid,void 0,this.newOffersToUser[this.newOffersToUser.length-1].jwtId);this.newOffersToUser.push(...s.data),this.newOffersToUserAtEnd=!s.hitLimit}};O=J([k({components:{EntityIcon:V,GiftedDialog:S,InfiniteScroll:E,QuickNav:N}})],O);const Q={id:"Content",class:"p-6 pb-24 max-w-3xl mx-auto"},F={id:"ViewBreadcrumb",class:"mb-8"},L={class:"text-lg text-center font-light relative px-7"},Y={key:0},G={class:"mt-2"},H={"data-testId":"listRecentOffersToUser",class:"border-t border-slate-300"},z={key:0,class:"border-b border-slate-300 text-orange-400 pb-2 mb-2 font-bold text-sm"},q={key:1},K={key:2};function W(t,e,s,n,i,u){const p=m("QuickNav"),v=m("fa"),T=m("router-link"),g=m("InfiniteScroll");return f(),a(U,null,[l(p,{selected:"Home"}),d("section",Q,[d("div",F,[d("h1",L,[l(v,{icon:"chevron-left",onClick:e[0]||(e[0]=r=>t.$router.back()),class:"fa-fw text-lg text-center px-2 py-1 absolute -left-2 -top-1"}),e[1]||(e[1]=c(" Offers to You "))])]),t.newOffersToUser.length===0?(f(),a("div",Y,[e[5]||(e[5]=d("p",null,"Nobody has given you an offer.",-1)),d("p",G,[e[3]||(e[3]=c(" You can start the cycle on the ")),l(T,{to:"/contacts",class:"text-blue-500"},{default:y(()=>[e[2]||(e[2]=c(" Contacts page ")),l(v,{icon:"users"})]),_:1}),e[4]||(e[4]=c(` with an "Offer" directly to someone. Hopefully you'll find a common interest! `))])])):w("",!0),l(g,{onReachedBottom:t.loadMoreOffersToUser},{default:y(()=>[d("ul",H,[(f(!0),a(U,null,j(t.newOffersToUser,r=>(f(),a("li",{key:r.jwtId,class:"mt-4 relative group"},[r.jwtId==t.lastAckedOfferToUserJwtId?(f(),a("div",z," You've already seen all the following ")):w("",!0),d("span",null,h(t.didInfo(r.offeredByDid,t.activeDid,t.allMyDids,t.allContacts)),1),e[6]||(e[6]=c(" offered ")),r.objectDescription?(f(),a("span",q,h(r.objectDescription),1)):w("",!0),c(h(r.objectDescription&&r.amount?", and ":"")+" ",1),r.amount?(f(),a("span",K,h(t.displayAmount(r.unit,r.amount)),1)):w("",!0),l(T,{to:{path:"/claim/"+encodeURIComponent(r.jwtId)},class:"text-blue-500"},{default:y(()=>[l(v,{icon:"file-lines",class:"pl-2 text-blue-500 cursor-pointer"})]),_:2},1032,["to"])]))),128))])]),_:1},8,["onReachedBottom"])])],64)}const ae=C(O,[["render",W]]);export{ae as default};
|
|
|