1
0
mirror of https://github.com/oceanprotocol/docs.git synced 2024-11-26 19:49:26 +01:00

Merge pull request #53 from oceanprotocol/fix/48b

fix for showing links on all repos
This commit is contained in:
Matthias Kretschmann 2018-11-22 11:08:45 +01:00 committed by GitHub
commit 4232fc3f57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -224,17 +224,17 @@ const Repository = ({ name, links, readme }) => (
// enhance passed links array with what's in repositories.yml,
// iterating over all repos until we have a name match
const linksFilteredArray = repositoriesYaml.map(({ node }) => {
return node.items
.map(item => {
if (item.name === name) {
return item.links
}
})
.filter(n => n)[0]
let linksFilteredArray = []
repositoriesYaml.map(({ node }) => {
node.items.forEach(item => {
if (item.name === name) {
linksFilteredArray.push(item.links)
}
})
})
const moreLinks = links || linksFilteredArray[0]
const moreLinks = links || linksFilteredArray.filter(n => n)[0]
return (
<article className={styles.repository}>