1
0
mirror of https://github.com/kremalicious/portfolio.git synced 2024-12-31 17:17:38 +01:00

smaller github data

This commit is contained in:
Matthias Kretschmann 2019-07-04 09:48:48 +02:00
parent 8138cbcf73
commit 63d9db4d27
Signed by: m
GPG Key ID: 606EEEF3C479A91F
2 changed files with 17 additions and 1 deletions

View File

@ -37,7 +37,21 @@ async function getGithubRepos(data) {
// sort by pushed to, newest first
.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
}
//

View File

@ -10,6 +10,8 @@ export default class Repositories extends PureComponent {
}
render() {
if (!this.props.repos) return null
return (
<section className={styles.section}>
<h1 className={styles.sectionTitle}>Open Source Projects</h1>