Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix /categories navigation #5901

Merged
merged 2 commits into from
Jul 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/desktop/apps/categories/components/FeaturedGenes.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const FeaturedGenes = ({ featuredGeneLinks }) => {
featuredGeneLinks.length > 0 &&
featuredGeneLinks
.map(featuredGene => (
<FeaturedGene key={featuredGene.id} {...featuredGene} />
<FeaturedGene key={featuredGene.href} {...featuredGene} />
))
.slice(0, 3)}
</Layout>
Expand Down
4 changes: 2 additions & 2 deletions src/desktop/apps/categories/components/GeneFamily.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ const GeneList = styled.ul`
}
`

const GeneFamily = ({ id, name, genes, featuredGeneLinks }) => {
const GeneFamily = ({ slug, name, genes, featuredGeneLinks }) => {
const publishedGenes = genes.filter(g => g.is_published)
const sortedGenes = alphabetizeGenes(publishedGenes)
return (
<div id={id}>
<div id={slug}>
<GeneFamilyName>{name}</GeneFamilyName>
<FeaturedGenes featuredGeneLinks={featuredGeneLinks} />
<GeneList>
Expand Down
4 changes: 2 additions & 2 deletions src/desktop/apps/categories/components/GeneFamilyNav.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ class GeneFamilyNav extends React.Component {
offset={-1 * TOP_BUFFER}
>
{geneFamilies.map(geneFamily => (
<GeneFamilyItem key={geneFamily.id}>
<GeneFamilyItem key={geneFamily.slug}>
<GeneFamilyLink
href={`#${geneFamily.id}`}
href={`#${geneFamily.slug}`}
onClick={this.handleClick}
>
{geneFamily.name}
Expand Down
1 change: 1 addition & 0 deletions src/desktop/apps/categories/queries/geneFamilies.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export default function GeneFamiliesQuery() {
edges {
node {
id
slug
name
genes {
id
Expand Down