Skip to content

Commit

Permalink
Merge pull request #837 from invariant-labs/dev
Browse files Browse the repository at this point in the history
Update staging env
  • Loading branch information
wojciech-cichocki authored Dec 31, 2024
2 parents fa9718e + 17ad85a commit 3853458
Show file tree
Hide file tree
Showing 26 changed files with 3,770 additions and 6,237 deletions.
9,344 changes: 3,139 additions & 6,205 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { PublicKey } from '@solana/web3.js'
import FaucetButton from './HeaderButton/FaucetButton'
import SelectPriorityButton from './HeaderButton/SelectPriorityButton'
import Priority from '@components/Modals/Priority/Priority'
import { YourPointsButton } from './HeaderButton/YourPointsButton'
export interface IHeader {
address: PublicKey
onNetworkSelect: (networkType: NetworkType, rpcAddress: string, rpcName?: string) => void
Expand Down Expand Up @@ -257,6 +258,11 @@ export const Header: React.FC<IHeader> = ({
onSelect={onNetworkSelect}
/>
</Grid>

<Grid>
<YourPointsButton />
</Grid>

<ChangeWalletButton
name={
walletConnected
Expand Down
41 changes: 41 additions & 0 deletions src/components/Header/HeaderButton/YourPointsButton.tsx
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} />
</>
)
}
33 changes: 33 additions & 0 deletions src/components/Header/HeaderButton/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,39 @@ const useStyles = makeStyles()((theme: Theme) => {
warningIcon: {
height: 16,
marginRight: 4
},
pointsHeaderButton: {
textTransform: 'none',
boxSizing: 'border-box',
minWidth: '10px',
height: '40px',
background: colors.invariant.newDark,
boxShadow: '0px 0px 5px 5px #2A365C',
borderRadius: '14px',
fontFamily: 'Mukta',
fontWeight: 700,
fontSize: '16px',
lineHeight: '20px',
letterSpacing: '-0.03em',
textWrap: 'nowrap',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
marginLeft: '12px',
marginRight: '12px',
border: '2px solid transparent',
backgroundImage: 'linear-gradient(#2A365C, #2A365C), linear-gradient(0deg, #2EE09A, #EF84F5)',
backgroundOrigin: 'border-box',
backgroundClip: 'padding-box, border-box',

color: colors.invariant.text,

[theme.breakpoints.down('sm')]: {
padding: '0px 2px'
},
[theme.breakpoints.between('sm', 'lg')]: {
padding: '0px 20px'
}
}
}
})
Expand Down
6 changes: 3 additions & 3 deletions src/components/Header/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const useStyles = makeStyles()((theme: Theme) => {
return {
root: {
margin: 'auto',
maxWidth: 1920,
maxWidth: 1960,
paddingInline: 150,
height: 70,
display: 'flex',
Expand Down Expand Up @@ -64,7 +64,7 @@ const useStyles = makeStyles()((theme: Theme) => {
gap: 8,
flexWrap: 'nowrap',
alignItems: 'center',
[theme.breakpoints.up(1600)]: {
[theme.breakpoints.up(1800)]: {
flex: '1 1 0%'
},

Expand Down Expand Up @@ -132,7 +132,7 @@ const useStyles = makeStyles()((theme: Theme) => {
leftSide: {
width: 'auto',

[theme.breakpoints.up(1600)]: {
[theme.breakpoints.up(1800)]: {
flex: '1 1 0%'
}
}
Expand Down
101 changes: 101 additions & 0 deletions src/components/Modals/YourPointsModal/Timer.tsx
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 src/components/Modals/YourPointsModal/YourPointsModals.tsx
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
Loading

0 comments on commit 3853458

Please sign in to comment.