Skip to content

Commit

Permalink
para dashboard complete
Browse files Browse the repository at this point in the history
  • Loading branch information
Szegoo committed Oct 3, 2024
1 parent 3672c81 commit 7f27302
Show file tree
Hide file tree
Showing 11 changed files with 117 additions and 178 deletions.
2 changes: 1 addition & 1 deletion src/components/Layout/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import styles from './index.module.scss';
export const Header = () => {
const theme = useTheme();
const {
state: { accounts, activeAccount, status },
state: { accounts, activeAccount },
setActiveAccount,
disconnectWallet,
connectWallet,
Expand Down
38 changes: 0 additions & 38 deletions src/components/Paras/CoreExpiryCard/index.tsx

This file was deleted.

9 changes: 3 additions & 6 deletions src/components/Paras/LeaseStateCard/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Stack, Typography } from '@mui/material';
import { humanizer } from 'humanize-duration';

import { leases } from '@/chaindata';
Expand Down Expand Up @@ -29,10 +28,8 @@ export const LeaseStateCard = ({ paraId, height }: LeaseStateProps) => {
if (height > until) return <></>;

return (
<Stack direction='column' gap='0.5rem' alignItems='start'>
<Typography>
{`Lease expires in ${formatDuration((until - height) * RELAY_CHAIN_BLOCK_TIME)}`}
</Typography>
</Stack>
<p style={{ fontSize: '14px', padding: '0 1rem' }}>
{`Lease expires in ${formatDuration((until - height) * RELAY_CHAIN_BLOCK_TIME)}`}
</p>
);
};
10 changes: 6 additions & 4 deletions src/components/Paras/Modals/Register/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import CloudUploadOutlinedIcon from '@mui/icons-material/CloudUploadOutlined';
import CodeOutlinedIcon from '@mui/icons-material/CodeOutlined';
import {
Box,
Button,
Dialog,
DialogActions,
DialogContent,
Expand All @@ -11,13 +10,14 @@ import {
useTheme,
} from '@mui/material';
import { compactAddLength } from '@polkadot/util';
import { Button } from '@region-x/components';
import { useEffect, useState } from 'react';

import { useParasInfo } from '@/hooks';
import { useSubmitExtrinsic } from '@/hooks/submitExtrinsic';
import { getBalanceString } from '@/utils/functions';

import { FileInput, ProgressButton } from '@/components/Elements';
import { FileInput } from '@/components/Elements';

import { useAccounts } from '@/contexts/account';
import { useRelayApi } from '@/contexts/apis';
Expand Down Expand Up @@ -152,11 +152,13 @@ export const RegisterModal = ({
</Box>
</DialogContent>
<DialogActions>
<Button onClick={onClose} variant='outlined'>
<Button onClick={onClose} color='dark'>
Cancel
</Button>

<ProgressButton onClick={onRegister} label='Register' loading={working} />
<Button onClick={onRegister} loading={working}>
Register
</Button>
</DialogActions>
</Dialog>
);
Expand Down
10 changes: 4 additions & 6 deletions src/components/Paras/Modals/Reserve/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {
Box,
Button,
Dialog,
DialogActions,
DialogContent,
Expand All @@ -9,7 +8,7 @@ import {
Typography,
useTheme,
} from '@mui/material';
import { Button as RxButton } from '@region-x/components';
import { Button } from '@region-x/components';
import { useState } from 'react';

import { useParasInfo } from '@/hooks';
Expand Down Expand Up @@ -110,14 +109,13 @@ export const ReserveModal = ({ open, onClose, paraId, reservationCost }: Reserve
</Box>
</DialogContent>
<DialogActions>
<Button onClick={onClose} variant='outlined'>
<Button onClick={onClose} color='dark'>
Cancel
</Button>

{/* TODO: something off with alignment */}
<RxButton onClick={onReserve} loading={working}>
<Button onClick={onReserve} loading={working}>
Reserve
</RxButton>
</Button>
</DialogActions>
</Dialog>
);
Expand Down
4 changes: 2 additions & 2 deletions src/components/Paras/ParaStateCard/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Tooltip, Typography } from '@mui/material';
import { Tooltip } from '@mui/material';
import { LabelCard } from '@region-x/components';

import { ParaState } from '@/models';
import { LabelCard } from '@region-x/components';

export const ParaStateCard = ({ state }: { state: ParaState }) => {
const properties = {
Expand Down
1 change: 0 additions & 1 deletion src/components/Paras/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export * from './CoreExpiryCard';
export * from './LeaseStateCard';
export * from './Modals';
export * from './ParaDisplay';
Expand Down
4 changes: 1 addition & 3 deletions src/components/Renew/action.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import { Stack } from '@mui/material';
import { Button } from '@region-x/components';
import { useState } from 'react';

import { RenewableParachain } from '@/hooks';
import { useSubmitExtrinsic } from '@/hooks/submitExtrinsic';

import { ProgressButton } from '@/components';

import { useAccounts } from '@/contexts/account';
import { useCoretimeApi } from '@/contexts/apis';
import { useToast } from '@/contexts/toast';
import { Button } from '@region-x/components';

interface RenewActionProps {
parachain: RenewableParachain;
Expand Down
11 changes: 5 additions & 6 deletions src/components/Renew/select.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import { Stack } from '@mui/material';
import { useRouter } from 'next/router';

import { RenewableParachain } from '@/hooks';

import { useNetwork } from '@/contexts/network';
import { Select } from '@region-x/components';
import { SelectOption } from '@region-x/components/dist/types/types';
import { chainData } from '@/chaindata';
import Image from 'next/image';
import { useRouter } from 'next/router';

import { RenewableParachain } from '@/hooks';

import Unknown from '@/assets/unknown.svg';
import { chainData } from '@/chaindata';
import { useNetwork } from '@/contexts/network';

interface SelectParachainProps {
parachains: RenewableParachain[];
Expand Down
Loading

0 comments on commit 7f27302

Please sign in to comment.