diff --git a/src/modules/l2-rollup/index.tsx b/src/modules/l2-rollup/index.tsx index e9af96571..a9e1d291b 100644 --- a/src/modules/l2-rollup/index.tsx +++ b/src/modules/l2-rollup/index.tsx @@ -26,6 +26,11 @@ import { Text, Tooltip, useDisclosure, + Tab, + TabList, + TabPanel, + TabPanels, + Tabs, } from '@chakra-ui/react'; import orderBy from 'lodash/orderBy'; import { useEffect, useMemo, useRef, useState } from 'react'; @@ -84,7 +89,7 @@ const L2Rollup = () => { const rollupL2Api = new CRollupL2API(); const [currentSort, setCurrentSort] = useState({ - type: SortRollupType.level, + type: SortRollupType.tps, ascending: false, }); @@ -1088,201 +1093,229 @@ const L2Rollup = () => { mt={isShowIntro ? 'calc(100dvh - 696px)' : 'calc(100dvh - 412px)'} > {isShowIntro && renderIntro()} - - setHoverTooltip(true)} - onMouseLeave={() => setHoverTooltip(false)} - > - {hoverTooltip && ( - - About project Bitcoin Heartbeats - - )} - setIsShowIntro(!isShowIntro)} - /> - - - - Transaction Count - {`Today Ξ${formatCurrency( - (_dataChart.txs?.[_dataChart.txs.length - 1] as any) - ?.y as any, - 0, - 2, - )}`} - - } - /> - - Bitcoin l2 Active addresses - - - - {`Ξ${formatCurrency( + + + Realtime Data + Static Data + + setHoverTooltip(true)} + onMouseLeave={() => setHoverTooltip(false)} + > + {hoverTooltip && ( + + About project Bitcoin Heartbeats + + )} + setIsShowIntro(!isShowIntro)} + /> + + + + + + + {data.length <= 0 ? ( + + + + ) : ( + + )} + + + + + + + Transaction Count + {`Today Ξ${formatCurrency( + (_dataChart.txs?.[_dataChart.txs.length - 1] as any) + ?.y as any, + 0, + 2, + )}`} + + } + /> + + + Bitcoin l2 Active addresses + + + + + {`Ξ${formatCurrency( + ( + _dataChart.addresses?.[ + _dataChart.addresses.length - 1 + ] as any + )?.y as any, + 0, + 2, + )}`} + + + + + + + + + + } + /> + + Fees Paid by Users + {`Today $${formatCurrency( ( - _dataChart.addresses?.[ - _dataChart.addresses.length - 1 + _dataChart.fees?.[ + _dataChart.fees.length - 1 ] as any )?.y as any, 0, 2, - )}`} - - - - - - - - - - } - /> - + + } + /> + + + + * This data has been collected from{' '} + {chainsSupportForChart.join(', ')} chains.{' '} + + Rollux, Merlin, Core, and Stacks will be coming soon. + + + + + + + + + + + Total + - Fees Paid by Users - {`Today $${formatCurrency( - (_dataChart.fees?.[_dataChart.fees.length - 1] as any) - ?.y as any, - 0, - 2, - )}`} + {renderItemTotal( + 'TPS', + formatCurrency(total.tps, MIN_DECIMAL, MIN_DECIMAL), + 'The total transactions per second', + bitcoinRollup + ? `(${formatCurrency( + Math.abs(total.tps / bitcoinRollup.tps), + MIN_DECIMAL, + MIN_DECIMAL, + )}x)` + : '-', + )} + {renderItemTotal( + 'Mgas/s', + formatCurrency(total.mgas, MIN_DECIMAL, MIN_DECIMAL), + 'The total megagas (Million Gas) per second', + '', + )} + {renderItemTotal( + 'KB/s', + formatCurrency(total.kbs, MIN_DECIMAL, MIN_DECIMAL), + 'Total KB per second', + bitcoinRollup + ? `(${formatCurrency( + Math.abs(total.kbs / bitcoinRollup.kbs), + MIN_DECIMAL, + MIN_DECIMAL, + )}x)` + : '-', + )} - } - /> - - - - * This data has been collected from{' '} - {chainsSupportForChart.join(', ')} chains.{' '} - Rollux, Merlin, Core, and Stacks will be coming soon. - - - - - - + + + + - - - Total - - - {renderItemTotal( - 'TPS', - formatCurrency(total.tps, MIN_DECIMAL, MIN_DECIMAL), - 'The total transactions per second', - bitcoinRollup - ? `(${formatCurrency( - Math.abs(total.tps / bitcoinRollup.tps), - MIN_DECIMAL, - MIN_DECIMAL, - )}x)` - : '-', - )} - {renderItemTotal( - 'Mgas/s', - formatCurrency(total.mgas, MIN_DECIMAL, MIN_DECIMAL), - 'The total megagas (Million Gas) per second', - '', - )} - {renderItemTotal( - 'KB/s', - formatCurrency(total.kbs, MIN_DECIMAL, MIN_DECIMAL), - 'Total KB per second', - bitcoinRollup - ? `(${formatCurrency( - Math.abs(total.kbs / bitcoinRollup.kbs), - MIN_DECIMAL, - MIN_DECIMAL, - )}x)` - : '-', - )} - - - - {data.length <= 0 ? ( - - - - ) : ( - - )} - button { + background: none; + border: none; + color: #fff; + opacity: 50%; + font-weight: 400; + + flex: unset; + position: relative; + text-align: center; + + &[aria-selected='true'] { + opacity: 1; + font-weight: 600; + color: #fa4e0e !important; + + &::after { + content: ''; + display: block; + height: 2px; + width: 100%; + background-color: #fa4e0e !important; + position: absolute; + bottom: 0; + } + } + } + } + + .tabPanel { + > [role='tabpanel'] { + padding: 0; + border-color: transparent !important; + } + border-color: transparent !important; + } } .search {