Skip to content

Commit

Permalink
fix: display vesting end and start as dates
Browse files Browse the repository at this point in the history
  • Loading branch information
belopash committed May 16, 2024
1 parent 3a2be72 commit 0872a9f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/api/contracts/vesting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ export function useVestings({ addresses }: { addresses?: `0x${string}`[] }) {
return {
data: data
? chunk(data, 8).map(ch => ({
start: unwrapResult(ch[0])?.toString(),
end: unwrapResult(ch[1])?.toString(),
start: Number(unwrapResult(ch[0])) * 1000,
end: Number(unwrapResult(ch[1])) * 1000,
deposited: unwrapResult(ch[2])?.toString(),
releasable: unwrapResult(ch[3])?.toString(),
released: unwrapResult(ch[4])?.toString(),
Expand Down
5 changes: 3 additions & 2 deletions src/pages/AssetsPage/Vesting.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';

import { dateFormat } from '@i18n';
import { addressFormatter, percentFormatter } from '@lib/formatters/formatters';
import { Divider, Stack, styled } from '@mui/material';
import { Box } from '@mui/system';
Expand Down Expand Up @@ -104,11 +105,11 @@ export function Vesting({ backPath }: { backPath: string }) {
<Stack spacing={2} direction="column">
<Stack direction="row">
<DescLabel>Start</DescLabel>
<DescValue>{data.start || '-'}</DescValue>
<DescValue>{dateFormat(data.start, 'dateTime')}</DescValue>
</Stack>
<Stack direction="row">
<DescLabel>End</DescLabel>
<DescValue>{data.end || '-'}</DescValue>
<DescValue>{dateFormat(data.end, 'dateTime')}</DescValue>
</Stack>
<Stack direction="row">
<DescLabel>Initial release</DescLabel>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/GatewaysPage/GatewaysPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export function MyGateways() {
</TableCell>
<TableCell>{formatSqd(SQD_TOKEN, gateway.pendingStaked)}</TableCell>
<TableCell>{formatSqd(SQD_TOKEN, gateway.totalStaked)}</TableCell>
<TableCell>{dateFormat(gateway.createdAt)}</TableCell>
<TableCell>{dateFormat(gateway.createdAt, 'dateTime')}</TableCell>
</TableRow>
);
})}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/WorkersPage/WorkerStatistics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const WorkerStatistics = ({ worker }: { worker: BlockchainApiFullWorker }
<Stack spacing={2} direction="column">
<Stack direction="row">
<WorkerDescLabel>Registered</WorkerDescLabel>
<WorkerDescValue>{dateFormat(worker.createdAt)}</WorkerDescValue>
<WorkerDescValue>{dateFormat(worker.createdAt, 'dateTime')}</WorkerDescValue>
</Stack>
<Stack direction="row">
<WorkerDescLabel>Version</WorkerDescLabel>
Expand Down

0 comments on commit 0872a9f

Please sign in to comment.