Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Szegoo committed Sep 19, 2024
1 parent ff8e4cf commit 7c2245c
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 58 deletions.
2 changes: 1 addition & 1 deletion src/hooks/sale/burnInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const useBurnInfo = (network: NetworkType) => {

setCurrentBurn(parseInt(data.sales.nodes[0]?.burn || '0'));
setPrevBurn(parseInt(data.sales.nodes[1]?.burn || '0'));
setTotalBurn(parseInt(data.stats.nodes[0].totalBurn));
setTotalBurn(parseInt(data.stats.nodes[0]?.totalBurn) || 0);
setLoading(false);
};
asyncFetchData();
Expand Down
5 changes: 2 additions & 3 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,7 @@ const Home = () => {
},
];

return status !== ContextStatus.LOADED ||
apiState !== ApiState.READY ||
return apiState !== ApiState.READY ||
loadingBurnInfo ||
loadingPurchaseHistory ? (
<Backdrop open>
Expand Down Expand Up @@ -278,7 +277,7 @@ const Home = () => {
</Button>
))}
</Stack>
{status === ContextStatus.LOADED && (
{(
<Card sx={{ padding: '1.5rem' }} data-cy='purchase-history-table'>
<Stack direction='column' gap='1rem'>
<Box>
Expand Down
88 changes: 34 additions & 54 deletions src/pages/purchase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,65 +111,45 @@ const Purchase = () => {
</Box>
<Balance ctBalance />
</Box>
<Box mt={'.5rem'}>
<Banner
content={
isNewPricing(height, network)
? 'Learn about the new Coretime pricing model: '
: 'Learn about the new Coretime pricing model coming to Kusama soon: '
}
link={{
title: 'Agile Coretime Pricing Explained',
href: 'https://grillapp.net/12935/agile-coretime-pricing-explained-166522?ref=12935',
}}
severity='info'
/>
</Box>
<Box>
{status !== ContextStatus.LOADED ? (
<Backdrop open data-cy='loading'>
<CircularProgress />
</Backdrop>
) : (
<Box sx={{ display: 'flex', flexDirection: 'column', gap: '0.75rem' }}>
<SaleInfoPanel />
<Box sx={{ display: 'flex', gap: '1rem' }}>
<CoreDetailsPanel saleInfo={saleInfo} />
<SalePhaseInfoPanel />
</Box>

<Box
<Box sx={{ display: 'flex', flexDirection: 'column', gap: '0.75rem' }}>
<SaleInfoPanel />
<Box sx={{ display: 'flex', gap: '1rem' }}>
<CoreDetailsPanel saleInfo={saleInfo} />
<SalePhaseInfoPanel />
</Box>

<Box
sx={{
display: 'flex',
gap: '2rem',
justifyContent: 'space-between',
}}
>
<Button
size='small'
variant='outlined'
sx={{
display: 'flex',
gap: '2rem',
justifyContent: 'space-between',
bgcolor: theme.palette.common.white,
padding: '0.5rem 0.75rem',
borderRadius: 100,
fontSize: '0.75rem',
fontWeight: 700,
marginLeft: 'auto',
}}
onClick={onManage}
data-cy='btn-manage-regions'
>
<Button
size='small'
variant='outlined'
sx={{
bgcolor: theme.palette.common.white,
padding: '0.5rem 0.75rem',
borderRadius: 100,
fontSize: '0.75rem',
fontWeight: 700,
marginLeft: 'auto',
}}
onClick={onManage}
data-cy='btn-manage-regions'
>
Manage your regions
</Button>
<ProgressButton
onClick={onPurchase}
loading={working}
label='Purchase Core'
data-cy='btn-purchase-core'
/>
</Box>
Manage your regions
</Button>
<ProgressButton
onClick={onPurchase}
loading={working}
label='Purchase Core'
data-cy='btn-purchase-core'
/>
</Box>
)}
</Box>
</Box>
</Box>
);
Expand Down

0 comments on commit 7c2245c

Please sign in to comment.