Skip to content

Commit

Permalink
Fix contextual link for taxonomy pills
Browse files Browse the repository at this point in the history
Fix #627
  • Loading branch information
danielfdsilva committed Aug 22, 2023
1 parent 889dd91 commit 1653d23
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions app/scripts/components/common/content-taxonomy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { Actions } from './browse-controls/use-browse-controls';

import { variableGlsp } from '$styles/variable-utils';
import { Pill } from '$styles/pill';
import { DATASETS_PATH } from '$utils/routes';

const TaxonomySection = styled.section`
grid-column: 1 / -1;
Expand All @@ -36,10 +35,11 @@ const TaxonomyList = styled.dl`

interface ContentTaxonomyProps {
taxonomy: Taxonomy[];
linkBase: string;
}

export function ContentTaxonomy(props: ContentTaxonomyProps) {
const { taxonomy } = props;
const { taxonomy, linkBase } = props;

if (!taxonomy.length) return null;

Expand All @@ -60,9 +60,9 @@ export function ContentTaxonomy(props: ContentTaxonomyProps) {
variation='achromic'
key={t.id}
as={Link}
to={`${DATASETS_PATH}?${
Actions.TAXONOMY
}=${encodeURIComponent(JSON.stringify({ [name]: t.id }))}`}
to={`${linkBase}?${Actions.TAXONOMY}=${encodeURIComponent(
JSON.stringify({ [name]: t.id })
)}`}
>
{t.name}
</Pill>
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/components/datasets/s-overview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function DatasetsOverview() {
)}
renderDetailsBlock={() => (
<>
<ContentTaxonomy taxonomy={taxonomies} />
<ContentTaxonomy taxonomy={taxonomies} linkBase={DATASETS_PATH} />
<DatasetClassification dataset={dataset.data} />
</>
)}
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/components/stories/single/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function StoriesSingle() {
attributionAuthor={media?.author?.name}
attributionUrl={media?.author?.url}
renderDetailsBlock={() => (
<ContentTaxonomy taxonomy={story.data.taxonomy} />
<ContentTaxonomy taxonomy={story.data.taxonomy} linkBase={STORIES_PATH} />
)}
/>

Expand Down

0 comments on commit 1653d23

Please sign in to comment.