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

[WIP/RFC] Scene details page styling #4699

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from
6 changes: 6 additions & 0 deletions ui/v2.5/graphql/data/file.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ fragment FolderData on Folder {
fragment VideoFileData on VideoFile {
id
path
basename
size
mod_time
duration
Expand All @@ -24,6 +25,7 @@ fragment VideoFileData on VideoFile {
fragment ImageFileData on ImageFile {
id
path
basename
size
mod_time
width
Expand All @@ -37,6 +39,7 @@ fragment ImageFileData on ImageFile {
fragment GalleryFileData on GalleryFile {
id
path
basename
size
mod_time
fingerprints {
Expand All @@ -49,6 +52,7 @@ fragment VisualFileData on VisualFile {
... on BaseFile {
id
path
basename
size
mod_time
fingerprints {
Expand All @@ -59,6 +63,7 @@ fragment VisualFileData on VisualFile {
... on ImageFile {
id
path
basename
size
mod_time
width
Expand All @@ -71,6 +76,7 @@ fragment VisualFileData on VisualFile {
... on VideoFile {
id
path
basename
size
mod_time
duration
Expand Down
33 changes: 20 additions & 13 deletions ui/v2.5/src/components/Performers/PerformerCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export interface IPerformerCardExtraCriteria {
interface IPerformerCardProps {
performer: GQL.PerformerDataFragment;
containerWidth?: number;
ageFromDate?: string;
ageFromDate?: string | null;
selecting?: boolean;
selected?: boolean;
onSelectedChanged?: (selected: boolean, shiftKey: boolean) => void;
Expand All @@ -52,10 +52,10 @@ export const PerformerCard: React.FC<IPerformerCardProps> = ({
extraCriteria,
}) => {
const intl = useIntl();
const age = TextUtils.age(
performer.birthdate,
ageFromDate ?? performer.death_date
);
const age =
ageFromDate === null
? 0
: TextUtils.age(performer.birthdate, ageFromDate ?? performer.death_date);
const ageL10nId = ageFromDate
? "media_info.performer_card.age_context"
: "media_info.performer_card.age";
Expand Down Expand Up @@ -253,13 +253,20 @@ export const PerformerCard: React.FC<IPerformerCardProps> = ({
<GenderIcon className="gender-icon" gender={performer.gender} />
}
title={
<div>
<span className="performer-name">{performer.name}</span>
{performer.disambiguation && (
<span className="performer-disambiguation">
{` (${performer.disambiguation})`}
</span>
)}
<div className="performer-card-title">
<span>
<span className="performer-name">{performer.name}</span>
{performer.disambiguation && (
<span className="performer-disambiguation">
{` (${performer.disambiguation})`}
</span>
)}
{ageFromDate && (
<span className="performer-age" title={ageString}>
{age}
</span>
)}
</span>
</div>
}
image={
Expand All @@ -284,7 +291,7 @@ export const PerformerCard: React.FC<IPerformerCardProps> = ({
}
details={
<>
{age !== 0 ? (
{!ageFromDate && age !== 0 ? (
<div className="performer-card__age">{ageString}</div>
) : (
""
Expand Down
Loading
Loading