react-garden
Version:
React + TypeScript + ThreeJS app using Material UI on NextJS, Apollo Client, GraphQL + WordPress REST APIs, for ThreeD web development.. a part of the threed.ai code family.
51 lines (45 loc) • 1.51 kB
JavaScript
// ** MUI Imports
import Card from '@mui/material/Card'
import Button from '@mui/material/Button'
import Typography from '@mui/material/Typography'
import CardContent from '@mui/material/CardContent'
import { styled, useTheme } from '@mui/material/styles'
// Styled component for the triangle shaped background image
const TriangleImg = styled('img')(({ theme }) => ({
right: 0,
bottom: 0,
height: 170,
position: 'absolute',
...(theme.direction === 'rtl' ? { transform: 'scaleX(-1)' } : {})
}))
// Styled component for the trophy image
const TrophyImg = styled('img')({
right: 36,
bottom: 20,
height: 98,
position: 'absolute'
})
const AnalyticsTrophy = () => {
// ** Hook
const theme = useTheme()
const imageSrc = theme.palette.mode === 'light' ? 'triangle-light.png' : 'triangle-dark.png'
return (
<Card sx={{ position: 'relative' }}>
<CardContent>
<Typography variant='h6'>Congratulations John! 🥳</Typography>
<Typography variant='body2' sx={{ letterSpacing: '0.25px' }}>
Best seller of the month
</Typography>
<Typography variant='h5' sx={{ my: 4, color: 'primary.main' }}>
$42.8k
</Typography>
<Button size='small' variant='contained'>
View Sales
</Button>
<TriangleImg alt='triangle background' src={`/images/misc/${imageSrc}`} />
<TrophyImg alt='trophy' src='/images/misc/trophy.png' />
</CardContent>
</Card>
)
}
export default AnalyticsTrophy