dappros/ethora

View on GitHub
client-web/build/static/js/29.c0927fd1.chunk.js.map

Summary

Maintainability
Test Coverage
{"version":3,"file":"static/js/29.c0927fd1.chunk.js","mappings":"sUAiBaA,EAAgC,SAAH,GAAoB,IAAdC,EAAM,EAANA,OACxCC,GAAUC,EAAAA,EAAAA,MACVC,GAAQC,EAAAA,EAAAA,KACd,OACE,SAACC,EAAA,EAAG,CAACC,GAAI,CAAEC,QAAS,QAAS,UAC3B,UAACC,EAAA,EAAc,CACbF,GAAI,CACFG,KAAM,EACNC,UAAW,OACXC,OAAQ,aAAeR,EAAMS,QAAQC,QAAQC,KAC7CC,aAAc,QAEhBC,UAAWC,EAAAA,EAAM,WAEjB,SAACC,EAAA,EAAU,CAACC,QAAQ,KAAKC,MAAO,CAAEC,OAAQ,QAAUC,MAAO,UAAU,qBAGrE,gBACEF,MAAO,CACLG,OAAQ,EACRC,gBAAiBrB,EAAMS,QAAQC,QAAQC,KACvCO,OAAQ,MACRN,aAAc,MAGlB,UAACU,EAAA,EAAK,CAACnB,GAAI,CAAEoB,SAAU,KAAO,aAAW,eAAc,WACrD,SAACC,EAAA,EAAS,WACR,UAACC,EAAA,EAAQ,YACP,SAACC,EAAA,EAAS,CAACC,MAAM,SAAQ,2BACzB,SAACD,EAAA,EAAS,CAACC,MAAM,SAAQ,wBACzB,SAACD,EAAA,EAAS,CAACC,MAAM,SAAQ,kBACzB,SAACD,EAAA,EAAS,CAACC,MAAM,SAAQ,qBACzB,SAACD,EAAA,EAAS,CAACC,MAAM,OAAM,yBAG3B,SAACC,EAAA,EAAS,UACP/B,EAAOgC,KAAI,SAACC,GAAG,OACd,UAACL,EAAA,EAAQ,CAEPtB,GAAI,CAAE,mCAAoC,CAAEK,OAAQ,IAAM,WAE1D,SAACkB,EAAA,EAAS,CACRC,MAAM,SACNV,MAAO,CAAEc,eAAgB,YAAaC,OAAQ,WAC9CC,QAAS,kBAAMnC,EAAQoC,KAAK,mBAAqBJ,EAAIK,OAAO,EAAC,SAE5DL,EAAIK,UAEP,SAACT,EAAA,EAAS,CAACC,MAAM,SAAQ,SAAEG,EAAIM,aAC/B,SAACV,EAAA,EAAS,CAACC,MAAM,SAAQ,SAAEG,EAAIO,aAAaC,UAE5C,SAACZ,EAAA,EAAS,CAACC,MAAM,SAAQ,SAAEG,EAAIS,OAAOD,UACtC,SAACZ,EAAA,EAAS,CAACT,MAAO,CAAEuB,UAAW,UAAYb,MAAM,OAAM,SACpDG,EAAIW,UAfFX,EAAIK,OAiBA,aAOzB,E,sBC9CA,EAzBe,SAACO,GACd,OAA4BC,EAAAA,EAAAA,UAAoC,CAC9DC,MAAO,EACPC,MAAO,EACPC,MAAO,GACPC,OAAQ,IACR,eALKlD,EAAM,KAAEmD,EAAS,KAMxB,GAA8BL,EAAAA,EAAAA,WAAS,GAAK,eAArCM,EAAO,KAAEC,EAAU,KACpBC,EAAO,yCAAG,2FACG,OAAjBD,GAAW,GAAM,mBAEQE,EAAAA,EAAAA,MAAoB,KAAD,WAAlCC,EAAI,EAAJA,KACRL,EAAUK,GACVC,QAAQC,IAAIF,GAAM,kDAElBC,QAAQC,IAAI,EAAD,IAAQ,QAErBL,GAAW,GAAO,0DACnB,kBAVY,mCAcb,OAHAM,EAAAA,EAAAA,YAAU,WACRL,GACF,GAAG,IACCF,GAAgB,SAACQ,EAAA,EAAe,KAC7B,SAAC7D,EAAW,CAACC,OAAQA,EAAOiD,OACrC,C","sources":["components/BlocksTable.tsx","pages/Explorer/Blocks.tsx"],"sourcesContent":["import * as React from \"react\";\nimport Table from \"@mui/material/Table\";\nimport TableBody from \"@mui/material/TableBody\";\nimport TableCell from \"@mui/material/TableCell\";\nimport TableContainer from \"@mui/material/TableContainer\";\nimport TableHead from \"@mui/material/TableHead\";\nimport TableRow from \"@mui/material/TableRow\";\nimport Paper from \"@mui/material/Paper\";\nimport { Box, Typography, useTheme } from \"@mui/material\";\nimport { useHistory } from \"react-router\";\nimport { IBlock } from \"../pages/Profile/types\";\nimport { truncateString } from \"../utils\";\n\ntype TProps = {\n  blocks: IBlock[];\n};\n\nexport const BlocksTable: React.FC<TProps> = ({ blocks }) => {\n  const history = useHistory();\n  const theme = useTheme();\n  return (\n    <Box sx={{ padding: '10px' }}>\n      <TableContainer\n        sx={{\n          flex: 1,\n          marginTop: \"10px\",\n          border: \"3px solid \" + theme.palette.primary.main,\n          borderRadius: '10px',\n        }}\n        component={Paper}\n      >\n        <Typography variant=\"h6\" style={{ margin: \"16px\" }} color={\"primary\"}>\n          Blocks\n        </Typography>\n        <div\n          style={{\n            height: 3,\n            backgroundColor: theme.palette.primary.main,\n            margin: \"5px\",\n            borderRadius: 5,\n          }}\n        />\n        <Table sx={{ minWidth: 650 }} aria-label=\"simple table\">\n          <TableHead>\n            <TableRow>\n              <TableCell align=\"center\">Block Number</TableCell>\n              <TableCell align=\"center\">Timestamp</TableCell>\n              <TableCell align=\"center\">TXN</TableCell>\n              <TableCell align=\"center\">Uncles</TableCell>\n              <TableCell align=\"left\">Miner</TableCell>\n            </TableRow>\n          </TableHead>\n          <TableBody>\n            {blocks.map((row) => (\n              <TableRow\n                key={row.number}\n                sx={{ \"&:last-child td, &:last-child th\": { border: 0 } }}\n              >\n                <TableCell\n                  align=\"center\"\n                  style={{ textDecoration: 'underline', cursor: 'pointer' }}\n                  onClick={() => history.push(\"/explorer/block/\" + row.number)}\n                >\n                  {row.number}\n                </TableCell>\n                <TableCell align=\"center\">{row.timestamp}</TableCell>\n                <TableCell align=\"center\">{row.transactions.length}</TableCell>\n\n                <TableCell align=\"center\">{row.uncles.length}</TableCell>\n                <TableCell style={{ overflowX: \"hidden\" }} align=\"left\">\n                  {row.miner}\n                </TableCell>\n              </TableRow>\n            ))}\n          </TableBody>\n        </Table>\n      </TableContainer>\n    </Box>\n  );\n};\n","import React, { useEffect, useState } from \"react\";\nimport { BlocksTable } from \"../../components/BlocksTable\";\nimport { FullPageSpinner } from \"../../components/FullPageSpinner\";\nimport { getExplorerBlocks } from \"../../http\";\nimport { ExplorerRespose, IBlock } from \"../Profile/types\";\n\nexport interface IBlocksProps {}\n\nconst Blocks = (props: IBlocksProps) => {\n  const [blocks, setBlocks] = useState<ExplorerRespose<IBlock[]>>({\n    total: 0,\n    limit: 0,\n    items: [],\n    offset: 0,\n  });\n  const [loading, setLoading] = useState(true);\n  const getData = async () => {\n    setLoading(true);\n    try {\n      const { data } = await getExplorerBlocks();\n      setBlocks(data);\n      console.log(data);\n    } catch (error) {\n      console.log(error);\n    }\n    setLoading(false);\n  };\n  useEffect(() => {\n    getData();\n  }, []);\n  if (loading) return <FullPageSpinner />;\n  return <BlocksTable blocks={blocks.items} />;\n};\nexport default Blocks;\n"],"names":["BlocksTable","blocks","history","useHistory","theme","useTheme","Box","sx","padding","TableContainer","flex","marginTop","border","palette","primary","main","borderRadius","component","Paper","Typography","variant","style","margin","color","height","backgroundColor","Table","minWidth","TableHead","TableRow","TableCell","align","TableBody","map","row","textDecoration","cursor","onClick","push","number","timestamp","transactions","length","uncles","overflowX","miner","props","useState","total","limit","items","offset","setBlocks","loading","setLoading","getData","getExplorerBlocks","data","console","log","useEffect","FullPageSpinner"],"sourceRoot":""}