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

Performer country navigation #5549

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import React, { PropsWithChildren } from "react";
import { useIntl } from "react-intl";
import { Link } from "react-router-dom";
import { TagLink } from "src/components/Shared/TagLink";
import * as GQL from "src/core/generated-graphql";
import NavUtils from "src/utils/navigation";
import TextUtils from "src/utils/text";
import { DetailItem } from "src/components/Shared/DetailItem";
import { CountryFlag } from "src/components/Shared/CountryFlag";
Expand Down Expand Up @@ -99,11 +101,13 @@ export const PerformerDetailsPanel: React.FC<IPerformerDetails> =
<DetailItem
id="country"
value={
<CountryFlag
country={performer.country}
className="mr-2"
includeName={true}
/>
<Link to={NavUtils.makePerformersCountryUrl(performer)}>
<CountryFlag
country={performer.country}
className="mr-2"
includeName={true}
/>
</Link>
}
fullWidth={fullWidth}
/>
Expand Down
7 changes: 7 additions & 0 deletions ui/v2.5/src/utils/navigation.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as GQL from "src/core/generated-graphql";
import { PerformersCriterion } from "src/models/list-filter/criteria/performers";
import { CountryCriterion } from "src/models/list-filter/criteria/country";
import { GenderCriterion } from "src/models/list-filter/criteria/gender";
import {
StudiosCriterion,
ParentStudiosCriterion,
Expand Down Expand Up @@ -153,6 +154,12 @@ const makePerformersCountryUrl = (
const criterion = new CountryCriterion();
criterion.value = `${performer.country}`;
filter.criteria.push(criterion);

if (performer.gender) {
const genderCriterion = new GenderCriterion();
genderCriterion.value = [`${performer.gender}`];
filter.criteria.push(genderCriterion);
}
return `/performers?${filter.makeQueryParameters()}`;
};

Expand Down
Loading