Skip to content

Commit 65e3d9b

Browse files
authored
Merge pull request #1087 from civictechindex/genSubheadTypo-global-style
Created global style for all subheading used on GlobalHeaderComponent
2 parents ae6185a + f7e8a65 commit 65e3d9b

File tree

10 files changed

+111
-148
lines changed

10 files changed

+111
-148
lines changed

src/components/Dropdown.js

Lines changed: 40 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,18 @@ import { DropdownArrow } from './DropdownArrow';
55
import Grid from '@material-ui/core/Grid';
66
import clsx from 'clsx';
77

8-
const useStyles = makeStyles(theme => ({
9-
8+
const useStyles = makeStyles((theme) => ({
109
dropdown: {
1110
margin: '24px auto',
1211
display: 'flex',
1312
alignItems: 'center',
1413
backgroundColor: theme.palette.background.default,
1514
boxSizing: 'border-box',
1615
border: '1px solid',
17-
borderColor:theme.palette.outline.gray,
16+
borderColor: theme.palette.outline.gray,
1817
borderRadius: '6px',
19-
height:'80px',
20-
padding:'12px 16px',
18+
height: '80px',
19+
padding: '12px 16px',
2120
[theme.breakpoints.down('sm')]: {
2221
height: '49px',
2322
},
@@ -30,7 +29,7 @@ const useStyles = makeStyles(theme => ({
3029
height: '49px',
3130
},
3231
},
33-
flexGrid:{
32+
flexGrid: {
3433
flexGrow: 1,
3534
justifyContent: 'flex-end',
3635
},
@@ -54,38 +53,56 @@ export const Dropdown = ({
5453
setColor(!colorStyle);
5554
};
5655

57-
58-
useEffect(()=>{
56+
useEffect(() => {
5957
setOpenChild(isOpen);
6058
setColor(isOpen);
61-
},[isOpen])
62-
59+
}, [isOpen]);
6360

6461
return (
65-
6662
<Grid data-cy='thumbnail-dropdown'>
6763
{dropdownLength > 0 ? (
68-
<Grid item xs={10} className={clsx(classes.dropdown, { [classes.open]: colorStyle === true })} >
64+
<Grid
65+
item
66+
xs={10}
67+
className={clsx(classes.dropdown, {
68+
[classes.open]: colorStyle === true,
69+
})}
70+
>
6971
<Grid>
70-
<ContributorThumbnail organization={organization} filtersActive={filtersActive} checkboxValue={checkboxValue} dropdownLength={dropdownLength} isOpen={colorStyle} isChildThumbnail={false}/>
72+
<ContributorThumbnail
73+
organization={organization}
74+
filtersActive={filtersActive}
75+
checkboxValue={checkboxValue}
76+
dropdownLength={dropdownLength}
77+
isOpen={colorStyle}
78+
isChildThumbnail={false}
79+
/>
7180
</Grid>
7281
<Grid className={classes.flexGrid}></Grid>
73-
<Grid item container className={classes.flexGrid} onClick={handleOpen}>
74-
<DropdownArrow open={openChild} setOpenFunction={setOpenChild} handleArrow={handleOpen} />
82+
<Grid
83+
item
84+
container
85+
className={classes.flexGrid}
86+
onClick={handleOpen}
87+
>
88+
<DropdownArrow
89+
open={openChild}
90+
setOpenFunction={setOpenChild}
91+
handleArrow={handleOpen}
92+
/>
7593
</Grid>
7694
</Grid>
77-
)
78-
79-
:
95+
) : (
8096
<Grid item xs={10} className={classes.dropdown}>
81-
<ContributorThumbnail organization={organization} checkboxValue={checkboxValue} isChildThumbnail={false}/>
97+
<ContributorThumbnail
98+
organization={organization}
99+
checkboxValue={checkboxValue}
100+
isChildThumbnail={false}
101+
/>
82102
</Grid>
83-
84-
}
103+
)}
85104
{openChild && children}
86-
87105
</Grid>
88-
89106
);
90107
};
91108
export default Dropdown;

src/components/common/Text.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ const Text = (props) => {
8787
classes={
8888
variant === 'body2'
8989
? {
90-
colorPrimary: classes.colorPrimary,
91-
colorSecondary: classes.colorSecondary,
92-
colorTextPrimary: classes.colorTextPrimary,
93-
colorTextSecondary: classes.colorTextSecondary,
94-
}
90+
colorPrimary: classes.colorPrimary,
91+
colorSecondary: classes.colorSecondary,
92+
colorTextPrimary: classes.colorTextPrimary,
93+
colorTextSecondary: classes.colorTextSecondary,
94+
}
9595
: {}
9696
}
9797
className={isCustom ? clsx(classes[variant], className) : className}

src/pages/About/index.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const About = () => {
4747
mainTitle='A movement to index every open source civic tech project on GitHub'
4848
breadCrumbLinks={breadCrumbLinks}
4949
>
50-
<Grid container justify='center'>
50+
<Grid container className={classes.movieGrid}>
5151
<iframe
5252
className={classes.frameStyle}
5353
justify='center'
@@ -60,11 +60,7 @@ const About = () => {
6060
webkitallowfullscreen='true'
6161
></iframe>
6262
</Grid>
63-
<Typography
64-
variant='h6'
65-
color='textSecondary'
66-
className={classes.subHeaderStyle}
67-
>
63+
<Typography className='genSubheadTypo'>
6864
With your help, we can create a continuously updated repository
6965
for all civic tech enthusiasts to find open source projects to
7066
model, connect with, and learn from.

src/pages/About/styles.js

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
11
import makeStyles from '@material-ui/core/styles/makeStyles';
22

33
const useStyles = makeStyles((theme) => ({
4-
subHeaderStyle: {
5-
fontWeight: '400',
6-
textAlign: 'center',
7-
[theme.breakpoints.down('sm')]: {
8-
padding: '48px 30px',
9-
},
10-
[theme.breakpoints.up('sm')]: {
11-
padding: '48px 100px',
12-
},
13-
[theme.breakpoints.up('md')]: {
14-
padding: '48px 200px',
15-
},
4+
movieGrid: {
5+
justifyContent: 'center',
6+
marginBottom: theme.spacing(2),
167
},
178
frameStyle: {
189
border: 'none',

src/pages/Collaborate/index.js

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,44 +6,34 @@ import Container from '@material-ui/core/Container';
66
import Link from '../../components/common/Link';
77
import BottomCallToAction from '../../components/BottomCallToAction';
88
import { GenericHeaderSection } from '../../components/';
9-
import makeStyles from '@material-ui/core/styles/makeStyles';
109
import LeftTextRightImage from './LeftTextRightImage';
1110
import RightTextLeftImage from './RightTextLeftImage';
12-
13-
const useStyles = makeStyles((theme) => ({
14-
titleStyle: {
15-
textAlign: 'center',
16-
[theme.breakpoints.down('sm')]: {
17-
fontSize: '13px',
18-
},
19-
[theme.breakpoints.up('md')]: {
20-
fontSize: '16px',
21-
},
22-
[theme.breakpoints.up('lg')]: {
23-
fontSize: '28px',
24-
},
25-
},
26-
}));
11+
import { Typography } from '@material-ui/core';
2712

2813
const Collaborate = () => {
2914
const breadCrumbLinks = [
3015
{ name: 'Home', href: '/home' },
3116
{ name: 'Collaborate with Us', href: '/support/collaborate' },
3217
];
33-
const classes = useStyles();
18+
3419
return (
3520
<Box className='pageContainer'>
3621
<Box className='boxBackground'>
3722
<Container className='containerDefault'>
3823
<GenericHeaderSection
3924
mainTitle='Your help goes a long way'
4025
breadCrumbLinks={breadCrumbLinks}
41-
/>
26+
>
27+
<Typography className='genSubheadTypo'>
28+
We would love to hear your thoughts or feedback on how we can
29+
improve your experience with the Civic Tech Index!
30+
</Typography>
31+
</GenericHeaderSection>
4232
</Container>
4333
</Box>
4434
<Box className='containerGray'>
4535
<Container>
46-
<Grid container item className={classes.LinkText} xs={12} spacing={4}>
36+
<Grid container item xs={12} spacing={4}>
4737
<LeftTextRightImage
4838
mainHeading='Donate'
4939
subHeading='Every gift helps us continue our work.'

src/pages/Contact/index.js

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,12 @@
11
import React from 'react';
22
import Box from '@material-ui/core/Box';
33
import Container from '@material-ui/core/Container';
4-
import makeStyles from '@material-ui/core/styles/makeStyles';
54
import Typography from '@material-ui/core/Typography';
65
import Card from '@material-ui/core/Card';
76
import CardMedia from '@material-ui/core/CardMedia';
87
import { GenericHeaderSection } from '../../components/';
98

10-
const useStyles = makeStyles((theme) => ({
11-
headerStyle: {
12-
color: theme.palette.text.secondary,
13-
maxWidth: '1150px',
14-
textAlign: 'center',
15-
fontWeight: '400',
16-
[theme.breakpoints.down('sm')]: {
17-
padding: '0px 32px',
18-
},
19-
[theme.breakpoints.up('md')]: {
20-
padding: '0px 100px',
21-
},
22-
'& h6': {
23-
[theme.breakpoints.down('sm')]: {
24-
margin: '0px 0px 71px 0px',
25-
},
26-
[theme.breakpoints.up('md')]: {
27-
margin: '0px 0px 86px 0px',
28-
},
29-
},
30-
},
31-
}));
32-
339
const Contact = () => {
34-
const classes = useStyles();
3510
const breadCrumbLinks = [
3611
{ name: 'Home', href: '/home' },
3712
{ name: 'Contact', href: '/about/contact' },
@@ -45,7 +20,7 @@ const Contact = () => {
4520
mainTitle='Contact Us'
4621
breadCrumbLinks={breadCrumbLinks}
4722
>
48-
<Typography variant='h6' className={classes.headerStyle}>
23+
<Typography className='genSubheadTypo'>
4924
We would love to hear your thoughts or feedback on how we can
5025
improve your experience with the Civic Tech Index!
5126
</Typography>

src/pages/Contributors/index.js

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,13 @@ export default function Contributors() {
103103
if (location.pathname.indexOf('all') > -1) {
104104
setTabValue(0);
105105
}
106-
if (location.pathname.indexOf('contributors') > -1)
107-
{
106+
if (location.pathname.indexOf('contributors') > -1) {
108107
setShowIndexContrib(true);
109108
setTabValue(0);
110109
}
111110
if (location.pathname.indexOf('unaffiliated') > -1) {
112111
setTabValue(1);
113-
}
114-
else if (location.pathname.indexOf('affiliated') > -1) {
112+
} else if (location.pathname.indexOf('affiliated') > -1) {
115113
setTabValue(2);
116114
}
117115
}, [location]);
@@ -169,12 +167,7 @@ export default function Contributors() {
169167
<Grid container>
170168
<TitleSection>Civic Tech Organizations</TitleSection>
171169
<Grid item xs={12}>
172-
<Typography
173-
variant='h6'
174-
color='textSecondary'
175-
className={classes.textStyle}
176-
gutterBottom
177-
>
170+
<Typography className='genSubheadTypo'>
178171
View all Civic Tech Organizations with open-source repositories.
179172
</Typography>
180173
</Grid>

src/pages/HowToAdd/index.js

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,6 @@ const useStyles = makeStyles((theme) => ({
1717
padding: '32px 0',
1818
},
1919
},
20-
summary: {
21-
color: theme.palette.text.secondary,
22-
fontSize: '24px',
23-
margin: '1em auto',
24-
textAlign: 'justify',
25-
width: '66%',
26-
'& a:link': {
27-
color: theme.palette.text.secondary,
28-
fontWeight:'400',
29-
},
30-
'& a:visited': {
31-
color: theme.palette.text.secondary,
32-
},
33-
[theme.breakpoints.down('md')]: {
34-
fontSize: '20px',
35-
margin: '0px auto 1em',
36-
width: '66%',
37-
},
38-
[theme.breakpoints.down('sm')]: {
39-
width: '90%',
40-
},
41-
},
4220
typoStyle: {
4321
textAlign: 'justify',
4422
'& a:visited': {
@@ -72,7 +50,7 @@ const HowToAdd = () => {
7250
mainTitle='How to Add Your Project'
7351
breadCrumbLinks={breadCrumbLinks}
7452
/>
75-
<Typography variant='body1' className={classes.summary}>
53+
<Typography className='genSubheadTypo'>
7654
By adding the <b>&apos;civictechindex&apos; </b>
7755
topic tag to your project, we can create a continuously updated
7856
repository for all civic tech enthusiasts to find open source

0 commit comments

Comments
 (0)