Skip to content

Commit 0548c65

Browse files
authored
Merge branch 'main' into update-landing-909
2 parents 9bcdbcc + 31b073d commit 0548c65

File tree

4 files changed

+130
-115
lines changed

4 files changed

+130
-115
lines changed

src/pages/Contributors/Affiliated.js

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const useStyles = makeStyles((theme) => ({
3434
'& h4': {
3535
paddingLeft: '10px',
3636
color: theme.palette.secondary.dark,
37-
[theme.breakpoints.between('xs','sm')]: {
37+
[theme.breakpoints.between('xs', 'sm')]: {
3838
fontSize: '15px',
3939
},
4040
[theme.breakpoints.up('md')]: {
@@ -78,7 +78,7 @@ const useStyles = makeStyles((theme) => ({
7878
},
7979
},
8080
codeforallText: {
81-
fontSize:'24px',
81+
fontSize: '24px',
8282
[theme.breakpoints.up('sm')]: {
8383
fontSize: '12px',
8484
},
@@ -114,13 +114,13 @@ const useStyles = makeStyles((theme) => ({
114114
/* eslint complexity: [0, 0]*/
115115
export const Affiliated = (props) => {
116116
const {
117+
affiliatedCount,
117118
classes,
118119
inputValue,
119120
organizations,
120121
organizationData,
121122
filtersActive,
122-
affiliatedCount,
123-
totalaffiliatedCount,
123+
totalAffiliatedCount,
124124
showIndexContrib,
125125
} = props;
126126
const classesLocal = useStyles();
@@ -132,8 +132,8 @@ export const Affiliated = (props) => {
132132
Affiliated Organizations
133133
<span style={{ paddingLeft: '9px' }}>
134134
{filtersActive
135-
? `(${affiliatedCount}/${totalaffiliatedCount})`
136-
: `(${totalaffiliatedCount})`}
135+
? `(${affiliatedCount}/${totalAffiliatedCount})`
136+
: `(${totalAffiliatedCount})`}
137137
</span>
138138
</Typography>
139139
</Grid>
@@ -146,10 +146,18 @@ export const Affiliated = (props) => {
146146
})}
147147
>
148148
<Grid>
149-
<img src='/images/code_for_All.png' alt='code for all logo' className={classesLocal.codeforAllIcon}/>
149+
<img
150+
src='/images/code_for_All.png'
151+
alt='code for all logo'
152+
className={classesLocal.codeforAllIcon}
153+
/>
150154
</Grid>
151155
<Grid>
152-
<Typography variant='h4' noWrap className={classesLocal.codeforallText}>
156+
<Typography
157+
variant='h4'
158+
noWrap
159+
className={classesLocal.codeforallText}
160+
>
153161
<Link
154162
href='/organization/code-for-all'
155163
target='_blank'
@@ -159,8 +167,8 @@ export const Affiliated = (props) => {
159167
</Link>
160168
<span style={{ paddingLeft: '5px' }}>
161169
{filtersActive
162-
? `(${affiliatedCount}/${totalaffiliatedCount})`
163-
: ` (${totalaffiliatedCount})`}
170+
? `(${affiliatedCount}/${totalAffiliatedCount})`
171+
: ` (${totalAffiliatedCount})`}
164172
</span>
165173
</Typography>
166174
</Grid>
@@ -185,12 +193,15 @@ export const Affiliated = (props) => {
185193
data-cy='code-for-all-chevron'
186194
onClick={() => setDropdownOpen(!dropdownOpen)}
187195
>
188-
<DropdownArrow open={dropdownOpen} handleArrow={() => setDropdownOpen(!dropdownOpen)} />
196+
<DropdownArrow
197+
open={dropdownOpen}
198+
handleArrow={() => setDropdownOpen(!dropdownOpen)}
199+
/>
189200
</Grid>
190201
</Grid>
191202
<Grid>
192-
{dropdownOpen && (
193-
!organizations['Code for All'] ? (
203+
{dropdownOpen &&
204+
(!organizations ? (
194205
!inputValue ? (
195206
<h3 className={classes.loaders}>Loading...</h3>
196207
) : (
@@ -206,8 +217,7 @@ export const Affiliated = (props) => {
206217
filtersActive={filtersActive}
207218
/>
208219
</Grid>
209-
)
210-
)}
220+
))}
211221
</Grid>
212222
</Grid>
213223
);

src/pages/Contributors/AffiliatedOrganizations.js

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const useStyles = makeStyles((theme) => ({
2121
flexWrap: 'wrap',
2222
marginTop: '10px',
2323
justifyContent: 'center',
24-
[theme.breakpoints.between('xs','sm')]: {
24+
[theme.breakpoints.between('xs', 'sm')]: {
2525
marginLeft: '0',
2626
justifyContent: 'center',
2727
alignItems: 'center',
@@ -73,17 +73,14 @@ export const AffiliatedOrganizations = ({
7373
const classes = useStyles();
7474

7575
const isChildThumbnail = true;
76-
let organizationArray;
7776
let parentdata;
7877
let parentChildobj;
7978
let mapsearchedChildParent;
8079

8180
const getParentData = () => {
82-
organizationArray = organizations['Code for All'].filter((item) => item);
83-
8481
parentdata = [];
8582

86-
organizationArray.forEach((org) => {
83+
organizations.forEach((org) => {
8784
if (org.depth === 3) {
8885
org['childNodes'] = [];
8986
org['isOpen'] = false;
@@ -131,7 +128,13 @@ export const AffiliatedOrganizations = ({
131128
useEffect(() => {
132129
setCurrentThumbnails(getParentData);
133130
// eslint-disable-next-line react-hooks/exhaustive-deps
134-
}, [inputValue, organizations, organizationData, showIndexContrib,filtersActive]);
131+
}, [
132+
inputValue,
133+
organizations,
134+
organizationData,
135+
showIndexContrib,
136+
filtersActive,
137+
]);
135138

136139
let childSort;
137140
let childNode;
@@ -155,7 +158,11 @@ export const AffiliatedOrganizations = ({
155158
inputValue={inputValue}
156159
filtersActive={filtersActive}
157160
>
158-
<Grid container style={ { justifyContent:"center" } } alignItems='center'>
161+
<Grid
162+
container
163+
style={{ justifyContent: 'center' }}
164+
alignItems='center'
165+
>
159166
{childNode.length > 0 ? (
160167
<Grid
161168
item
@@ -166,7 +173,10 @@ export const AffiliatedOrganizations = ({
166173
{childNode.map((child, idx) => {
167174
return (
168175
<Grid
169-
item xs={12} sm={5} lg={5}
176+
item
177+
xs={12}
178+
sm={5}
179+
lg={5}
170180
className={classes.afflnThumbnails}
171181
key={`affiliatedThumbnail_child_${i}_${idx}`}
172182
>
@@ -224,7 +234,10 @@ export const AffiliatedOrganizations = ({
224234
inputValue !== ''
225235
) {
226236
return (
227-
<Grid className={classes.thumbnailGrid} data-cy='affiliated-organizations'>
237+
<Grid
238+
className={classes.thumbnailGrid}
239+
data-cy='affiliated-organizations'
240+
>
228241
{currentThumbnails.map((org, i) => {
229242
return (
230243
<Dropdown

src/pages/Contributors/UnaffiliatedOrganizations.js

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export const UnaffiliatedOrganizations = (props) => {
5555
filtersActive,
5656
organization,
5757
showIndexContrib,
58-
totalunaffiliatedCount,
58+
totalUnaffiliatedCount,
5959
unaffiliatedCount,
6060
} = props;
6161
const classes = useStyles();
@@ -69,13 +69,22 @@ export const UnaffiliatedOrganizations = (props) => {
6969
<span style={{ paddingLeft: '1px' }}>
7070
{' '}
7171
{filtersActive
72-
? `(${unaffiliatedCount}/${totalunaffiliatedCount})`
73-
: `(${totalunaffiliatedCount})`}{' '}
72+
? `(${unaffiliatedCount}/${totalUnaffiliatedCount})`
73+
: `(${totalUnaffiliatedCount})`}{' '}
7474
</span>
7575
</Typography>
7676
</Grid>
7777
{showIndexContrib ? (
78-
<Grid item xs={12} sm={12} md={12} container direction="row" justify="center" alignItems="center">
78+
<Grid
79+
item
80+
xs={12}
81+
sm={12}
82+
md={12}
83+
container
84+
direction='row'
85+
justify='center'
86+
alignItems='center'
87+
>
7988
<Typography color='primary' className={classes.noargText}>
8089
{' '}
8190
No organization found{' '}
@@ -98,8 +107,7 @@ export const UnaffiliatedOrganizations = (props) => {
98107
isChildThumbnail={isChildThumbnail}
99108
></ContributorThumbnail>
100109
</Grid>
101-
))
102-
}
110+
))}
103111
</Grid>
104112
</Grid>
105113
)}

0 commit comments

Comments
 (0)