Skip to content

Commit

Permalink
Fixed: Performer image scaling
Browse files Browse the repository at this point in the history
Lint fixes
  • Loading branch information
plz12345 committed Mar 17, 2024
1 parent 0f623df commit d961b24
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 73 deletions.
12 changes: 6 additions & 6 deletions frontend/src/Movie/Details/Credits/Cast/MovieCastPoster.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ class MovieCastPoster extends Component {
const elementStyle = {
width: `${posterWidth}px`,
height: `${posterHeight}px`,
borderRadius: '5px'
borderRadius: '5px',
'object-fit': 'cover'
};

const contentStyle = {
Expand Down Expand Up @@ -93,11 +94,10 @@ class MovieCastPoster extends Component {
onLoad={this.onPosterLoad}
/>

{
hasPosterError &&
<div className={styles.overlayTitle}>
{performer.fullName}
</div>
{hasPosterError &&
<div className={styles.overlayTitle}>
{performer.fullName}
</div>
}
</Link>
</div>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/Performer/Details/PerformerDetails.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
.poster {
z-index: 2;
flex-shrink: 0;
margin-right: 35px;
margin-right: 30px;
width: 217px;
height: 319px;
}
Expand Down Expand Up @@ -216,4 +216,4 @@
.details {
font-size: 19px;
}
}
}
126 changes: 61 additions & 65 deletions frontend/src/Performer/Details/PerformerDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,9 @@ class PerformerDetails extends Component {
const runningYears = statusDetails.title === translate('Inactive') ? `${careerStart}-${careerEnd}` : `${careerStart}-`;

const fanartUrl = getFanartUrl(images);
const elementStyle = {
'object-fit': 'cover'
};

return (
<PageContent title={fullName}>
Expand Down Expand Up @@ -293,6 +296,7 @@ class PerformerDetails extends Component {
<MovieHeadshot
blur={safeForWorkMode}
className={styles.poster}
style={elementStyle}
images={images}
size={250}
lazy={false}
Expand Down Expand Up @@ -339,25 +343,22 @@ class PerformerDetails extends Component {

<div className={styles.details}>
<div>
{
!!gender &&
<span className={styles.gender}>
{firstCharToUpper(gender)}
</span>
{!!gender &&
<span className={styles.gender}>
{firstCharToUpper(gender)}
</span>
}

{
!!ethnicity &&
<span className={styles.ethnicity}>
{firstCharToUpper(ethnicity)}
</span>
{!!ethnicity &&
<span className={styles.ethnicity}>
{firstCharToUpper(ethnicity)}
</span>
}

{
!!careerStart &&
<span className={styles.years}>
{runningYears}
</span>
{!!careerStart &&
<span className={styles.years}>
{runningYears}
</span>
}

{
Expand All @@ -379,22 +380,21 @@ class PerformerDetails extends Component {
</span>
}

{
!!tags.length &&
<span>
<Tooltip
anchor={
<Icon
name={icons.TAGS}
size={20}
/>
}
tooltip={
<PerformerTagsConnector performerId={id} />
}
position={tooltipPositions.BOTTOM}
/>
</span>
{!!tags.length &&
<span>
<Tooltip
anchor={
<Icon
name={icons.TAGS}
size={20}
/>
}
tooltip={
<PerformerTagsConnector performerId={id} />
}
position={tooltipPositions.BOTTOM}
/>
</span>
}
</div>
</div>
Expand Down Expand Up @@ -489,17 +489,16 @@ class PerformerDetails extends Component {
position={tooltipPositions.BOTTOM}
/>

{
!!genres.length && !isSmallScreen &&
<Label
className={styles.detailsInfoLabel}
title={translate('Genres')}
size={sizes.LARGE}
>
<span className={styles.genres}>
{genres.join(', ')}
</span>
</Label>
{!!genres.length && !isSmallScreen &&
<Label
className={styles.detailsInfoLabel}
title={translate('Genres')}
size={sizes.LARGE}
>
<span className={styles.genres}>
{genres.join(', ')}
</span>
</Label>
}
</div>
</div>
Expand All @@ -523,29 +522,26 @@ class PerformerDetails extends Component {
null
}

{
!isFetching && isPopulated && hasScenes ?
<FieldSet legend={translate('Scenes')}>
{
isPopulated && !!studios.length &&
<div>
{
studios.map((studio) => {
return (
<PerformerDetailsStudioConnector
key={studio.foreignId}
performerId={id}
studioForeignId={studio.foreignId}
isExpanded={expandedState[studio.foreignId]}
onExpandPress={this.onExpandPress}
/>
);
})
}
</div>
}
</FieldSet> :
null
{!isFetching && isPopulated && hasScenes ?
<FieldSet legend={translate('Scenes')}>
{isPopulated && !!studios.length &&
<div>
{studios.map((studio) => {
return (
<PerformerDetailsStudioConnector
key={studio.foreignId}
performerId={id}
studioForeignId={studio.foreignId}
isExpanded={expandedState[studio.foreignId]}
onExpandPress={this.onExpandPress}
/>
);
})
}
</div>
}
</FieldSet> :
null
}
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ function PerformerIndexPoster(props: PerformerIndexPosterProps) {
const elementStyle = {
width: `${posterWidth}px`,
height: `${posterHeight}px`,
'object-fit': 'cover',
};

return (
Expand Down

0 comments on commit d961b24

Please sign in to comment.