dappros/ethora

View on GitHub
client-web/build-prod/static/js/664.fe09b7b6.chunk.js

Summary

Maintainability
A
0 mins
Test Coverage
"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[664],{65664:function(e,s,n){n.r(s);var t=n(74165),r=n(15861),a=n(70885),i=n(50228),d=n(4565),l=n(72791),o=n(64880),c=n(45100),p=n(47409),u=n(79299),h=n(80184);s.default=function(e){var s=(0,l.useState)({items:[],total:0,offset:0,limit:0}),n=(0,a.Z)(s,2),y=n[0],f=n[1],m=(0,l.useState)(!1),x=(0,a.Z)(m,2),g=x[0],b=x[1],Z=(0,o.UO)(),j=function(){var e=(0,r.Z)((0,t.Z)().mark((function e(){var s,n;return(0,t.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return b(!0),e.prev=1,e.next=4,(0,p.f1)(Z.address);case 4:s=e.sent,n=s.data,f(n),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(1),console.log(e.t0);case 12:b(!1);case 13:case"end":return e.stop()}}),e,null,[[1,9]])})));return function(){return e.apply(this,arguments)}}();return(0,l.useEffect)((function(){null!==Z&&void 0!==Z&&Z.address&&j()}),[Z]),(0,h.jsx)(h.Fragment,{children:g?(0,h.jsx)(c.A,{}):(0,h.jsxs)(i.Z,{children:[(0,h.jsxs)(d.Z,{variant:"h4",sx:{padding:"10px",fontSize:"25px"},children:["Transactions from/to ",Z.address]}),(0,h.jsx)(u.P,{transactions:y.items})]})})}},79299:function(e,s,n){n.d(s,{P:function(){return P}});var t=n(70885),r=n(74142),a=n(76132),i=n(19978),d=n(5682),l=n(73978),o=n(4346),c=n(50228),p=n(74244),u=n(45629),h=n(72791),y=n(57050),f=n(3395),m=n(69861),x=n(91482),g=n(11210),b=n(64880),Z=n(80184),j=function(e){var s=e.item,n=(0,r.Z)(),j=(0,g.K)((function(e){return e.user.walletAddress})),P=s.from===j,v=(0,h.useState)(!1),L=(0,t.Z)(v,2),k=L[0],w=L[1],N=(0,b.k6)();return s.fromFirstName?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(a.ZP,{children:(0,Z.jsxs)(i.Z,{onClick:function(){return w((function(e){return!e}))},children:[(0,Z.jsx)(d.Z,{children:(0,Z.jsx)(l.Z,{style:{backgroundColor:n.palette.primary.main},children:(0,Z.jsx)("p",{children:s.fromFirstName.slice(0,2).toUpperCase()})})}),(0,Z.jsx)(o.Z,{primary:s.fromFirstName+" "+s.fromLastName,secondary:(0,x.Z)(new Date(s.timestamp),"pp PP")}),(0,Z.jsxs)(c.Z,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:[P?(0,Z.jsx)(m.Z,{fontSize:"small",color:"error"}):(0,Z.jsx)(f.Z,{color:"success",fontSize:"small"}),(0,Z.jsx)("span",{children:s.value}),(0,Z.jsx)("img",{src:y,style:{width:20,height:20},alt:"coin"})]})]})},s.transactionHash),(0,Z.jsx)(p.Z,{in:k,timeout:"auto",unmountOnExit:!0,children:(0,Z.jsxs)(u.Z,{dense:!0,children:[(0,Z.jsxs)(a.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,Z.jsx)("span",{style:{fontWeight:"bold"},children:"Block Number:"})," ",s.blockNumber]}),(0,Z.jsxs)(a.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,Z.jsx)("span",{style:{fontWeight:"bold"},children:"From:"})," ",(0,Z.jsx)("span",{children:(0,Z.jsx)("span",{onClick:function(){return N.push("/explorer/address/"+s.from)},style:{textDecoration:"underline",cursor:"pointer"},children:s.from})})]})," ",(0,Z.jsxs)(a.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,Z.jsx)("span",{style:{fontWeight:"bold"},children:"To:"}),(0,Z.jsx)("span",{onClick:function(){return N.push("/explorer/address/"+s.to)},style:{textDecoration:"underline",cursor:"pointer"},children:s.to})]}),(0,Z.jsxs)(a.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,Z.jsx)("span",{style:{fontWeight:"bold"},children:"Sender First Name:"}),s.fromFirstName]}),(0,Z.jsxs)(a.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,Z.jsx)("span",{style:{fontWeight:"bold"},children:"Sender Last Name:"}),s.fromLastName]}),(0,Z.jsxs)(a.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,Z.jsx)("span",{style:{fontWeight:"bold"},children:"Timestamp:"})," ",(0,x.Z)(new Date(s.timestamp),"pp PP")]}),(0,Z.jsxs)(a.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,Z.jsx)("span",{style:{fontWeight:"bold"},children:"Receiver First Name:"}),s.toFirstName]}),(0,Z.jsxs)(a.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,Z.jsx)("span",{style:{fontWeight:"bold"},children:"Receiver Last Name:"}),s.toLastName]}),(0,Z.jsxs)(a.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,Z.jsx)("span",{style:{fontWeight:"bold"},children:"Token Name:"}),s.tokenName]}),(0,Z.jsxs)(a.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,Z.jsx)("span",{style:{fontWeight:"bold"},children:"Transaction Index:"}),s.transactionIndex]}),(0,Z.jsxs)(a.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,Z.jsx)("span",{style:{fontWeight:"bold"},children:"Type:"}),s.type]}),(0,Z.jsxs)(a.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,Z.jsx)("span",{style:{fontWeight:"bold"},children:"Value:"}),s.value]}),(0,Z.jsxs)(a.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,Z.jsx)("span",{style:{fontWeight:"bold"},children:"Transaction Hash:"}),(0,Z.jsx)("span",{onClick:function(){return N.push("/explorer/transactions/"+s.transactionHash)},style:{textDecoration:"underline",cursor:"pointer"},children:s.transactionHash})]}),(0,Z.jsxs)(a.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,Z.jsx)("span",{style:{fontWeight:"bold"},children:"Token Id:"}),s.tokenId]}),(0,Z.jsxs)(a.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,Z.jsx)("span",{style:{fontWeight:"bold"},children:"_id:"}),s._id]})]})})]}):null},P=function(e){var s=e.transactions;(0,r.Z)(),(0,g.K)((function(e){return e.user.walletAddress}));return console.log({transactions:s}),(0,Z.jsx)(u.Z,{sx:{width:"100%",bgcolor:"background.paper"},children:s.map((function(e){return(0,Z.jsx)(j,{item:e},e._id)}))})}},3395:function(e,s,n){var t=n(64836);s.Z=void 0;var r=t(n(45649)),a=n(80184),i=(0,r.default)((0,a.jsx)("path",{d:"m20 12-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}),"ArrowDownward");s.Z=i},69861:function(e,s,n){var t=n(64836);s.Z=void 0;var r=t(n(45649)),a=n(80184),i=(0,r.default)((0,a.jsx)("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"}),"ArrowUpward");s.Z=i},4346:function(e,s,n){var t=n(4942),r=n(63366),a=n(87462),i=n(72791),d=n(28182),l=n(94419),o=n(4565),c=n(98826),p=n(85513),u=n(60277),h=n(29282),y=n(80184),f=["children","className","disableTypography","inset","primary","primaryTypographyProps","secondary","secondaryTypographyProps"],m=(0,u.ZP)("div",{name:"MuiListItemText",slot:"Root",overridesResolver:function(e,s){var n=e.ownerState;return[(0,t.Z)({},"& .".concat(h.Z.primary),s.primary),(0,t.Z)({},"& .".concat(h.Z.secondary),s.secondary),s.root,n.inset&&s.inset,n.primary&&n.secondary&&s.multiline,n.dense&&s.dense]}})((function(e){var s=e.ownerState;return(0,a.Z)({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4},s.primary&&s.secondary&&{marginTop:6,marginBottom:6},s.inset&&{paddingLeft:56})})),x=i.forwardRef((function(e,s){var n=(0,p.Z)({props:e,name:"MuiListItemText"}),t=n.children,u=n.className,x=n.disableTypography,g=void 0!==x&&x,b=n.inset,Z=void 0!==b&&b,j=n.primary,P=n.primaryTypographyProps,v=n.secondary,L=n.secondaryTypographyProps,k=(0,r.Z)(n,f),w=i.useContext(c.Z).dense,N=null!=j?j:t,T=v,W=(0,a.Z)({},n,{disableTypography:g,inset:Z,primary:!!N,secondary:!!T,dense:w}),G=function(e){var s=e.classes,n=e.inset,t=e.primary,r=e.secondary,a={root:["root",n&&"inset",e.dense&&"dense",t&&r&&"multiline"],primary:["primary"],secondary:["secondary"]};return(0,l.Z)(a,h.L,s)}(W);return null==N||N.type===o.Z||g||(N=(0,y.jsx)(o.Z,(0,a.Z)({variant:w?"body2":"body1",className:G.primary,component:null!=P&&P.variant?void 0:"span",display:"block"},P,{children:N}))),null==T||T.type===o.Z||g||(T=(0,y.jsx)(o.Z,(0,a.Z)({variant:"body2",className:G.secondary,color:"text.secondary",display:"block"},L,{children:T}))),(0,y.jsxs)(m,(0,a.Z)({className:(0,d.Z)(G.root,u),ownerState:W,ref:s},k,{children:[N,T]}))}));s.Z=x}}]);
//# sourceMappingURL=664.fe09b7b6.chunk.js.map