dappros/ethora

View on GitHub
client-web/build/static/js/679.57e9cf96.chunk.js

Summary

Maintainability
A
0 mins
Test Coverage
"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[679],{35679:function(e,t,s){s.r(t);var n=s(74165),i=s(15861),a=s(36459),d=s(70885),l=s(5682),r=s(73978),o=s(4565),c=s(76132),h=s(19978),x=s(74244),u=s(45629),f=s(30418),p=s(52791),j=s(91482),b=s(72791),m=s(64880),g=s(47409),Z=s(2919),y=s(45100),P=s(80184),v="Token Creation",N=function(e){var t=e.name,s=e.balance,n=e.total,i=(0,f.Z)();return(0,P.jsxs)(p.Z,{sx:{display:"flex",alignItems:"center",width:"30%"},children:[(0,P.jsx)(p.Z,{children:(0,P.jsx)(l.Z,{children:(0,P.jsx)(r.Z,{style:{backgroundColor:i.palette.primary.main},children:(0,P.jsx)(o.Z,{children:t.slice(0,2)})})})}),(0,P.jsx)(p.Z,{ml:"2",children:(0,P.jsxs)(p.Z,{children:[(0,P.jsx)(o.Z,{children:t}),!!s&&(0,P.jsxs)(o.Z,{children:[s,"/",n]})]})})]})},k=function(e){var t=e.item,s=(0,b.useState)(!1),n=(0,d.Z)(s,2),i=n[0],a=n[1],l=(0,m.k6)(),r=(t.senderFirstName||"")+" "+(t.senderLastName||""),f=(t.receiverFirstName||"")+" "+(t.receiverLastName||"");return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(c.ZP,{children:(0,P.jsxs)(h.Z,{onClick:function(){return a((function(e){return!e}))},children:[t.type===v?(0,P.jsx)(p.Z,{sx:{display:"flex",justifyContent:"flex-start",alignItems:"center",width:"30%"},children:(0,P.jsx)(o.Z,{fontSize:14,color:"black",fontWeight:"bold",children:t.tokenName||t.nftName||"Item"})}):(0,P.jsx)(N,{balance:t.senderBalance,total:t.nftTotal,name:r}),(0,P.jsx)(p.Z,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"30%",paddingLeft:"20px"},children:t.type===v?(0,P.jsx)(o.Z,{fontSize:14,color:"black",fontWeight:"bold",children:"Was created by"}):(0,P.jsx)(Z.Z,{color:"success",fontSize:"small"})}),(0,P.jsx)(N,{balance:t.receiverBalance,total:t.nftTotal,name:f}),(0,P.jsx)(o.Z,{children:t.value})]})},t.transactionHash),(0,P.jsx)(x.Z,{in:i,timeout:"auto",unmountOnExit:!0,children:(0,P.jsxs)(u.Z,{dense:!0,children:[!!t.blockNumber&&(0,P.jsxs)(c.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,P.jsx)("span",{style:{fontWeight:"bold"},children:"Block Number:"})," ",t.blockNumber]}),(0,P.jsxs)(c.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,P.jsx)("span",{style:{fontWeight:"bold"},children:"From:"})," ",(0,P.jsx)("span",{children:(0,P.jsx)("span",{onClick:function(){return l.push("/explorer/address/"+t.from)},style:{textDecoration:"underline",cursor:"pointer"},children:t.from})})]})," ",!!t.to&&(0,P.jsxs)(c.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,P.jsx)("span",{style:{fontWeight:"bold"},children:"To:"}),(0,P.jsx)("span",{onClick:function(){return l.push("/explorer/address/"+t.to)},style:{textDecoration:"underline",cursor:"pointer"},children:t.to})]}),!!t.fromFirstName&&(0,P.jsxs)(c.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,P.jsx)("span",{style:{fontWeight:"bold"},children:"Sender First Name:"}),t.fromFirstName]}),!!t.fromLastName&&(0,P.jsxs)(c.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,P.jsx)("span",{style:{fontWeight:"bold"},children:"Sender Last Name:"}),t.fromLastName]}),!!t.timestamp&&(0,P.jsxs)(c.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,P.jsx)("span",{style:{fontWeight:"bold"},children:"Timestamp:"})," ",(0,j.Z)(new Date(t.timestamp),"pp PP")]}),!!t.toFirstName&&(0,P.jsxs)(c.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,P.jsx)("span",{style:{fontWeight:"bold"},children:"Receiver First Name:"}),t.toFirstName]}),!!t.toLastName&&(0,P.jsxs)(c.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,P.jsx)("span",{style:{fontWeight:"bold"},children:"Receiver Last Name:"}),t.toLastName]}),!!t.tokenName&&(0,P.jsxs)(c.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,P.jsx)("span",{style:{fontWeight:"bold"},children:"Token Name:"}),t.tokenName]}),!!t.transactionIndex&&(0,P.jsxs)(c.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,P.jsx)("span",{style:{fontWeight:"bold"},children:"Transaction Index:"}),t.transactionIndex]}),!!t.type&&(0,P.jsxs)(c.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,P.jsx)("span",{style:{fontWeight:"bold"},children:"Type:"}),t.type]}),!!t.value&&(0,P.jsxs)(c.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,P.jsx)("span",{style:{fontWeight:"bold"},children:"Value:"}),t.value]}),!!t.transactionHash&&(0,P.jsxs)(c.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,P.jsx)("span",{style:{fontWeight:"bold"},children:"Transaction Hash:"}),(0,P.jsx)("span",{onClick:function(){return l.push("/explorer/transactions/"+t.transactionHash)},style:{textDecoration:"underline",cursor:"pointer"},children:t.transactionHash})]}),(0,P.jsxs)(c.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,P.jsx)("span",{style:{fontWeight:"bold"},children:"Token Id:"}),t.tokenId]}),(0,P.jsxs)(c.ZP,{disablePadding:!0,disableGutters:!0,style:{paddingLeft:25},children:[(0,P.jsx)("span",{style:{fontWeight:"bold"},children:"_id:"}),t._id]})]})})]})};t.default=function(e){var t;(0,a.Z)(e);var s=(0,m.TH)(),l=(0,b.useState)([]),r=(0,d.Z)(l,2),c=r[0],h=r[1],x=(0,b.useState)(!1),f=(0,d.Z)(x,2),j=f[0],Z=f[1],v=s.state.nftItem,N=function(){var e=(0,i.Z)((0,n.Z)().mark((function e(){var t;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Z(!0),e.prev=1,e.next=4,(0,g.j9)(s.state.walletAddress,v.nftId||v._id);case 4:t=e.sent,h(t.data.items.reverse()),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),console.log(e.t0);case 11:Z(!1);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(){return e.apply(this,arguments)}}();return(0,b.useEffect)((function(){N()}),[]),s.state.walletAddress?j?(0,P.jsx)(y.A,{}):(0,P.jsxs)(p.Z,{children:[(0,P.jsxs)(p.Z,{sx:{width:"100%",height:"300px",display:"flex",justifyContent:"center",padding:"10px"},children:[(0,P.jsx)("img",{style:{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"},src:v.nftFileUrl||(null===v||void 0===v||null===(t=v.file)||void 0===t?void 0:t.locationPreview)||(null===v||void 0===v?void 0:v.location),alt:"image1"}),(0,P.jsxs)(p.Z,{sx:{padding:"10px"},children:[(0,P.jsx)(o.Z,{sx:{fontWeight:"bold",fontSize:18},children:v.tokenName||v.documentName}),!!v.balance&&(0,P.jsxs)(o.Z,{sx:{fontWeight:"bold",fontSize:18},children:[v.balance,"/",v.total]})]})]}),(0,P.jsx)(u.Z,{children:c.map((function(e){return(0,P.jsx)(k,{item:e},e._id)}))})]}):(0,P.jsx)("p",{children:"No Data"})}},2919:function(e,t,s){var n=s(64836);t.Z=void 0;var i=n(s(45649)),a=s(80184),d=(0,i.default)((0,a.jsx)("path",{d:"M16.01 11H4v2h12.01v3L20 12l-3.99-4z"}),"ArrowRightAlt");t.Z=d},52791:function(e,t,s){var n=(0,s(23814).Z)();t.Z=n}}]);
//# sourceMappingURL=679.57e9cf96.chunk.js.map