Add disambiguation to performer link and performer select values (#4541)

* Add disambiguation to PerformerLink
* Add disambiguation to performer select values
This commit is contained in:
WithoutPants
2024-02-12 14:03:45 +11:00
committed by GitHub
parent a4bbdcfbae
commit 235c9c90c2
6 changed files with 23 additions and 4 deletions

View File

@@ -75,6 +75,7 @@ fragment SlimSceneData on Scene {
performers { performers {
id id
name name
disambiguation
gender gender
favorite favorite
image_path image_path

View File

@@ -125,7 +125,14 @@ export const PerformerSelect: React.FC<
thisOptionProps = { thisOptionProps = {
...optionProps, ...optionProps,
children: object.name, children: (
<>
<span>{object.name}</span>
{object.disambiguation && (
<span className="performer-disambiguation">{` (${object.disambiguation})`}</span>
)}
</>
),
}; };
return <reactSelectComponents.MultiValueLabel {...thisOptionProps} />; return <reactSelectComponents.MultiValueLabel {...thisOptionProps} />;

View File

@@ -221,6 +221,7 @@
.performer-select { .performer-select {
.performer-disambiguation { .performer-disambiguation {
color: initial;
white-space: pre; white-space: pre;
} }

View File

@@ -29,6 +29,10 @@
margin: 5px; margin: 5px;
} }
.performer-tag-container .performer-disambiguation {
color: initial;
}
.performer-tag.image, .performer-tag.image,
.movie-tag.image { .movie-tag.image {
background-position: center; background-position: center;

View File

@@ -9,7 +9,10 @@ import { Icon } from "./Icon";
import { PerformerLink } from "./TagLink"; import { PerformerLink } from "./TagLink";
interface IProps { interface IProps {
performers: Partial<GQL.PerformerDataFragment>[]; performers: Pick<
GQL.Performer,
"id" | "name" | "image_path" | "disambiguation" | "gender"
>[];
} }
export const PerformerPopoverButton: React.FC<IProps> = ({ performers }) => { export const PerformerPopoverButton: React.FC<IProps> = ({ performers }) => {

View File

@@ -37,7 +37,7 @@ const CommonLinkComponent: React.FC<ICommonLinkProps> = ({
}; };
interface IPerformerLinkProps { interface IPerformerLinkProps {
performer: INamedObject; performer: INamedObject & { disambiguation?: string | null };
linkType?: "scene" | "gallery" | "image"; linkType?: "scene" | "gallery" | "image";
className?: string; className?: string;
} }
@@ -63,7 +63,10 @@ export const PerformerLink: React.FC<IPerformerLinkProps> = ({
return ( return (
<CommonLinkComponent link={link} className={className}> <CommonLinkComponent link={link} className={className}>
{title} <span>{title}</span>
{performer.disambiguation && (
<span className="performer-disambiguation">{` (${performer.disambiguation})`}</span>
)}
</CommonLinkComponent> </CommonLinkComponent>
); );
}; };