@@ -37,21 +37,24 @@ const useStyles = makeStyles((theme) => ({
37
37
"&:hover" : {
38
38
opacity : "1" ,
39
39
transform : "translate(0,-5px)" ,
40
- background : "rgba(255,255,255,0.5)"
41
40
}
42
41
}
43
42
} ) ) ;
44
43
45
44
function PCard ( props ) {
46
45
const classes = useStyles ( ) ;
47
-
46
+ const [ isVisible , setisVisible ] = React . useState ( props . display ?true :false ) ;
47
+ const toggle = ( ) => setisVisible ( ! isVisible ) ;
48
48
return (
49
49
< React . Fragment >
50
- < Card className = { classes . root } variant = "outlined" >
50
+ { isVisible && (
51
+ < Card className = { classes . root } variant = "outlined" >
51
52
< Box sx = { { display : "flex" , justifyContent : "right" } } >
52
- < IconButton aria-label = "close" >
53
+ < CardActions >
54
+ < IconButton aria-label = "close" onClick = { toggle } >
53
55
< CloseOutlinedIcon />
54
56
</ IconButton >
57
+ </ CardActions >
55
58
</ Box >
56
59
< Box
57
60
sx = { {
@@ -129,70 +132,78 @@ function PCard(props) {
129
132
>
130
133
< CardActions >
131
134
{ props . email && (
132
- < Link href = { `mailto:${ props . email } ` } >
133
- < IconButton className = { classes . socialMediaButton } >
135
+ < IconButton
136
+ className = { classes . socialMediaButton }
137
+ component = { Link }
138
+ href = { `mailto:${ props . email } ` }
139
+ >
134
140
< MailIcon color = "primary" />
135
141
</ IconButton >
136
- </ Link >
137
142
) }
138
143
139
144
{ props . linkedIn && (
140
- < Link href = { props . linkedIn } target = "_blank" >
141
- < IconButton
142
- aria-label = "linkedin"
143
- className = { classes . socialMediaButton }
144
- >
145
- < LinkedInIcon color = "primary" />
146
- </ IconButton >
147
- </ Link >
148
- ) }
145
+ < IconButton
146
+ aria-label = "linkedin"
147
+ className = { classes . socialMediaButton }
148
+ component = { Link }
149
+ target = "_blank"
150
+ href = { props . linkedIn }
151
+ >
152
+ < LinkedInIcon color = "primary" />
153
+ </ IconButton >
154
+ ) }
149
155
150
156
{ props . socialMedia && props . socialMedia . insta && (
151
- < Link href = { props . socialMedia . insta } target = "_blank" >
152
157
< IconButton
153
158
aria-label = "instagram"
154
159
className = { classes . socialMediaButton }
160
+ component = { Link }
161
+ target = "_blank"
162
+ href = { props . linkedIn }
155
163
>
156
164
< InstagramIcon color = "primary" />
157
165
</ IconButton >
158
- </ Link >
159
166
) }
160
167
161
168
{ props . socialMedia && props . socialMedia . github && (
162
- < Link href = { props . socialMedia . github } target = "_blank" >
163
169
< IconButton
164
170
aria-label = "github"
165
171
className = { classes . socialMediaButton }
172
+ component = { Link }
173
+ target = "_blank"
174
+ href = { props . linkedIn }
166
175
>
167
176
< GitHubIcon color = "primary" />
168
177
</ IconButton >
169
- </ Link >
170
178
) }
171
179
172
180
{ props . socialMedia && props . socialMedia . facebook && (
173
- < Link href = { props . socialMedia . facebook } target = "_blank" >
174
181
< IconButton
175
182
aria-label = "facebook"
176
183
className = { classes . socialMediaButton }
184
+ component = { Link }
185
+ target = "_blank"
186
+ href = { props . linkedIn }
177
187
>
178
188
< FacebookIcon color = "primary" />
179
189
</ IconButton >
180
- </ Link >
181
190
) }
182
191
183
192
{ props . socialMedia && props . socialMedia . twitter && (
184
- < Link href = { props . socialMedia . twitter } target = "_blank" >
185
193
< IconButton
186
194
aria-label = "twitter"
187
195
className = { classes . socialMediaButton }
196
+ component = { Link }
197
+ target = "_blank"
198
+ href = { props . socialMedia . twitter }
188
199
>
189
200
< TwitterIcon color = "primary" />
190
201
</ IconButton >
191
- </ Link >
192
202
) }
193
203
</ CardActions >
194
204
</ Box >
195
205
</ Card >
206
+ ) }
196
207
</ React . Fragment >
197
208
) ;
198
209
}
0 commit comments