Consolidate styling of performer popover card

- Replaced PerformerPreviewCard with PerformerCard in PerformerPopover for better encapsulation and display.
- Simplified MatchedPerformerPreview by removing unnecessary loading state handling and age calculations.
- Enhanced styling in Tagger component with additional padding for better layout consistency.
This commit is contained in:
KennyG 2026-04-23 11:18:34 -04:00
parent 96d7b888a1
commit 4c6938ca3a
3 changed files with 12 additions and 41 deletions

View file

@ -5,6 +5,7 @@ import { HoverPopover } from "../Shared/HoverPopover";
import { useFindPerformer } from "../../core/StashService";
import { useConfigurationContext } from "../../hooks/Config";
import { Placement } from "react-bootstrap/esm/Overlay";
import { PerformerCard } from "./PerformerCard";
import { IPerformerPreviewData, PerformerPreviewCard } from "./PerformerPreviewCard";
interface IPeromerPopoverCardProps {
@ -35,13 +36,9 @@ const PerformerPopoverCardByID: React.FC<{
return (
<>
<PerformerPreviewCard
name={performer.name}
image={performer.image_path}
country={performer.country}
gender={performer.gender}
disambiguation={performer.disambiguation}
/>
<div className="tag-popover-card">
<PerformerCard performer={performer} zoomIndex={0} />
</div>
{cardExtras}
</>
);

View file

@ -4,8 +4,6 @@ import { IntlShape, useIntl } from "react-intl";
import * as GQL from "src/core/generated-graphql";
import { PerformerPopover } from "src/components/Performers/PerformerPopover";
import { useConfigurationContext } from "src/hooks/Config";
import TextUtils from "src/utils/text";
import { localPerformerToPreviewData } from "./ScrapedPerformerPreview";
interface IPerformerDeltaRow {
label: string;
@ -187,18 +185,13 @@ export const MatchedPerformerPreview = ({
children,
}: IMatchedPerformerPreviewProps) => {
const intl = useIntl();
const loadingText = intl.formatMessage({
id: "loading.generic",
defaultMessage: "Loading...",
});
const { configuration: config } = useConfigurationContext();
const showPerformerCardOnHover = config?.ui.showTagCardOnHover ?? true;
const [isOpened, setIsOpened] = useState(false);
const { data: selectedPerformerData, loading: selectedPerformerLoading } =
GQL.useFindPerformerQuery({
variables: { id: performerID ?? "" },
skip: !performerID || !isOpened,
});
const { data: selectedPerformerData } = GQL.useFindPerformerQuery({
variables: { id: performerID ?? "" },
skip: !performerID || !isOpened,
});
const performer = selectedPerformerData?.findPerformer;
const warningStashID =
endpoint && scrapedPerformer.remote_site_id && performer
@ -211,22 +204,6 @@ export const MatchedPerformerPreview = ({
const deltaRows = performer
? buildPerformerDeltaRows(scrapedPerformer, performer, intl)
: [];
const matchedAge = performer
? TextUtils.age(performer.birthdate, performer.death_date)
: 0;
const matchedAgeString =
performer && matchedAge !== 0
? intl.formatMessage(
{ id: "media_info.performer_card.age" },
{
age: matchedAge,
years_old: intl.formatMessage({
id: "years_old",
defaultMessage: "years old",
}),
}
)
: null;
const warningEndpointName = warningStashID
? config?.general.stashBoxes.find(
(sb) => sb.endpoint === warningStashID.endpoint
@ -239,13 +216,7 @@ export const MatchedPerformerPreview = ({
return (
<PerformerPopover
previewData={
performer
? localPerformerToPreviewData(performer, matchedAgeString)
: undefined
}
loading={selectedPerformerLoading}
loadingText={loadingText}
id={performerID ?? undefined}
cardExtras={
warningStashID || deltaRows.length > 0 ? (
<div className="tagger-matched-performer-popover-extra">

View file

@ -109,6 +109,9 @@
border-top: 1px solid $secondary;
margin-top: 0.4rem;
padding-top: 0.5rem;
padding-left: 0.5rem;
padding-right: 0.5rem;
padding-bottom: 0.4rem;
}
.tagger-performer-delta-rows {