From 0c837c681a152be9134d6dcf7fa122a83fe8c080 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 --- .../PerformerDetailsPanel.tsx | 14 ++++++++----- ui/v2.5/src/utils/navigation.ts | 20 +++++++++++-------- 2 files changed, 21 insertions(+), 13 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..4ea656eeef6 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, @@ -135,14 +136,17 @@ const makePerformerSceneMarkersUrl = ( performer: Partial ) => { if (!performer.id) return "#"; - const filter = new ListFilterModel(GQL.FilterMode.SceneMarkers, undefined); - const criterion = new PerformersCriterion(); - criterion.value.items = [ - { id: performer.id, label: performer.name || `Performer ${performer.id}` }, - ]; - - filter.criteria.push(criterion); - return `/scenes/markers?${filter.makeQueryParameters()}`; + const filter = new ListFilterModel(GQL.FilterMode.Performers, undefined); + const countryCriterion = new CountryCriterion(); + countryCriterion.value = `${performer.country}`; + filter.criteria.push(countryCriterion); + + if (performer.gender) { + const genderCriterion = new GenderCriterion(); + genderCriterion.value = [`${performer.gender}`]; + filter.criteria.push(genderCriterion); + } + return `/performers?${filter.makeQueryParameters()}`; }; const makePerformersCountryUrl = (