From 3adb2c9b0c70dd3e311cfc54648b94b43ce78ed2 Mon Sep 17 00:00:00 2001 From: purp Date: Thu, 12 Dec 2024 00:33:54 -0800 Subject: [PATCH] Performer country navigation * Added navigation for specific country within performer details section * Included additional gender filter to performer country navigation --- .../PerformerDetails/PerformerDetailsPanel.tsx | 14 +++++++++----- ui/v2.5/src/utils/navigation.ts | 7 +++++++ 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/ui/v2.5/src/components/Performers/PerformerDetails/PerformerDetailsPanel.tsx b/ui/v2.5/src/components/Performers/PerformerDetails/PerformerDetailsPanel.tsx index 83fc64c956c..dcf75112b40 100644 --- a/ui/v2.5/src/components/Performers/PerformerDetails/PerformerDetailsPanel.tsx +++ b/ui/v2.5/src/components/Performers/PerformerDetails/PerformerDetailsPanel.tsx @@ -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"; @@ -99,11 +101,13 @@ export const PerformerDetailsPanel: React.FC = + + + } fullWidth={fullWidth} /> diff --git a/ui/v2.5/src/utils/navigation.ts b/ui/v2.5/src/utils/navigation.ts index f6712fb58fb..bc51fa7a73d 100644 --- a/ui/v2.5/src/utils/navigation.ts +++ b/ui/v2.5/src/utils/navigation.ts @@ -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, @@ -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()}`; };