diff --git a/ui/v2.5/src/components/Performers/PerformerCard.tsx b/ui/v2.5/src/components/Performers/PerformerCard.tsx index 79d147f12..fd21b0e92 100644 --- a/ui/v2.5/src/components/Performers/PerformerCard.tsx +++ b/ui/v2.5/src/components/Performers/PerformerCard.tsx @@ -38,7 +38,9 @@ export const PerformerCard: React.FC = ({
{performer.name}
{age !== 0 ?
{ageString}
: ""} - + + +
Stars in  diff --git a/ui/v2.5/src/models/list-filter/criteria/country.ts b/ui/v2.5/src/models/list-filter/criteria/country.ts new file mode 100644 index 000000000..b5e7cf871 --- /dev/null +++ b/ui/v2.5/src/models/list-filter/criteria/country.ts @@ -0,0 +1,16 @@ +import { CriterionModifier } from "src/core/generated-graphql"; +import { Criterion, CriterionType, ICriterionOption } from "./criterion"; + +export class CountryCriterion extends Criterion { + public type: CriterionType = "country"; + public parameterName: string = "performers"; + public modifier = CriterionModifier.Equals; + public modifierOptions = []; + public options: string[] = [true.toString(), false.toString()]; + public value: string = ""; +} + +export class CountryCriterionOption implements ICriterionOption { + public label: string = Criterion.getLabel("performers"); + public value: CriterionType = "country"; +} diff --git a/ui/v2.5/src/utils/navigation.ts b/ui/v2.5/src/utils/navigation.ts index a4867bf6c..3a3cfadf8 100644 --- a/ui/v2.5/src/utils/navigation.ts +++ b/ui/v2.5/src/utils/navigation.ts @@ -1,5 +1,6 @@ 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 { StudiosCriterion, ParentStudiosCriterion, @@ -22,6 +23,17 @@ const makePerformerScenesUrl = ( return `/scenes?${filter.makeQueryParameters()}`; }; +const makePerformersCountryUrl = ( + performer: Partial +) => { + if (!performer.id) return "#"; + const filter = new ListFilterModel(FilterMode.Performers); + const criterion = new CountryCriterion(); + criterion.value = `${performer.country}`; + filter.criteria.push(criterion); + return `/performers?${filter.makeQueryParameters()}`; +}; + const makeStudioScenesUrl = (studio: Partial) => { if (!studio.id) return "#"; const filter = new ListFilterModel(FilterMode.Scenes); @@ -82,6 +94,7 @@ const makeSceneMarkerUrl = ( export default { makePerformerScenesUrl, + makePerformersCountryUrl, makeStudioScenesUrl, makeTagSceneMarkersUrl, makeTagScenesUrl,