Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return availableLanguages.map((language, counter) => {
const isSelectedIndex = counter === this.state.selectedIndex;
// This will be used in making sure of the element visibility
const refProp = isSelectedIndex ? { ref: 'activeItem' } : {};
const languageColor = GithubColors.get(language.title) || {
color: language.title === 'All Languages' ? 'transparent' : '#e8e8e8'
};
return (
<a> this.selectLanguage(counter) }
key={ counter }>
<span style="{{"></span>
<span>{ language.title }</span>
</a>
);
});
}
spinner = ora(`Fetching ${ghUrl}...`).start();
if (!db.repos[repo].fetching ||
db.repos[repo].fetched_at &&
new Date(db.repos[repo].fetched_at) > new Date(db.repos[repo].pushed_at)) {
spinner.succeed(`${repo} hasn't changed`);
return;
}
const ghDataJson = await fetchJson(authify(ghUrl));
spinner.succeed(`Fetched ${ghUrl}`);
for (let language in ghDataJson) {
ghDataJson[language] = {
bytes: ghDataJson[language],
color: githubColors.get(language, true).color
};
}
db.repos[repo].languages = ghDataJson;
db.write();
}
const ghUrl = `https://api.github.com/repos/${repo}/languages`;
spinner = ora(`Fetching ${ghUrl}...`).start();
if (!repos[repo].fetching_since || repos[repo].fetched_at &&
new Date(repos[repo].fetched_at) > new Date(repos[repo].pushed_at)) {
spinner.succeed(`${repo} hasn't changed`);
return;
}
const ghDataJson = await github.fetchGHJson(ghUrl, spinner);
spinner.succeed(`Fetched ${ghUrl}`);
for (let language in ghDataJson) {
ghDataJson[language] = {
bytes: ghDataJson[language],
color: githubColors.get(language, true).color
};
}
repos[repo].languages = ghDataJson;
repos[repo].write();
}
render() {
const languageColor = GithubColors.get(this.props.repository.language);
return (
<div>
<div>
<div>
<a rel="noopener noreferrer" href="{">
<div>
<img src="{"> {
e.target.src = '/img/logo.svg';
} }
alt={ this.props.repository.owner.login }/>
</div>
<div>
<h5>{ this.props.repository.owner.login }</h5>
<p>View Profile</p></div></a></div></div></div>
render() {
const languageColor = GithubColors.get(this.props.repository.language);
return (
<div>
<div>
<div>
<h3>
<a rel="noopener noreferrer" href="{">
<span>{ this.props.repository.owner.login } / </span>
{ this.props.repository.name }
</a>
</h3>
<p>Built by · <a rel="noopener noreferrer" href="{">{ this.props.repository.owner.login }</a> · { moment(this.props.repository.created_at).format('MMMM D YYYY') }</p>
</div>
<div>
<p>{ this.props.repository.description || 'No description given.' }</p>
</div></div></div>
arrData = Object.keys(languages).map(function (cLang) {
return {
label: cLang
, value: languages[cLang]
, color: GitHubColors.get(cLang, true).color
};
});