Skip to content

Commit d13a10f

Browse files
authored
Merge pull request #1092 from civictechindex/1044-share-clickable-card
1044 share clickable card
2 parents 28624f8 + 26f502b commit d13a10f

File tree

2 files changed

+48
-37
lines changed

2 files changed

+48
-37
lines changed

src/pages/Share/index.js

Lines changed: 36 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,19 @@ const StarMediaSection = () => {
1919

2020
const CardSection = ({ image, title, cardContent, link = '' }) => {
2121
return (
22-
<Card className={classes.card}>
23-
<CardActionArea
24-
className={`${classes.link} ${classes.media}`}
25-
href={link}
26-
target='_blank'
27-
>
22+
<CardActionArea className={classes.link} href={link} target='_blank'>
23+
<Card className={classes.card}>
2824
<CardMedia className={classes.media} image={image} title={title} />
29-
</CardActionArea>
30-
<CardContent>
31-
<Typography variant='h6' className={classes.cardTypo}>
32-
{cardContent}
33-
</Typography>
34-
</CardContent>
35-
</Card>
25+
<CardContent>
26+
<Typography variant='h6' className={classes.cardTypo}>
27+
{cardContent}
28+
</Typography>
29+
</CardContent>
30+
</Card>
31+
</CardActionArea>
3632
);
3733
};
34+
3835
return (
3936
<Grid
4037
container
@@ -44,24 +41,30 @@ const StarMediaSection = () => {
4441
className={classes.starMediaSection}
4542
>
4643
<Grid item md={4}>
47-
<Card variant='outlined' className={classes.card}>
48-
<CardActions>
49-
<GitHubButton
50-
href='https://github.com/civictechindex/CTI-website-frontend'
51-
data-icon='octicon-star'
52-
data-size='large'
53-
data-show-count='true'
54-
aria-label='Star civictechindex/CTI-website-frontend on GitHub'
55-
>
56-
Star
57-
</GitHubButton>
58-
</CardActions>
59-
<CardContent>
60-
<Typography variant='h6' className={classes.cardTypo}>
61-
Don’t forget to star our repository
62-
</Typography>
63-
</CardContent>
64-
</Card>
44+
<CardActionArea
45+
className={classes.link}
46+
href='https://github.com/civictechindex/CTI-website-frontend'
47+
target='_blank'
48+
>
49+
<Card className={classes.card}>
50+
<CardActions className={classes.media}>
51+
<GitHubButton
52+
href='https://github.com/civictechindex/CTI-website-frontend'
53+
data-icon='octicon-star'
54+
data-size='large'
55+
data-show-count='true'
56+
aria-label='Star civictechindex/CTI-website-frontend on GitHub'
57+
>
58+
Star
59+
</GitHubButton>
60+
</CardActions>
61+
<CardContent>
62+
<Typography variant='h6' className={classes.cardTypo}>
63+
Don’t forget to star our repository
64+
</Typography>
65+
</CardContent>
66+
</Card>
67+
</CardActionArea>
6568
</Grid>
6669
<Grid item md={4}>
6770
<CardSection
@@ -74,6 +77,7 @@ const StarMediaSection = () => {
7477
</Grid>
7578
);
7679
};
80+
7781
const SocialMediaPostSection = () => {
7882
const classes = useStyles();
7983
return (
@@ -93,6 +97,7 @@ const SocialMediaPostSection = () => {
9397
</Grid>
9498
);
9599
};
100+
96101
const SocialMediaSection = () => {
97102
const classes = useStyles();
98103
return (

src/pages/Share/styles.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,27 @@ const useStyles = makeStyles((theme) => ({
4343
},
4444
card: {
4545
backgroundColor: '#FFFFFF',
46-
height: '186px',
46+
height: theme.spacing(23),
47+
width: '100%',
4748
border: '1px solid',
48-
borderRadius: '4px',
49+
padding: theme.spacing(3),
50+
borderRadius: theme.spacing(0.5),
4951
borderColor: theme.palette.background.darkGray,
5052
display: 'flex',
5153
flexDirection: 'column',
5254
alignItems: 'center',
53-
justifyContent: 'space-around',
55+
justifyContent: 'space-between',
5456
boxSizing: 'border-box',
5557
boxShadow: '0px 6px 30px rgba(4, 45, 95, 0.08)',
5658
},
5759
cardTypo: {
5860
textAlign: 'center',
59-
width: '218px',
61+
width: theme.spacing(27),
6062
},
6163
media: {
64+
display: 'flex',
65+
justifyContent: 'center',
66+
alignItems: 'center',
6267
height: '64px',
6368
width: '64px',
6469
},
@@ -71,7 +76,7 @@ const useStyles = makeStyles((theme) => ({
7176
overflow: 'hidden',
7277
backgroundColor: '#FFFFFF',
7378
display: 'flex',
74-
marginLeft: '0px',
79+
marginLeft: '0',
7580
marginTop: '-85px',
7681
alignItems: 'center',
7782
boxSizing: 'border-box',
@@ -95,7 +100,7 @@ const useStyles = makeStyles((theme) => ({
95100
borderRadius: '4px',
96101
borderColor: theme.palette.background.darkGray,
97102
boxShadow: '0px 6px 30px rgba(4, 45, 95, 0.08)',
98-
width: '600px',
103+
width: theme.spacing(80),
99104
},
100105
sectionHeadTypography: {
101106
textAlign: 'center',
@@ -108,6 +113,7 @@ const useStyles = makeStyles((theme) => ({
108113
},
109114
},
110115
link: {
116+
width: '100%',
111117
'& .MuiCardActionArea-focusHighlight': {
112118
backgroundColor: 'transparent',
113119
},

0 commit comments

Comments
 (0)