mirror of
https://github.com/kremalicious/portfolio.git
synced 2025-01-03 18:35:00 +01:00
smaller github data
This commit is contained in:
parent
8138cbcf73
commit
63d9db4d27
@ -37,7 +37,21 @@ async function getGithubRepos(data) {
|
|||||||
// sort by pushed to, newest first
|
// sort by pushed to, newest first
|
||||||
.sort((a, b) => b.pushed_at.localeCompare(a.pushed_at))
|
.sort((a, b) => b.pushed_at.localeCompare(a.pushed_at))
|
||||||
|
|
||||||
return repos
|
// reduce data output by reconstructing repo objects
|
||||||
|
const reposReduced = []
|
||||||
|
let holder = {}
|
||||||
|
|
||||||
|
for (let repo of repos) {
|
||||||
|
holder.name = repo.name
|
||||||
|
holder.description = repo.description
|
||||||
|
holder.html_url = repo.html_url
|
||||||
|
holder.homepage = repo.homepage
|
||||||
|
holder.stargazers_count = repo.stargazers_count
|
||||||
|
reposReduced.push(holder)
|
||||||
|
holder = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
return reposReduced
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -10,6 +10,8 @@ export default class Repositories extends PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
if (!this.props.repos) return null
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section className={styles.section}>
|
<section className={styles.section}>
|
||||||
<h1 className={styles.sectionTitle}>Open Source Projects</h1>
|
<h1 className={styles.sectionTitle}>Open Source Projects</h1>
|
||||||
|
Loading…
Reference in New Issue
Block a user