Skip to content

Commit 04f9ac6

Browse files
author
Thomas Leing
committed
Fix FilterSelect dropdown links
1 parent b0b117c commit 04f9ac6

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

src/components/Menu/FilterSelect/index.tsx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,17 @@ class FilterSelect extends React.Component<
8484
if (name === this.props.filterKey) return;
8585
const query = {};
8686
query[this.filterKind] = name;
87+
88+
let href = {
89+
pathname: this.props.pathname,
90+
query: query,
91+
} as object | string;
92+
if (!this.props.pathname.includes("/q/")) {
93+
href = this.props.pathname + `/q/${this.filterKind}/${name}`;
94+
}
95+
8796
return (
88-
<Link
89-
href={{
90-
pathname: this.props.pathname,
91-
query: query,
92-
}}
93-
key={name}
94-
>
97+
<Link href={href} key={name}>
9598
<a onClick={this.toggleVis}>
9699
<img
97100
src={filterMetadataByOption[name]?.graphicURI}
@@ -133,7 +136,7 @@ class FilterSelect extends React.Component<
133136
CurrentlySelected = (
134137
<CurrentlySelectedStyle>
135138
<a onClick={this.toggleVis}>
136-
<span>Click to choose a {this.filterKind} below.</span>
139+
<span>Click to choose a {this.filterKind}.</span>
137140
</a>
138141
</CurrentlySelectedStyle>
139142
);

0 commit comments

Comments
 (0)