-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #837 from invariant-labs/dev
Update staging env
- Loading branch information
Showing
26 changed files
with
3,770 additions
and
6,237 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,41 @@ | ||
import React from 'react' | ||
import useStyles from './style' | ||
import { blurContent, unblurContent } from '@utils/uiUtils' | ||
import { Button, useMediaQuery } from '@mui/material' | ||
import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown' | ||
import YourPointsModal from '@components/Modals/YourPointsModal/YourPointsModals' | ||
import { theme } from '@static/theme' | ||
|
||
export interface IProps { | ||
disabled?: boolean | ||
} | ||
export const YourPointsButton: React.FC<IProps> = ({ disabled = false }) => { | ||
const isSm = useMediaQuery(theme.breakpoints.down('sm')) | ||
const { classes } = useStyles() | ||
const [anchorEl, setAnchorEl] = React.useState<HTMLButtonElement | null>(null) | ||
const [openNetworks, setOpenNetworks] = React.useState<boolean>(false) | ||
const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => { | ||
setAnchorEl(event.currentTarget) | ||
blurContent() | ||
setOpenNetworks(true) | ||
} | ||
|
||
const handleClose = () => { | ||
unblurContent() | ||
setOpenNetworks(false) | ||
} | ||
|
||
return ( | ||
<> | ||
<Button | ||
className={classes.pointsHeaderButton} | ||
variant='contained' | ||
classes={{ disabled: classes.disabled }} | ||
disabled={disabled} | ||
onClick={handleClick}> | ||
<>{isSm ? <KeyboardArrowDownIcon id='downIcon' /> : 'Points'}</> | ||
</Button> | ||
<YourPointsModal open={openNetworks} anchorEl={anchorEl} handleClose={handleClose} /> | ||
</> | ||
) | ||
} |
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,101 @@ | ||
import { Typography, Box, Button } from '@mui/material' | ||
import { colors, typography } from '@static/theme' | ||
import React from 'react' | ||
import useStyles from './style' | ||
import { useNavigate } from 'react-router-dom' | ||
|
||
interface ITimerProps { | ||
hours: string | ||
minutes: string | ||
seconds: string | ||
handleClose: () => void | ||
} | ||
|
||
export const Timer: React.FC<ITimerProps> = ({ hours, minutes, seconds, handleClose }) => { | ||
const { classes } = useStyles() | ||
const navigate = useNavigate() | ||
|
||
return ( | ||
<> | ||
<Typography style={{ color: colors.invariant.text }}> | ||
<span | ||
style={{ | ||
color: colors.invariant.text, | ||
textAlign: 'center', | ||
textShadow: '0px 0px 5px #FFFFFF80' | ||
}}> | ||
Invariant Points launches in: | ||
</span> | ||
</Typography> | ||
|
||
<Box | ||
sx={{ | ||
display: 'flex', | ||
textAlign: 'center', | ||
justifyItems: 'center', | ||
alignItems: 'center', | ||
width: '100%', | ||
marginTop: '8px' | ||
}}> | ||
<Box | ||
sx={{ | ||
width: '57px', | ||
height: 'fit-content', | ||
padding: '6px', | ||
borderRadius: '4px', | ||
color: colors.invariant.text, | ||
fontWeight: 700, | ||
lineHeight: '20px', | ||
fontSize: '24px' | ||
}}> | ||
{hours}H | ||
</Box> | ||
<Box sx={{ paddingLeft: '2px', paddingRight: '2px' }}> | ||
<Typography style={{ ...typography.heading4, color: colors.invariant.text }}> | ||
: | ||
</Typography> | ||
</Box> | ||
<Box | ||
sx={{ | ||
width: '57px', | ||
height: 'fit-content', | ||
padding: '6px', | ||
borderRadius: '4px', | ||
color: colors.invariant.text, | ||
fontWeight: 700, | ||
lineHeight: '20px', | ||
fontSize: '24px' | ||
}}> | ||
{minutes}M | ||
</Box> | ||
<Box sx={{ paddingLeft: '2px', paddingRight: '2px' }}> | ||
<Typography style={{ ...typography.heading4, color: colors.invariant.text }}> | ||
: | ||
</Typography> | ||
</Box> | ||
<Box | ||
sx={{ | ||
width: '57px', | ||
height: 'fit-content', | ||
padding: '6px', | ||
borderRadius: '4px', | ||
color: colors.invariant.text, | ||
fontWeight: 700, | ||
lineHeight: '20px', | ||
fontSize: '24px' | ||
}}> | ||
{seconds}S | ||
</Box> | ||
</Box> | ||
<Button | ||
className={classes.button} | ||
style={{ marginTop: '16px' }} | ||
onClick={() => { | ||
handleClose() | ||
navigate('/points') | ||
}}> | ||
Go to Points Tab | ||
</Button> | ||
</> | ||
) | ||
} |
68 changes: 68 additions & 0 deletions
68
src/components/Modals/YourPointsModal/YourPointsModals.tsx
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,68 @@ | ||
import React from 'react' | ||
import useStyles from './style' | ||
import { Box, Button, Grid, Popover, Typography } from '@mui/material' | ||
import { colors, typography } from '@static/theme' | ||
|
||
export interface ISelectNetworkModal { | ||
open: boolean | ||
anchorEl: HTMLButtonElement | null | ||
handleClose: () => void | ||
} | ||
|
||
export const YourPointsModal: React.FC<ISelectNetworkModal> = ({ anchorEl, open, handleClose }) => { | ||
const { classes } = useStyles() | ||
|
||
return ( | ||
<Popover | ||
open={open} | ||
anchorEl={anchorEl} | ||
classes={{ paper: classes.paper }} | ||
onClose={handleClose} | ||
anchorOrigin={{ | ||
vertical: 'bottom', | ||
horizontal: 'center' | ||
}} | ||
transformOrigin={{ | ||
vertical: 'top', | ||
horizontal: 'center' | ||
}}> | ||
<Grid className={classes.root}> | ||
<Box className={classes.counterContainer}> | ||
<Box className={classes.counterItem}> | ||
<Typography style={{ color: colors.invariant.text, textAlign: 'center' }}> | ||
Points Program is{' '} | ||
<span | ||
style={{ | ||
color: colors.invariant.pink, | ||
textAlign: 'center', | ||
textShadow: `0 0 22px ${colors.invariant.pink}` | ||
}}> | ||
live on Eclipse! | ||
</span> | ||
</Typography> | ||
<Typography | ||
style={{ | ||
color: colors.invariant.textGrey, | ||
...typography.body2, | ||
marginTop: '8px', | ||
textAlign: 'center' | ||
}}> | ||
Visit Invariant Eclipse to check it. | ||
</Typography> | ||
<Button | ||
style={{ marginTop: '16px' }} | ||
className={classes.button} | ||
onClick={() => { | ||
handleClose() | ||
window.open('https://eclipse.invariant.app/points', '_blank') | ||
}}> | ||
Invariant Eclipse Points | ||
</Button> | ||
</Box> | ||
</Box> | ||
</Grid> | ||
</Popover> | ||
) | ||
} | ||
|
||
export default YourPointsModal |
Oops, something went wrong.