-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
47 changed files
with
879 additions
and
398 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
WS_CORETIME_CHAIN="WSS endpoint of the coretime chain" | ||
WS_RELAY_CHAIN="WSS endpoint of the coretime relay chain" | ||
WS_ROCOCO_CORETIME_CHAIN="WSS endpoint of the coretime chain" | ||
WS_KUSAMA_CORETIME_CHAIN="WSS endpoint of the coretime chain" | ||
WS_ROCOCO_RELAY_CHAIN="WSS endpoint of the coretime relay chain" | ||
WS_KUSAMA_RELAY_CHAIN="WSS endpoint of the coretime relay chain" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions
8
src/components/Elements/Buttons/ActionButton/index.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.buttonContainer { | ||
background:linear-gradient(180deg, #E84D68 0%, #AD2B49 100%); | ||
border-radius: 100px; | ||
font-weight: 500; | ||
text-transform: none; | ||
padding: 0.5rem 1.25rem; | ||
font-size: 0.8rem; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Button } from '@mui/material'; | ||
|
||
import styles from './index.module.scss'; | ||
|
||
interface ActionButtonProps { | ||
label: string; | ||
onClick: () => void; | ||
} | ||
export const ActionButton = ({ label, onClick }: ActionButtonProps) => { | ||
return ( | ||
<Button | ||
variant='contained' | ||
onClick={onClick} | ||
className={styles.buttonContainer} | ||
> | ||
{label} | ||
</Button> | ||
); | ||
}; |
8 changes: 8 additions & 0 deletions
8
src/components/Elements/Buttons/ProgressButton/index.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.buttonContainer { | ||
background:linear-gradient(180deg, #E84D68 0%, #AD2B49 100%); | ||
border-radius: 100px; | ||
font-weight: 500; | ||
text-transform: none; | ||
padding: 0.5rem 1.25rem; | ||
font-size: 0.8rem; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { LoadingButton } from '@mui/lab'; | ||
|
||
import styles from './index.module.scss'; | ||
|
||
interface ProgressButtonProps { | ||
label: string; | ||
onClick: () => void; | ||
loading: boolean; | ||
} | ||
export const ProgressButton = ({ | ||
label, | ||
onClick, | ||
loading, | ||
}: ProgressButtonProps) => { | ||
return ( | ||
<LoadingButton | ||
onClick={onClick} | ||
variant='contained' | ||
loading={loading} | ||
className={styles.buttonContainer} | ||
> | ||
{label} | ||
</LoadingButton> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './ActionButton'; | ||
export * from './ProgressButton'; |
39 changes: 39 additions & 0 deletions
39
src/components/Elements/CoreDetailsPanel/index.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
.container { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 2rem; | ||
padding: 1.5rem; | ||
flex-grow: 1; | ||
box-shadow: 2px 2px 55px rgba(0, 0, 0, 0.08); | ||
} | ||
|
||
.titleWrapper { | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.iconWrapper { | ||
width: 1.5rem; | ||
height: 1.5rem; | ||
margin: 0.5rem; | ||
} | ||
|
||
.infoWrapper { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1rem; | ||
} | ||
|
||
.detailWrapper { | ||
display: flex; | ||
justify-content: space-between; | ||
padding: 1.5rem; | ||
} | ||
|
||
.valueWrapper { | ||
background: #ecf1f9; | ||
padding: 0.5rem 0.75rem; | ||
border-radius: 0.5rem; | ||
display: flex; | ||
align-items: center; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
import { Box, Paper, Typography, useTheme } from '@mui/material'; | ||
import Image from 'next/image'; | ||
|
||
import GraphIcon from '@/assets/graph.png'; | ||
import { SaleInfo } from '@/models'; | ||
|
||
import styles from './index.module.scss'; | ||
|
||
interface DetailItemProps { | ||
label: string; | ||
description: string; | ||
value: number; | ||
} | ||
|
||
const DetailItem = ({ label, description, value }: DetailItemProps) => { | ||
const theme = useTheme(); | ||
return ( | ||
<Paper className={styles.detailWrapper}> | ||
<Box> | ||
<Typography | ||
sx={{ | ||
fontSize: '0.9rem', | ||
fontWeight: 600, | ||
color: theme.palette.common.black, | ||
}} | ||
> | ||
{label} | ||
</Typography> | ||
<Typography | ||
sx={{ | ||
fontSize: '0.8rem', | ||
fontWeight: 400, | ||
color: theme.palette.text.primary, | ||
}} | ||
> | ||
{description} | ||
</Typography> | ||
</Box> | ||
<Box className={styles.valueWrapper}> | ||
<Typography | ||
sx={{ | ||
fontSize: '0.8rem', | ||
color: theme.palette.text.secondary, | ||
fontWeight: 700, | ||
lineHeight: 1, | ||
}} | ||
> | ||
{value} | ||
</Typography> | ||
</Box> | ||
</Paper> | ||
); | ||
}; | ||
|
||
interface CoreDetailsPanelProps { | ||
saleInfo: SaleInfo; | ||
} | ||
|
||
export const CoreDetailsPanel = ({ saleInfo }: CoreDetailsPanelProps) => { | ||
const theme = useTheme(); | ||
return ( | ||
<Paper className={styles.container}> | ||
<Box className={styles.titleWrapper}> | ||
<Image src={GraphIcon} alt='graph' className={styles.iconWrapper} /> | ||
<Typography | ||
sx={{ | ||
color: theme.palette.common.black, | ||
fontSize: '1rem', | ||
fontWeight: 700, | ||
}} | ||
> | ||
Core Details | ||
</Typography> | ||
</Box> | ||
<Box className={styles.infoWrapper}> | ||
<DetailItem | ||
label='Cores offered' | ||
description='Numbers of cores which are offered for sale' | ||
value={saleInfo.coresOffered} | ||
/> | ||
<DetailItem | ||
label='Cores sold' | ||
description='Numbers of cores which have been sold' | ||
value={saleInfo.coresSold} | ||
/> | ||
<DetailItem | ||
label='Ideal cores sold' | ||
description='Numbers of cores sold to not affect the price for next sale' | ||
value={saleInfo.idealCoresSold} | ||
/> | ||
</Box> | ||
</Paper> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { FormControl, InputLabel, MenuItem, Select } from '@mui/material'; | ||
import { useRouter } from 'next/router'; | ||
|
||
const RelaySelect = () => { | ||
const router = useRouter(); | ||
const { network } = router.query; | ||
|
||
const handleChange = (e: any) => { | ||
router.push( | ||
{ | ||
pathname: router.pathname, | ||
query: { ...router.query, network: e.target.value }, | ||
}, | ||
undefined, | ||
{ shallow: false } | ||
); | ||
}; | ||
|
||
return ( | ||
<FormControl sx={{ m: 2, minWidth: 150 }} fullWidth> | ||
<InputLabel>Network</InputLabel> | ||
<Select | ||
id='network-select' | ||
value={network ? network : 'rococo'} | ||
label='Relay chain' | ||
onChange={handleChange} | ||
> | ||
<MenuItem value='rococo'>Rococo</MenuItem> | ||
<MenuItem value='kusama'>Kusama</MenuItem> | ||
</Select> | ||
</FormControl> | ||
); | ||
}; | ||
|
||
export default RelaySelect; |
Oops, something went wrong.