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