diff --git a/dashboard/src/pages/scan/state/[tab].tsx b/dashboard/src/pages/scan/state/[tab].tsx index d82a7ce70f..c5cf5727c1 100644 --- a/dashboard/src/pages/scan/state/[tab].tsx +++ b/dashboard/src/pages/scan/state/[tab].tsx @@ -76,62 +76,62 @@ const StateList = () => { } return ( - - - - - - - {!hideText && 'Get'} - - } - /> - - - {!hideText && 'List'} - - } - /> - - + + + + + + + {!hideText && 'Get'} + + } + /> + + + {!hideText && 'List'} + + } + /> + - {isLoading ? ( - - - Loading... - - ) : ( - - {tabContentList[activeTab]} - - )} - + + {isLoading ? ( + + + Loading... + + ) : ( + + {tabContentList[activeTab]} + + )} + ) } diff --git a/dashboard/src/views/feature/SessionKeyList.tsx b/dashboard/src/views/feature/SessionKeyList.tsx index 873ee9cb16..7e921028b9 100644 --- a/dashboard/src/views/feature/SessionKeyList.tsx +++ b/dashboard/src/views/feature/SessionKeyList.tsx @@ -2,13 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 // ** React Imports -import {useState, useRef, useMemo, useEffect} from 'react' +import { useState, useRef, useMemo, useEffect } from 'react' -import {useAuth} from 'src/hooks/useAuth' -import {useSession} from 'src/hooks/useSessionAccount' -import {useRooch} from 'src/hooks/useRooch' +import { useAuth } from 'src/hooks/useAuth' +import { useSession } from 'src/hooks/useSessionAccount' +import { useRooch } from 'src/hooks/useRooch' -import Grid from '@mui/material/Grid' import Box from '@mui/material/Box' import Card from '@mui/material/Card' import CardHeader from '@mui/material/CardHeader' @@ -30,8 +29,8 @@ import { } from '@mui/x-data-grid' // ** Store & Actions Imports -import {fetchData, removeRow} from 'src/store/session' -import {useAppDispatch, useAppSelector} from 'src/store' +import { fetchData, removeRow } from 'src/store/session' +import { useAppDispatch, useAppSelector } from 'src/store' const formatDate = (timestamp: number) => { if (timestamp === 0) { @@ -128,7 +127,7 @@ export default function SessionKeyList() { // ** Hooks const dispatch = useAppDispatch() - const {result, status, error} = useAppSelector((state) => state.session) + const { result, status, error } = useAppSelector((state) => state.session) useEffect(() => { const defaultAccount = auth.defaultAccount @@ -235,15 +234,10 @@ export default function SessionKeyList() { return ( - + - - @@ -259,7 +253,7 @@ export default function SessionKeyList() { {error} diff --git a/dashboard/src/views/scan/state/list/index.tsx b/dashboard/src/views/scan/state/list/index.tsx index 10a35eb962..5a2126d67f 100644 --- a/dashboard/src/views/scan/state/list/index.tsx +++ b/dashboard/src/views/scan/state/list/index.tsx @@ -2,26 +2,25 @@ // SPDX-License-Identifier: Apache-2.0 // ** React Imports -import {useState, useEffect, useRef, useMemo, useCallback} from 'react' +import { useState, useEffect, useRef, useMemo, useCallback } from 'react' // ** Next Import import Link from 'next/link' // ** MUI Imports import Card from '@mui/material/Card' -import {styled} from '@mui/material/styles' +import { styled } from '@mui/material/styles' import Typography from '@mui/material/Typography' -import {DataGrid, GridColDef} from '@mui/x-data-grid' +import { DataGrid, GridColDef } from '@mui/x-data-grid' // ** Store & Actions Imports -import {fetchData} from 'src/store/scan/state/list' -import {useAppDispatch, useAppSelector} from 'src/store' +import { fetchData } from 'src/store/scan/state/list' +import { useAppDispatch, useAppSelector } from 'src/store' // ** Utils -import {formatAddress} from 'src/@core/utils/format' -import {useRooch} from '../../../../hooks/useRooch' +import { formatAddress } from 'src/@core/utils/format' +import { useRooch } from '../../../../hooks/useRooch' import CardSnippet from '../../../../@core/components/card-snippet' -import Grid from '@mui/material/Grid' import Spinner from '../../../../@core/components/spinner' import CardHeader from '@mui/material/CardHeader' import CardContent from '@mui/material/CardContent' @@ -35,7 +34,7 @@ interface CellType { } // ** Styled components -const LinkStyled = styled(Link)(({theme}) => ({ +const LinkStyled = styled(Link)(({ theme }) => ({ fontSize: '1rem', textDecoration: 'none', color: theme.palette.primary.main, @@ -45,13 +44,13 @@ const TransactionList = () => { // Hook const rooch = useRooch() const dispatch = useAppDispatch() - const {result, status, error} = useAppSelector((state) => state.statePageView) + const { result, status, error } = useAppSelector((state) => state.statePageView) // ** State const [accessPath, setAccessPath] = useState('/object/0x1') const [cacheResult, setCacheResult] = useState<{ [page: number]: any[] }>({}) - const [paginationModel, setPaginationModel] = useState({page: 0, pageSize: 10}) + const [paginationModel, setPaginationModel] = useState({ page: 0, pageSize: 10 }) const [curStateView, setCurStateView] = useState(null) const mapPageToNextCursor = useRef<{ [page: number]: Uint8Array | null }>({}) const queryOptions = useMemo( @@ -68,7 +67,7 @@ const TransactionList = () => { // We add nextCursor when available mapPageToNextCursor.current[paginationModel.page] = result.next_cursor cacheResult[paginationModel.page] = result.data - setCacheResult({...cacheResult}) + setCacheResult({ ...cacheResult }) const count = Object.values(cacheResult).reduce((sum, data) => sum + data.length, 0) setCount(count) } @@ -147,7 +146,7 @@ const TransactionList = () => { minWidth: 90, field: 'type', headerName: 'Type', - renderCell: ({row}: CellType) => ( + renderCell: ({ row }: CellType) => ( { @@ -165,8 +164,8 @@ const TransactionList = () => { minWidth: 90, field: 'id', headerName: 'ID', - renderCell: ({row}: CellType) => ( - + renderCell: ({ row }: CellType) => ( + {formatAddress(row.decoded_value.value.id)} ), @@ -177,8 +176,8 @@ const TransactionList = () => { minWidth: 90, field: 'owner', headerName: 'Owner', - renderCell: ({row}: CellType) => ( - + renderCell: ({ row }: CellType) => ( + {formatAddress(row.decoded_value.value.owner)} ), @@ -190,7 +189,7 @@ const TransactionList = () => { return ( <> - + { endAdornment: ( ), @@ -219,43 +218,43 @@ const TransactionList = () => { {status === 'loading' ? ( - + ) : ( <> - - + ({...row, id: row.decoded_value.value.id})) - : [] - } - columns={defaultColumns.map((v) => ({ - ...v, - sortable: false, - }))} - paginationModel={paginationModel} - onPaginationModelChange={setPaginationModel} - /> - - + .map((row: any) => ({ ...row, id: row.decoded_value.value.id })) + : [] + } + columns={defaultColumns.map((v) => ({ + ...v, + sortable: false, + }))} + paginationModel={paginationModel} + onPaginationModelChange={setPaginationModel} + /> + + {curStateView ? curStateView.decoded_value.type : 'Current Page Raw Data'} - + )}