Skip to content

Commit fc75eb4

Browse files
authored
Merge branch 'main' into update-landing-909
2 parents 01b46cd + 85c49ad commit fc75eb4

File tree

2 files changed

+25
-17
lines changed

2 files changed

+25
-17
lines changed

src/components/ContributorThumbnail.js

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const useStyles = makeStyles((theme) => ({
4040
'& a:visited': {
4141
color: theme.palette.secondary.dark,
4242
},
43-
[theme.breakpoints.between('xs','sm')]: {
43+
[theme.breakpoints.between('xs', 'sm')]: {
4444
fontSize: '12px',
4545
},
4646
[theme.breakpoints.up('md')]: {
@@ -56,7 +56,7 @@ const useStyles = makeStyles((theme) => ({
5656
'& a:visited': {
5757
color: theme.palette.text.secondary,
5858
},
59-
[theme.breakpoints.between('xs','sm')]: {
59+
[theme.breakpoints.between('xs', 'sm')]: {
6060
fontSize: '12px',
6161
},
6262
[theme.breakpoints.up('md')]: {
@@ -81,7 +81,7 @@ const useStyles = makeStyles((theme) => ({
8181
},
8282
contributorItem: {
8383
display: 'grid',
84-
position:'absolute',
84+
position: 'absolute',
8585
marginTop: '2px',
8686
right: '0',
8787
[theme.breakpoints.down('sm')]: {
@@ -172,17 +172,27 @@ const Thumbnail = ({
172172
dropdownLength,
173173
isChildThumbnail,
174174
checkboxValue,
175-
inputValue,
176175
filtersActive,
177176
}) => {
178177
const classes = useStyles();
179178
let thumbnailImageStyle, thumbnailWrapperStyle;
180-
if (
181-
thumbnailInfo.imageUrl.includes('undefined') ||
182-
thumbnailInfo.imageUrl.includes('scontent')
183-
) {
184-
thumbnailInfo.imageUrl = '/images/default-github-repo-image.png';
179+
180+
const githubId = organization.github_id;
181+
182+
if (!githubId) {
183+
if (thumbnailInfo.imageUrl && organization.image_url) {
184+
thumbnailInfo.imageUrl = organization.image_url;
185+
}
186+
if (
187+
thumbnailInfo.imageUrl.includes('undefined') ||
188+
thumbnailInfo.imageUrl.includes('scontent')
189+
) {
190+
thumbnailInfo.imageUrl = '/images/default-github-repo-image.png';
191+
}
192+
} else {
193+
thumbnailInfo.imageUrl = `https://avatars1.githubusercontent.com/u/${githubId}?s=100&v=4`;
185194
}
195+
186196
if (organization.cti_contributor) {
187197
thumbnailWrapperStyle = classes.thumbnailWrapperContributor;
188198
} else {
@@ -197,7 +207,6 @@ const Thumbnail = ({
197207
}
198208

199209
const showtotalChildCount = () => {
200-
201210
let displayedCount = '';
202211

203212
if (dropdownLength) {

src/components/getOrgId.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
import { names } from "./data/orgs.js";
1+
import { names } from './data/orgs.js';
22

33
export const getOrgId = (githubUrl) => {
44
let orgname;
5-
if (githubUrl.split("https://github.com/")[1]) {
6-
orgname = githubUrl.split("https://github.com/")[1].split("/")[0];
7-
const org = orgname.replace(/\s/g, "").trim().toLowerCase();
5+
if (githubUrl.split('https://github.com/')[1]) {
6+
orgname = githubUrl.split('https://github.com/')[1].split('/')[0];
7+
const org = orgname.replace(/\s/g, '').trim().toLowerCase();
88
const id = names.get(org);
99
return id;
1010
} else {
11-
// TODO: Sean handle github url error
1211
// eslint-disable-next-line
1312
console.log(`error with github url: ${githubUrl}`);
14-
return 11635254;
13+
return '';
1514
}
16-
}
15+
};

0 commit comments

Comments
 (0)