-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAchievedItem.tsx
54 lines (44 loc) · 1.92 KB
/
AchievedItem.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import React from 'react';
import {Grid, Icon} from "@mui/material";
import Paper from "@mui/material/Paper";
import HelpOutlineIcon from "@mui/icons-material/HelpOutline";
import Typography from "@mui/material/Typography";
import {styled} from "@mui/material/styles";
import {IAchievedItem} from "../../types/types";
import Tooltip, { TooltipProps, tooltipClasses } from '@mui/material/Tooltip';
const BootstrapTooltip = styled(({className, ...props}: TooltipProps) => (
<Tooltip {...props} arrow classes={{popper: className}}/>
))(({theme}) => ({
[`& .${tooltipClasses.arrow}`]: {
color: theme.palette.common.black,
},
[`& .${tooltipClasses.tooltip}`]: {
backgroundColor: theme.palette.common.black,
},
}));
const AchievedItem = ({description, active, name, icon}: IAchievedItem) => {
const Icon = icon;
return (
<Grid item xs={6} sm={4} md={3} xl={3}>
<Paper variant={"outlined"}>
{/*<ListItemIcon>*/}
<BootstrapTooltip sx={{display: {xs: "none", md: "block"}}} className={"tooltip_my"}
placement={"top-start"}
title={description}>
<HelpOutlineIcon sx={{display: {xs: "none", md: "block"}}} className={"tooltip_icon"}
color={"disabled"}
fontSize={"small"}/>
</BootstrapTooltip>
<div className={"achievement_icon_container"}>
<Icon fontSize={"large"} color={active ? "primary" : "disabled"} />
</div>
<Typography className={"name"} variant={"body2"}>
{name}
</Typography>
<Typography
variant={"subtitle2"}> {!active ? "Incomplete" : "Complete"}</Typography>
</Paper>
</Grid>
);
};
export default AchievedItem;