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 {
id
name
disambiguation
gender
favorite
image_path

View File

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

View File

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

View File

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

View File

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

View File

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