|
1 | 1 | import React from "react"; |
2 | | -import { createStyles, makeStyles } from "@material-ui/core/styles"; |
3 | | -import { |
4 | | - Card, |
5 | | - CardContent, |
6 | | - CardMedia, |
7 | | - IconButton, |
8 | | - Typography, |
9 | | -} from "@material-ui/core"; |
| 2 | +import { createStyles, makeStyles, Theme } from "@material-ui/core/styles"; |
| 3 | +import { IconButton, Typography } from "@material-ui/core"; |
10 | 4 | import { Email, GitHub, LinkedIn } from "@material-ui/icons"; |
11 | 5 |
|
12 | | -const useStyles = makeStyles(() => |
| 6 | +const useStyles = makeStyles((theme: Theme) => |
13 | 7 | createStyles({ |
14 | 8 | root: { |
15 | | - margin: "1vh", |
16 | | - height: "38vh", |
17 | | - width: "30vh", |
18 | | - background: "#ffd166", |
| 9 | + margin: "5vh 2vh", |
| 10 | + height: "25vh", |
| 11 | + width: "22vw", |
| 12 | + [theme.breakpoints.down("sm")]: { |
| 13 | + height: "30vh", |
| 14 | + width: "90vw", |
| 15 | + }, |
| 16 | + background: "transparent", |
| 17 | + border: "2px solid cyan", |
| 18 | + display: "flex", |
| 19 | + flexDirection: "column", |
| 20 | + justifyContent: "space-around", |
| 21 | + alignItems: "center", |
| 22 | + borderRadius: "24px", |
| 23 | + boxShadow: "0px 0px 14px 5px #11BFD7", |
19 | 24 | }, |
20 | 25 | title: { |
21 | 26 | fontSize: "1.2rem", |
22 | | - opacity: 0.8, |
| 27 | + [theme.breakpoints.down("sm")]: { |
| 28 | + fontSize: "1.5rem", |
| 29 | + }, |
| 30 | + color: "white", |
| 31 | + opacity: 1, |
| 32 | + textAlign: "center", |
| 33 | + fontFamily: "monospace", |
23 | 34 | fontWeight: "bold", |
| 35 | + transform: "translateY(-5vh)", |
24 | 36 | }, |
25 | | - title2: { |
26 | | - fontSize: "1rem", |
27 | | - opacity: 0.8, |
28 | | - fontWeight: "bold", |
| 37 | + subTitle: { |
| 38 | + [theme.breakpoints.down("sm")]: { |
| 39 | + fontSize: "1.2rem", |
| 40 | + }, |
| 41 | + fontFamily: "monospace", |
| 42 | + textAlign: "center", |
| 43 | + color: "#BFC7D1", |
| 44 | + transform: "translateY(-5vh)", |
29 | 45 | }, |
30 | 46 | media: { |
31 | | - height: "25vh", |
| 47 | + width: "15vh", |
| 48 | + height: "15vh", |
| 49 | + borderRadius: "100%", |
| 50 | + border: "2px solid white", |
| 51 | + transform: "translateY(-6vh)", |
| 52 | + }, |
| 53 | + iconsContainer: { |
| 54 | + transform: "translateY(-5vh)", |
| 55 | + display: "flex", |
| 56 | + justifyContent: "space-around", |
| 57 | + alignItems: "center", |
| 58 | + padding: "0 7vh", |
| 59 | + }, |
| 60 | + icons: { |
| 61 | + color: "white", |
32 | 62 | }, |
33 | 63 | }) |
34 | 64 | ); |
35 | | -interface DomainCardProps { |
| 65 | + |
| 66 | +interface DomainCardInterface { |
36 | 67 | name: string; |
37 | | - profileImg: string; |
| 68 | + team: string; |
| 69 | + githubProfileUrl: string; |
| 70 | + linkedInProfileUrl: string; |
38 | 71 | email: string; |
39 | | - linkedIn?: string; |
40 | | - github?: string; |
| 72 | + profileImg: string; |
41 | 73 | } |
42 | | -const DomainCard: React.FC<DomainCardProps> = ({ |
| 74 | + |
| 75 | +const DomainCard: React.FC<DomainCardInterface> = ({ |
43 | 76 | name, |
| 77 | + team, |
| 78 | + githubProfileUrl, |
44 | 79 | email, |
45 | 80 | profileImg, |
46 | | - linkedIn, |
47 | | - github, |
| 81 | + linkedInProfileUrl, |
48 | 82 | }) => { |
49 | 83 | const classes = useStyles(); |
50 | 84 | return ( |
51 | | - <Card className={classes.root}> |
52 | | - <CardMedia |
| 85 | + <div className={classes.root}> |
| 86 | + <img |
| 87 | + src={"/webix.iiitdmj.ac.in/images/profile/" + profileImg} |
| 88 | + alt={name} |
53 | 89 | className={classes.media} |
54 | | - image={`/webix.iiitdmj.ac.in/images/profile/${profileImg}`} |
55 | | - title={name} |
56 | 90 | /> |
57 | | - <CardContent> |
58 | | - {name.length > 16 ? ( |
59 | | - <Typography className={classes.title2}>{name}</Typography> |
60 | | - ) : ( |
61 | | - <Typography className={classes.title}>{name}</Typography> |
62 | | - )} |
63 | | - <a href={linkedIn} target="_blank"> |
| 91 | + <Typography className={classes.title}>{name}</Typography> |
| 92 | + <Typography className={classes.subTitle}>{team}</Typography> |
| 93 | + <div className={classes.iconsContainer}> |
| 94 | + <a href={githubProfileUrl} target="_blank"> |
| 95 | + <IconButton> |
| 96 | + <GitHub className={classes.icons} /> |
| 97 | + </IconButton> |
| 98 | + </a> |
| 99 | + <a href={email} target="_blank"> |
64 | 100 | <IconButton> |
65 | | - <LinkedIn /> |
| 101 | + <Email className={classes.icons} /> |
66 | 102 | </IconButton> |
67 | 103 | </a> |
68 | | - {github ? ( |
69 | | - <a href={github} target="_blank"> |
70 | | - <IconButton> |
71 | | - <GitHub /> |
72 | | - </IconButton> |
73 | | - </a> |
74 | | - ) : null} |
75 | | - <a href={`mailto:${email}`} target="_blank"> |
| 104 | + <a href={linkedInProfileUrl} target="_blank"> |
76 | 105 | <IconButton> |
77 | | - <Email /> |
| 106 | + <LinkedIn className={classes.icons} /> |
78 | 107 | </IconButton> |
79 | 108 | </a> |
80 | | - </CardContent> |
81 | | - </Card> |
| 109 | + </div> |
| 110 | + </div> |
82 | 111 | ); |
83 | 112 | }; |
84 | 113 |
|
|
0 commit comments