Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-aurele-besner committed Dec 13, 2024
1 parent 99b254e commit 2f1a565
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
3 changes: 2 additions & 1 deletion explorer/gql/graphql.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18290,7 +18290,7 @@ export type TransfersByAccountIdQueryVariables = Exact<{
}>;


export type TransfersByAccountIdQuery = { __typename?: 'query_root', consensus_transfers_aggregate: { __typename?: 'consensus_transfers_aggregate', aggregate?: { __typename?: 'consensus_transfers_aggregate_fields', count: number } | null }, consensus_transfers: Array<{ __typename?: 'consensus_transfers', id: string, extrinsic_id: string, event_id: string, from: string, to: string, value: any, fee: any, success: boolean, timestamp: any }> };
export type TransfersByAccountIdQuery = { __typename?: 'query_root', consensus_transfers_aggregate: { __typename?: 'consensus_transfers_aggregate', aggregate?: { __typename?: 'consensus_transfers_aggregate_fields', count: number } | null }, consensus_transfers: Array<{ __typename?: 'consensus_transfers', id: string, block_height: any, extrinsic_id: string, event_id: string, from: string, to: string, value: any, fee: any, success: boolean, timestamp: any }> };

export type BalanceHistoryByAccountIdQueryVariables = Exact<{
limit: Scalars['Int']['input'];
Expand Down Expand Up @@ -19165,6 +19165,7 @@ export const TransfersByAccountIdDocument = gql`
where: $where
) {
id
block_height
extrinsic_id
event_id
from
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { downloadFullData } from 'utils/downloadFullData'
import { bigNumberToNumber } from 'utils/number'
import { formatExtrinsicId } from 'utils/string'
import { countTablePages } from 'utils/table'
import { utcToLocalRelativeTime } from 'utils/time'
import { QUERY_ACCOUNT_TRANSFERS } from './query'

type Props = {
Expand All @@ -40,7 +41,7 @@ type Row = TransfersByAccountIdQuery['consensus_transfers'][0]
export const AccountTransfersList: FC<Props> = ({ accountId }) => {
const { ref, inView } = useInView()
const [sorting, setSorting] = useState<SortingState>([
{ id: TransferColumn.CreatedAt, desc: true },
{ id: TransferColumn.BlockHeight, desc: true },
])
const [pagination, setPagination] = useState({
pageSize: PAGE_SIZE,
Expand Down Expand Up @@ -117,7 +118,7 @@ export const AccountTransfersList: FC<Props> = ({ accountId }) => {
const columns = useMemo(
() => [
{
accessorKey: 'created_at',
accessorKey: 'block_height',
header: 'Block',
enableSorting: true,
cell: ({ row }: Cell<Row>) => (
Expand All @@ -127,11 +128,11 @@ export const AccountTransfersList: FC<Props> = ({ accountId }) => {
href={INTERNAL_ROUTES.blocks.id.page(
network,
Routes.consensus,
row.original.created_at,
row.original.block_height,
)}
className='hover:text-primaryAccent'
>
<div>{row.original.created_at}</div>
<div>{row.original.block_height}</div>
</Link>
</div>
),
Expand Down Expand Up @@ -236,7 +237,7 @@ export const AccountTransfersList: FC<Props> = ({ accountId }) => {
enableSorting: true,
cell: ({ row }: Cell<Row>) => (
<div key={`${row.original.id}-created_at-${row.index}`}>
{row.original.timestamp(row.original.date)}
{utcToLocalRelativeTime(row.original.timestamp)}
</div>
),
},
Expand Down
4 changes: 2 additions & 2 deletions explorer/src/components/Consensus/Account/BalanceHistory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ type Row = BalanceHistoryByAccountIdQuery['consensus_account_histories'][0]
export const BalanceHistory: FC<Props> = ({ accountId }) => {
const { ref, inView } = useInView()
const [sorting, setSorting] = useState<SortingState>([
{ id: TransferColumn.CreatedAt, desc: true },
{ id: TransferColumn.BlockHeight, desc: true },
])
const [pagination, setPagination] = useState({
pageSize: PAGE_SIZE,
Expand All @@ -53,7 +53,7 @@ export const BalanceHistory: FC<Props> = ({ accountId }) => {
? sorting[0].id.endsWith('aggregate')
? { [sorting[0].id]: sorting[0].desc ? { count: OrderBy.Desc } : { count: OrderBy.Asc } }
: { [sorting[0].id]: sorting[0].desc ? OrderBy.Desc : OrderBy.Asc }
: { id: OrderBy.Asc },
: { [TransferColumn.BlockHeight]: OrderBy.Asc },
[sorting],
)

Expand Down
1 change: 1 addition & 0 deletions explorer/src/components/Consensus/Account/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ export const QUERY_ACCOUNT_TRANSFERS = gql`
}
consensus_transfers(order_by: $orderBy, limit: $limit, offset: $offset, where: $where) {
id
block_height
extrinsic_id
event_id
from
Expand Down

0 comments on commit 2f1a565

Please sign in to comment.