Skip to content

Commit

Permalink
Add disambiguation to performer link and performer select values (sta…
Browse files Browse the repository at this point in the history
…shapp#4541)

* Add disambiguation to PerformerLink
* Add disambiguation to performer select values
  • Loading branch information
WithoutPants authored and dogwithakeyboard committed Feb 18, 2024
1 parent bdb01ac commit fd33fc4
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 4 deletions.
1 change: 1 addition & 0 deletions ui/v2.5/graphql/data/scene-slim.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ fragment SlimSceneData on Scene {
performers {
id
name
disambiguation
gender
favorite
image_path
Expand Down
9 changes: 8 additions & 1 deletion ui/v2.5/src/components/Performers/PerformerSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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} />;
Expand Down
1 change: 1 addition & 0 deletions ui/v2.5/src/components/Performers/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@

.performer-select {
.performer-disambiguation {
color: initial;
white-space: pre;
}

Expand Down
4 changes: 4 additions & 0 deletions ui/v2.5/src/components/Scenes/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
margin: 5px;
}

.performer-tag-container .performer-disambiguation {
color: initial;
}

.performer-tag.image,
.movie-tag.image {
background-position: center;
Expand Down
5 changes: 4 additions & 1 deletion ui/v2.5/src/components/Shared/PerformerPopoverButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) => {
Expand Down
7 changes: 5 additions & 2 deletions ui/v2.5/src/components/Shared/TagLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const CommonLinkComponent: React.FC<ICommonLinkProps> = ({
};

interface IPerformerLinkProps {
performer: INamedObject;
performer: INamedObject & { disambiguation?: string | null };
linkType?: "scene" | "gallery" | "image";
className?: string;
}
Expand All @@ -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>
);
};
Expand Down

0 comments on commit fd33fc4

Please sign in to comment.