Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add disambiguation to performer link and performer select values #4541

Merged
merged 2 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -28,6 +28,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
Loading