dappros/ethora

View on GitHub
client-web/build/static/js/980.27d29068.chunk.js

Summary

Maintainability
A
0 mins
Test Coverage
"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[980],{23895:function(e,n,t){t.d(n,{c:function(){return d}});var s=t(74165),i=t(15861),r=t(85554),a=t(11210),l=t(73763),o=function(e){return e?e.replace(/([A-Z])/g,"_$1").toLowerCase():"invalid string passed"},d=function(){var e=(0,i.Z)((0,s.Z)().mark((function e(n,t,i,d,c){var u,p,h,x,f;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u=[n,t].sort().join("."),p=u.toLowerCase()+l.Ts,h=[i,d].sort().join(" and "),x=a.K.getState().userChatRooms,f=!1,0===x.filter((function(e){return e.jid===p})).length&&(f=!0,r.ZP.createNewRoom(u.toLowerCase()),r.ZP.setOwner(u.toLowerCase()),r.ZP.roomConfig(u.toLowerCase(),{roomName:h}),r.ZP.subsribe(p),r.ZP.presenceInRoom(p),setTimeout((function(){r.ZP.sendInvite(o(n),p.toLowerCase(),o(t))}),1e3)),e.abrupt("return",{roomJid:p,roomName:h,isNewRoom:f});case 7:case"end":return e.stop()}}),e)})));return function(n,t,s,i,r){return e.apply(this,arguments)}}()},14250:function(e,n,t){t.d(n,{z:function(){return p}});t(72791);var s=t(60788),i=t(40464),r=t(17205),a=t(13811),l=t(52791),o=t(80925),d=t(24177),c=t(29823),u=t(80184),p=function(e){var n=e.title,t=e.open,p=e.link,h=e.onClose;return(0,u.jsxs)(s.Z,{maxWidth:!1,open:t,onClose:h,children:[!!n&&(0,u.jsx)(i.Z,{sx:{padding:"0 24px",paddingTop:"20px"},children:n}),(0,u.jsxs)(l.Z,{sx:{padding:"20px"},children:[(0,u.jsx)(o.Z,{size:256,style:{height:"50vh",maxWidth:"100%",width:"100%"},value:p,viewBox:"0 0 256 256"}),(0,u.jsxs)(l.Z,{sx:{boxShadow:"0px 0px 10px -5px rgba(0,0,0,0.75)",borderRadius:"10px",display:"flex",justifyContent:"space-between",alignItems:"center",pl:"10px",my:"10px"},children:[(0,u.jsx)("span",{children:(0,d.aS)(p,50)}),(0,u.jsx)(r.Z,{variant:"contained",sx:{borderRadius:"10px",marginLeft:"5px"},onClick:function(){return navigator.clipboard.writeText(p)},children:"Copy"})]}),(0,u.jsx)(a.Z,{onClick:h,sx:{color:"black",position:"absolute",top:10,right:10,fontSize:"30px"},children:(0,u.jsx)(c.Z,{fontSize:"inherit"})})]})]})}},15737:function(e,n,t){t.r(n),t.d(n,{default:function(){return ce}});var s=t(72791),i=t(11210),r=t(64880),a=t(70885),l=t(20803),o=t(50228),d=t(48928),c=t.p+"static/media/def-ava.3a614f4c231447b5ae52.png",u=t(1413),p=t(60788),h=t(40464),x=t(13811),f=t(29823),m=t(55152),g=t(55705),j=t(59911),Z=t(39709),y=t(47409),b=t(72900),v=t(45473),w=t(17205),N=t(98234),P=t.n(N),C=(t(89390),t(80184));function k(e){var n=e.open,t=e.setOpen,r=(0,i.K)((function(e){return e.user})),l=(0,i.K)((function(e){return e.setUser})),d=(0,s.useRef)(null),c=(0,s.useState)(""),m=(0,a.Z)(c,2),g=m[0],j=m[1],Z=(0,s.useRef)(null),b=(0,s.useState)(),v=(0,a.Z)(b,2),k=v[0],A=v[1],I=(0,s.useState)(),L=(0,a.Z)(I,2),S=L[0],W=L[1];return(0,C.jsx)(p.Z,{onClose:function(){},open:n,children:(0,C.jsxs)(o.Z,{children:[(0,C.jsxs)(h.Z,{style:{display:"flex",justifyContent:"space-between"},children:["Change Image",(0,C.jsx)(x.Z,{onClick:function(){j(""),t(!1)},children:(0,C.jsx)(f.Z,{})})]}),(0,C.jsx)(o.Z,{sx:{typography:"body1",padding:1},children:(0,C.jsxs)(o.Z,{style:{width:"400px"},children:[!g&&(0,C.jsxs)(o.Z,{style:{height:"200px",display:"flex",justifyContent:"center",alignItems:"center"},children:[(0,C.jsx)("input",{type:"file",ref:d,style:{display:"none"},accept:"image/*",onChange:function(e){if(e.target.files&&e.target.files.length>0){var n=new FileReader;n.addEventListener("load",(function(){var e;return j((null===(e=n.result)||void 0===e?void 0:e.toString())||"")})),n.readAsDataURL(e.target.files[0])}}}),(0,C.jsx)(w.Z,{onClick:function(){return d.current.click()},children:"Upload"})]}),!!g&&(0,C.jsxs)(o.Z,{children:[(0,C.jsx)(P(),{crop:k,onChange:function(e,n){return A(n)},onComplete:function(e){var n=document.createElement("canvas"),t=window.devicePixelRatio,s=Z.current.naturalWidth/Z.current.width,i=Z.current.naturalHeight/Z.current.height,r=n.getContext("2d");n.width=e.width*t*s,n.height=e.height*t*i,r.setTransform(t,0,0,t,0,0),r.imageSmoothingQuality="high",r.drawImage(Z.current,e.x*s,e.y*i,e.width*s,e.height*i,0,0,e.width*s,e.height*i),n.toBlob((function(e){e?W(e):console.error("Canvas is empty")}),"image/jpeg",1)},minWidth:100,minHeight:100,children:(0,C.jsx)("img",{style:{width:"400px",height:"auto"},ref:Z,alt:"Crop me",src:g,onLoad:function(e){var n=e.currentTarget,t=n.width,s=n.height;A(function(e,n,t){return(0,N.centerCrop)((0,N.makeAspectCrop)({unit:"%",width:90},t,e,n),e,n)}(t,s,2))}})}),(0,C.jsx)(o.Z,{style:{display:"flex"},children:(0,C.jsx)(w.Z,{onClick:function(){var e=new FormData;e.append("file",S,"profileImg"),y.ck(e).then((function(e){l((0,u.Z)((0,u.Z)({},r),{},{profileImage:e.data.user.profileImage})),t(!1)})).catch((function(e){return console.log(e)}))},style:{marginLeft:"auto"},children:"Save"})})]})]})})]})})}function A(e){var n=e.open,t=e.setOpen,r=e.user,l=(0,s.useState)(!1),d=(0,a.Z)(l,2),w=d[0],N=d[1],P=(0,s.useState)(!1),A=(0,a.Z)(P,2),I=A[0],L=A[1],S=(0,i.K)((function(e){return e.setUser})),W=(0,g.TA)({initialValues:{firstName:r.firstName,lastName:r.lastName,description:r.description?r.description:"",isProfileOpen:r.isProfileOpen,isAssetsOpen:r.isAssetsOpen},validate:function(e){var n={};return e.firstName||(n.firstName="Required"),e.lastName||(n.lastName="Required"),n},onSubmit:function(e){var n=new FormData;n.append("firstName",e.firstName),n.append("lastName",e.lastName),e.description&&n.append("description",e.description),n.append("isProfileOpen",e.isProfileOpen),n.append("isAssetsOpen",e.isAssetsOpen),L(!0),(0,y.Vy)().put("/users",n).then((function(e){var n=e.data.user;S((0,u.Z)((0,u.Z)({},r),{},{firstName:n.firstName,lastName:n.lastName,description:n.description,isProfileOpen:n.isProfileOpen,isAssetsOpen:n.isAssetsOpen})),t(!1)})).finally((function(){return L(!1)}))}});return(0,C.jsxs)(p.Z,{onClose:function(){},open:n,children:[(0,C.jsxs)(o.Z,{children:[(0,C.jsxs)(h.Z,{style:{display:"flex",justifyContent:"space-between"},children:["Edit Profile",(0,C.jsx)(x.Z,{onClick:function(){return t(!1)},children:(0,C.jsx)(f.Z,{})})]}),(0,C.jsx)(o.Z,{sx:{width:"100%",typography:"body1",padding:1},children:(0,C.jsxs)(o.Z,{style:{display:"flex"},children:[(0,C.jsx)(o.Z,{sx:{marginRight:"10px"},style:{display:"flex",flexDirection:"column",cursor:"pointer"},children:(0,C.jsx)("div",{onClick:function(){return N(!0)},children:(0,C.jsx)("img",{style:{width:"150px",borderRadius:"10px"},alt:"",src:r.profileImage?r.profileImage:c})})}),(0,C.jsx)(o.Z,{children:(0,C.jsxs)("form",{style:{display:"flex",flexDirection:"column"},onSubmit:W.handleSubmit,children:[(0,C.jsx)(j.Z,{margin:"dense",label:"First Name",name:"firstName",variant:"standard",error:!(!W.touched.firstName||!W.errors.firstName),helperText:W.touched.firstName&&W.errors.firstName?W.errors.firstName:"",onChange:W.handleChange,onBlur:W.handleBlur,value:W.values.firstName}),(0,C.jsx)(j.Z,{margin:"dense",label:"Last Name",name:"lastName",variant:"standard",error:!(!W.touched.lastName||!W.errors.lastName),helperText:W.touched.lastName&&W.errors.lastName?W.errors.lastName:"",onChange:W.handleChange,onBlur:W.handleBlur,value:W.values.lastName}),(0,C.jsx)(j.Z,{margin:"dense",label:"Profile Description",name:"description",variant:"standard",onChange:W.handleChange,onBlur:W.handleBlur,value:W.values.description}),(0,C.jsx)(m.Z,{placement:"top",title:"When enabled, your profile and documents will be visible by all visitors. When disabled, your profile will only be seen by those who received a direct sharing link from you.",children:(0,C.jsx)(b.Z,{checked:W.values.isProfileOpen,name:"isProfileOpen",control:(0,C.jsx)(v.Z,{onChange:function(e){W.setFieldValue("isProfileOpen",e.target.checked)}}),label:"Profile is public",labelPlacement:"end"})}),(0,C.jsx)(m.Z,{placement:"bottom",title:"When this is enabled, all of your documents will be visible to those who have access to your profile. When this is disabled, you will need to share your documents individually so others can see them.",children:(0,C.jsx)(b.Z,{checked:W.values.isAssetsOpen||W.values.isProfileOpen,name:"isAssetsOpen",control:(0,C.jsx)(v.Z,{disabled:W.values.isProfileOpen,onChange:function(e){W.setFieldValue("isAssetsOpen",e.target.checked)}}),label:"Documents are public",labelPlacement:"end"})}),(0,C.jsx)(Z.Z,{type:"submit",loading:I,variant:"contained",children:"Save"})]})})]})})]}),w&&(0,C.jsx)(k,{open:w,setOpen:N})]})}var I=t(23895),L=t(85554),S=t(73763),W=t(24177),O=t(61102),R=t(14250);function F(e){var n=e.profile,t=e.walletAddress,l=(0,s.useState)(!1),u=(0,a.Z)(l,2),p=u[0],h=u[1],f=(0,i.K)((function(e){return e.user})),m=(0,s.useState)(!1),g=(0,a.Z)(m,2),j=g[0],Z=g[1],y=(0,r.k6)();return n?(0,C.jsx)(o.Z,{style:{marginTop:"10px",marginRight:"10px"},children:(0,C.jsxs)(d.Z,{sx:{display:"flex",padding:"10px",flexDirection:"column",alignItems:"center",width:"100%"},children:[(0,C.jsx)(o.Z,{sx:{marginRight:"10px"},children:!!n.firstName&&(0,C.jsx)("img",{style:{width:"150px",borderRadius:"10px"},alt:"",src:n.profileImage||c})}),(0,C.jsxs)(o.Z,{children:[(0,C.jsxs)(o.Z,{sx:{fontWeight:"bold"},children:[null===n||void 0===n?void 0:n.firstName," ",null===n||void 0===n?void 0:n.lastName]}),(null===n||void 0===n?void 0:n.description)&&(0,C.jsxs)(o.Z,{children:["Description: ",null===n||void 0===n?void 0:n.description]}),!!f.walletAddress&&(0,C.jsx)(w.Z,{onClick:function(){(0,I.c)(f.walletAddress,t,f.firstName,n.firstName).then((function(e){if(e.isNewRoom){var n={jid:e.roomJid,name:e.roomName,room_background:"none",room_thumbnail:"none",users_cnt:"2",unreadMessages:0,composing:"",toUpdate:!0,description:""};i.K.getState().setNewUserChatRoom(n),y.push("/chat/"+e.roomJid)}else y.push("/chat/"+e.roomJid)})).catch((function(e){console.log("openPrivateRoom Error: ",e)}))},variant:"contained",size:"small",children:"Direct message"})]})]})}):(0,C.jsxs)(o.Z,{style:{marginTop:"10px",marginRight:"10px"},children:[(0,C.jsxs)(d.Z,{sx:{display:"flex",padding:"10px",flexDirection:"column",alignItems:"center",width:"100%"},children:[(0,C.jsx)(o.Z,{sx:{marginRight:"10px"},children:(0,C.jsx)("img",{style:{width:"150px",borderRadius:"10px"},alt:"",src:f.profileImage||c})}),(0,C.jsx)(o.Z,{children:!!f.firstName&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(o.Z,{sx:{fontWeight:"bold",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[null===f||void 0===f?void 0:f.firstName," ",null===f||void 0===f?void 0:f.lastName,(0,C.jsx)(x.Z,{sx:{color:"black"},onClick:function(){return Z(!0)},children:(0,C.jsx)(O.Z,{})})]}),(null===f||void 0===f?void 0:f.description)&&(0,C.jsxs)(o.Z,{children:["Description: ",null===f||void 0===f?void 0:f.description]})]})}),f.firstName&&(0,C.jsx)(w.Z,{onClick:function(e){h(!0)},children:"Edit"})]}),p&&(0,C.jsx)(A,{open:p,setOpen:h,user:f}),(0,C.jsx)(R.z,{open:j,link:(0,W.nx)({firstName:f.firstName,lastName:f.lastName,walletAddress:f.walletAddress,xmppId:(0,L.$I)(f.walletAddress)+S.Ts}),onClose:function(){return Z(!1)}})]})}var T=t(74142),D=t(76132),K=t(19978),G=t(5682),B=t(73978),z=t(4346),_=t(65209),E=t(45629),H=function(e){var n=e.item,t=e.walletAddress,s=(0,T.Z)(),i=(0,r.k6)();return(0,C.jsx)(D.ZP,{children:(0,C.jsxs)(K.Z,{onClick:function(){i.push({pathname:"/provenance",state:{nftItem:n,walletAddress:t}})},children:[(0,C.jsx)(G.Z,{children:(0,C.jsx)(B.Z,{style:{backgroundColor:s.palette.primary.main},src:n.imagePreview})}),(0,C.jsx)(z.Z,{primary:n.tokenName}),(0,C.jsx)(o.Z,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:(0,C.jsxs)("span",{style:{textAlign:"left",width:50},children:[n.balance,"/",n.total]})})]})},n.nftId)},U=function(e){var n=e.item,t=e.walletAddress,s=(0,T.Z)(),i=(0,r.k6)();return(0,C.jsx)(D.ZP,{children:(0,C.jsxs)(K.Z,{onClick:function(){i.push({pathname:"/provenance",state:{nftItem:n,walletAddress:t}})},children:[(0,C.jsx)(G.Z,{children:(0,C.jsx)(B.Z,{style:{backgroundColor:s.palette.primary.main},src:n.nftFileUrl})}),(0,C.jsx)(z.Z,{primary:n.tokenName}),(0,C.jsxs)(o.Z,{sx:{display:"flex",justifyContent:"flex-end",alignItems:"center"},children:[(0,C.jsx)(o.Z,{sx:{display:"flex",justifyContent:"flex-end",alignItems:"center"},children:n.traits.map((function(e){return S.Xk[e]?(0,C.jsx)(_.Z,{sx:{backgroundColor:S.Xk[e].color,marginRight:"5px"},label:e},e):null}))}),(0,C.jsxs)("span",{style:{textAlign:"left",width:50},children:[n.balance,"/",n.total]})]})]})},n.nftId)};function X(e){var n=e.balance,t=e.walletAddress,s=n.filter((function(e){return"NFT"===e.tokenType})),i=(0,W.Ev)(n);return console.log({nfmtItems:i}),(0,C.jsxs)(E.Z,{sx:{width:"100%",bgcolor:"background.paper"},children:[s.map((function(e,n){return(0,C.jsx)(H,{walletAddress:t,item:e},e.nftId)})),i.map((function(e,n){return(0,C.jsx)(U,{walletAddress:t,item:e},e.nftId+n)}))]})}var q=t(79299),M=t(4565),V=t(52791),J=t(91482),Q=function(e){var n,t=e.item,s=e.walletAddress,i=(0,T.Z)(),a=(0,r.k6)();return(0,C.jsx)(D.ZP,{children:(0,C.jsxs)(K.Z,{onClick:function(){a.push({pathname:"/provenance",state:{nftItem:t,walletAddress:s}})},children:[(0,C.jsx)(G.Z,{children:(0,C.jsx)(B.Z,{style:{backgroundColor:i.palette.primary.main},src:(null===t||void 0===t||null===(n=t.file)||void 0===n?void 0:n.locationPreview)||(null===t||void 0===t?void 0:t.location)})}),(0,C.jsx)(z.Z,{primary:t.documentName,secondary:(0,J.Z)(new Date(t.createdAt),"pp PP")}),(0,C.jsx)(V.Z,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:(0,C.jsx)(x.Z,{sx:{color:"black"},children:(0,C.jsx)(O.Z,{})})})]})},t._id)};function Y(e){var n=e.documents,t=e.walletAddress;return(0,C.jsx)(E.Z,{sx:{width:"100%",bgcolor:"background.paper"},children:n.map((function(e){return(0,C.jsx)(Q,{walletAddress:t,item:e},e._id)}))})}var $=t(45100),ee=t(72426),ne=t(16701),te=t(75076),se=(0,ee.ZF)({apiKey:"AIzaSyDQdkvvxKKx4-WrjLQoYf08GFARgi_qO4g",authDomain:"ethora-668e9.firebaseapp.com",projectId:"ethora-668e9",storageBucket:"ethora-668e9.appspot.com",messagingSenderId:"972933470054",appId:"1:972933470054:web:d4682e76ef02fd9b9cdaa7",measurementId:"G-WHM7XRZ4C8"});(0,te.IH)(se);function ie(){var e=(0,ne.KL)(se);return(0,ne.LP)(e,{vapidKey:"BCzcT7yzF8F188maOgPAISXqWCTDavGzWW0SWLOBx9vX2mYFjBXMaTMBDR3HXlmXOduyE253sblF9HP6aEBbx38"})}function re(){var e=(0,s.useState)(!1),n=(0,a.Z)(e,2),t=n[0],r=n[1],d=(0,s.useState)(),c=(0,a.Z)(d,2),u=c[0],p=c[1],h=(0,i.K)((function(e){return e.user})),x=(0,i.K)((function(e){return e.balance})),f=(0,i.K)((function(e){return e.documents})),m=(0,i.K)((function(e){return e.setBalance}));return(0,s.useEffect)((function(){if(console.log("MyProfile init"),r(!0),(0,y.sb)(h.walletAddress).then((function(e){m(e.data.balance)})),(0,y.f1)(h.walletAddress).then((function(e){p(e.data)})).finally((function(){return r(!1)})),"denied"===Notification.permission)alert("Please enable notifications for this app in your browser");else{if("granted"===Notification.permission)return console.log("geting token"),void ie().then((function(e){console.log("my fb token ",e)}));Notification.requestPermission().then((function(e){if("granted"===e)return console.log("geting token"),void ie().then((function(e){console.log("my fb token ",e)}))}))}}),[]),t?(0,C.jsx)($.A,{}):(0,C.jsxs)(l.Z,{maxWidth:"xl",style:{height:"calc(100vh - 80px)"},children:[(0,C.jsx)(o.Z,{sx:{margin:"auto",width:"200px"},children:(0,C.jsx)(F,{})}),(0,C.jsx)(M.Z,{variant:"h6",style:{margin:"16px",display:"flex",justifyContent:"space-between",alignItems:"center"},children:(0,C.jsx)("span",{children:"Items"})}),(0,C.jsx)(X,{balance:x.filter(W.LK),walletAddress:h.walletAddress}),!!f.length&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(M.Z,{variant:"h6",style:{margin:"16px",display:"flex",justifyContent:"space-between",alignItems:"center"},children:(0,C.jsx)("span",{children:"Documents"})}),(0,C.jsx)(Y,{walletAddress:h.walletAddress,documents:f})]}),!!u&&(0,C.jsxs)(o.Z,{children:[(0,C.jsx)(M.Z,{variant:"h6",style:{margin:"16px"},children:"Transactions"}),(0,C.jsx)(q.P,{transactions:u.items})]})]})}var ae=t(74165),le=t(37762),oe=t(15861);function de(e){var n=(0,s.useState)(!0),t=(0,a.Z)(n,2),i=t[0],r=t[1],d=(0,s.useState)(),c=(0,a.Z)(d,2),u=c[0],p=c[1],h=(0,s.useState)(),x=(0,a.Z)(h,2),f=x[0],m=x[1],g=(0,s.useState)([]),j=(0,a.Z)(g,2),Z=j[0],b=j[1],v=(0,s.useState)([]),w=(0,a.Z)(v,2),N=w[0],P=w[1],k=function(){var e=(0,oe.Z)((0,ae.Z)().mark((function e(n){var t,s,i,r;return(0,ae.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=[],s=(0,le.Z)(n);try{for(s.s();!(i=s.n()).done;){r=i.value;try{r.location=r.locations[0],t.push(r)}catch(a){console.log(r.files[0],"sdjfkls")}}}catch(l){s.e(l)}finally{s.f()}P(t);case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,s.useEffect)((function(){r(!0),(0,y.k2)(e.walletAddress).then((function(e){p(e.data),b(e.data.balances.balance),k(e.data.documents)})),r(!1),(0,y.f1)(e.walletAddress).then((function(e){m(e.data)}))}),[]),i?(0,C.jsx)($.A,{}):(0,C.jsxs)(l.Z,{maxWidth:"xl",style:{height:"calc(100vh - 80px)"},children:[(0,C.jsxs)(o.Z,{children:[!(null===u||void 0===u||!u.firstName)&&(0,C.jsx)(o.Z,{sx:{width:"200px",margin:"auto",padding:"10px"},children:(0,C.jsx)(F,{profile:u,walletAddress:e.walletAddress})}),!!Z.filter(W.LK).length&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(M.Z,{variant:"h6",style:{margin:"16px"},children:"Items"}),(0,C.jsx)(X,{balance:Z.filter(W.LK),walletAddress:e.walletAddress})]})]}),!!N.length&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(M.Z,{variant:"h6",style:{margin:"16px"},children:"Documents"}),(0,C.jsx)(Y,{walletAddress:e.walletAddress,documents:N})]}),!!f&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(M.Z,{variant:"h6",style:{margin:"16px"},children:"Transactions"}),(0,C.jsx)(q.P,{transactions:f.items})]})]})}function ce(){var e=(0,i.K)((function(e){return e.user})),n=(0,r.UO)();return e.walletAddress===n.wallet?(0,C.jsx)(re,{}):(0,C.jsx)(de,{walletAddress:n.wallet})}},79299:function(e,n,t){t.d(n,{P:function(){return v}});var s=t(70885),i=t(74142),r=t(76132),a=t(19978),l=t(5682),o=t(73978),d=t(4346),c=t(50228),u=t(74244),p=t(45629),h=t(72791),x=t(57050),f=t(3395),m=t(69861),g=t(91482),j=t(11210),Z=t(64880),y=t(80184),b=function(e){var n=e.item,t=(0,i.Z)(),b=(0,j.K)((function(e){return e.user.walletAddress})),v=n.from===b,w=(0,h.useState)(!1),N=(0,s.Z)(w,2),P=N[0],C=N[1],k=(0,Z.k6)();return n.fromFirstName?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(r.ZP,{children:(0,y.jsxs)(a.Z,{onClick:function(){return C((function(e){return!e}))},children:[(0,y.jsx)(l.Z,{children:(0,y.jsx)(o.Z,{style:{backgroundColor:t.palette.primary.main},children:(0,y.jsx)("p",{children:n.fromFirstName.slice(0,2).toUpperCase()})})}),(0,y.jsx)(d.Z,{primary:n.fromFirstName+" "+n.fromLastName,secondary:(0,g.Z)(new Date(n.timestamp),"pp PP")}),(0,y.jsxs)(c.Z,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:[v?(0,y.jsx)(m.Z,{fontSize:"small",color:"error"}):(0,y.jsx)(f.Z,{color:"success",fontSize:"small"}),(0,y.jsx)("span",{children:n.value}),(0,y.jsx)("img",{src:x,style:{width:20,height:20},alt:"coin"})]})]})},n.transactionHash),(0,y.jsx)(u.Z,{in:P,timeout:"auto",unmountOnExit:!0,children:(0,y.jsxs)(p.Z,{dense:!0,children:[(0,y.jsxs)(r.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,y.jsx)("span",{style:{fontWeight:"bold"},children:"Block Number:"})," ",n.blockNumber]}),(0,y.jsxs)(r.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,y.jsx)("span",{style:{fontWeight:"bold"},children:"From:"})," ",(0,y.jsx)("span",{children:(0,y.jsx)("span",{onClick:function(){return k.push("/explorer/address/"+n.from)},style:{textDecoration:"underline",cursor:"pointer"},children:n.from})})]})," ",(0,y.jsxs)(r.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,y.jsx)("span",{style:{fontWeight:"bold"},children:"To:"}),(0,y.jsx)("span",{onClick:function(){return k.push("/explorer/address/"+n.to)},style:{textDecoration:"underline",cursor:"pointer"},children:n.to})]}),(0,y.jsxs)(r.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,y.jsx)("span",{style:{fontWeight:"bold"},children:"Sender First Name:"}),n.fromFirstName]}),(0,y.jsxs)(r.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,y.jsx)("span",{style:{fontWeight:"bold"},children:"Sender Last Name:"}),n.fromLastName]}),(0,y.jsxs)(r.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,y.jsx)("span",{style:{fontWeight:"bold"},children:"Timestamp:"})," ",(0,g.Z)(new Date(n.timestamp),"pp PP")]}),(0,y.jsxs)(r.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,y.jsx)("span",{style:{fontWeight:"bold"},children:"Receiver First Name:"}),n.toFirstName]}),(0,y.jsxs)(r.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,y.jsx)("span",{style:{fontWeight:"bold"},children:"Receiver Last Name:"}),n.toLastName]}),(0,y.jsxs)(r.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,y.jsx)("span",{style:{fontWeight:"bold"},children:"Token Name:"}),n.tokenName]}),(0,y.jsxs)(r.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,y.jsx)("span",{style:{fontWeight:"bold"},children:"Transaction Index:"}),n.transactionIndex]}),(0,y.jsxs)(r.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,y.jsx)("span",{style:{fontWeight:"bold"},children:"Type:"}),n.type]}),(0,y.jsxs)(r.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,y.jsx)("span",{style:{fontWeight:"bold"},children:"Value:"}),n.value]}),(0,y.jsxs)(r.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,y.jsx)("span",{style:{fontWeight:"bold"},children:"Transaction Hash:"}),(0,y.jsx)("span",{onClick:function(){return k.push("/explorer/transactions/"+n.transactionHash)},style:{textDecoration:"underline",cursor:"pointer"},children:n.transactionHash})]}),(0,y.jsxs)(r.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,y.jsx)("span",{style:{fontWeight:"bold"},children:"Token Id:"}),n.tokenId]}),(0,y.jsxs)(r.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,y.jsx)("span",{style:{fontWeight:"bold"},children:"_id:"}),n._id]})]})})]}):null},v=function(e){var n=e.transactions;(0,i.Z)(),(0,j.K)((function(e){return e.user.walletAddress}));return console.log({transactions:n}),(0,y.jsx)(p.Z,{sx:{width:"100%",bgcolor:"background.paper"},children:n.map((function(e){return(0,y.jsx)(b,{item:e},e._id)}))})}}}]);
//# sourceMappingURL=980.27d29068.chunk.js.map