mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +03:00
Add O-Count to performer page (#6171)
This commit is contained in:
@@ -42,6 +42,7 @@ import {
|
|||||||
import { DetailTitle } from "src/components/Shared/DetailsPage/DetailTitle";
|
import { DetailTitle } from "src/components/Shared/DetailsPage/DetailTitle";
|
||||||
import { ExpandCollapseButton } from "src/components/Shared/CollapseButton";
|
import { ExpandCollapseButton } from "src/components/Shared/CollapseButton";
|
||||||
import { FavoriteIcon } from "src/components/Shared/FavoriteIcon";
|
import { FavoriteIcon } from "src/components/Shared/FavoriteIcon";
|
||||||
|
import { SweatDrops } from "src/components/Shared/SweatDrops";
|
||||||
import { AliasList } from "src/components/Shared/DetailsPage/AliasList";
|
import { AliasList } from "src/components/Shared/DetailsPage/AliasList";
|
||||||
import { HeaderImage } from "src/components/Shared/DetailsPage/HeaderImage";
|
import { HeaderImage } from "src/components/Shared/DetailsPage/HeaderImage";
|
||||||
import { LightboxLink } from "src/hooks/Lightbox/LightboxLink";
|
import { LightboxLink } from "src/hooks/Lightbox/LightboxLink";
|
||||||
@@ -423,12 +424,22 @@ const PerformerPage: React.FC<IProps> = PatchComponent(
|
|||||||
</span>
|
</span>
|
||||||
</DetailTitle>
|
</DetailTitle>
|
||||||
<AliasList aliases={performer.alias_list} />
|
<AliasList aliases={performer.alias_list} />
|
||||||
|
<div className="quality-group">
|
||||||
<RatingSystem
|
<RatingSystem
|
||||||
value={performer.rating100}
|
value={performer.rating100}
|
||||||
onSetRating={(value) => setRating(value)}
|
onSetRating={(value) => setRating(value)}
|
||||||
clickToRate
|
clickToRate
|
||||||
withoutContext
|
withoutContext
|
||||||
/>
|
/>
|
||||||
|
{!!performer.o_counter && (
|
||||||
|
<span className="o-counter">
|
||||||
|
<span className="fa-icon">
|
||||||
|
<SweatDrops />
|
||||||
|
</span>
|
||||||
|
<span>{performer.o_counter}</span>
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
{!isEditing && (
|
{!isEditing && (
|
||||||
<PerformerDetailsPanel
|
<PerformerDetailsPanel
|
||||||
performer={performer}
|
performer={performer}
|
||||||
|
|||||||
@@ -35,12 +35,33 @@
|
|||||||
.rating-number .form-control {
|
.rating-number .form-control {
|
||||||
width: inherit;
|
width: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The following min-width declarations prevent
|
||||||
|
// the performer's O-Count from moving around
|
||||||
|
// when hovering over rating stars
|
||||||
|
.rating-stars-precision-full .star-rating-number {
|
||||||
|
min-width: 0.75rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rating-stars-precision-half .star-rating-number,
|
||||||
|
.rating-stars-precision-tenth .star-rating-number {
|
||||||
|
min-width: 1.45rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rating-stars-precision-quarter .star-rating-number {
|
||||||
|
min-width: 2rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.alias {
|
.alias {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.quality-group {
|
||||||
|
display: inline-flex;
|
||||||
|
margin-top: 0.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
// the detail element ids are the same as field type name
|
// the detail element ids are the same as field type name
|
||||||
// which don't follow the correct convention
|
// which don't follow the correct convention
|
||||||
/* stylelint-disable selector-class-pattern */
|
/* stylelint-disable selector-class-pattern */
|
||||||
|
|||||||
@@ -228,21 +228,16 @@ export const RatingStars = PatchComponent(
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const maybeRenderStarRatingNumber = () => {
|
const maybeGetStarRatingNumber = () => {
|
||||||
const ratingFraction = getCurrentSelectedRating();
|
const ratingFraction = getCurrentSelectedRating();
|
||||||
if (
|
if (
|
||||||
!ratingFraction ||
|
!ratingFraction ||
|
||||||
(ratingFraction.rating == 0 && ratingFraction.fraction == 0)
|
(ratingFraction.rating == 0 && ratingFraction.fraction == 0)
|
||||||
) {
|
) {
|
||||||
return;
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return ratingFraction.rating + ratingFraction.fraction + suffix;
|
||||||
<span className="star-rating-number">
|
|
||||||
{ratingFraction.rating + ratingFraction.fraction}
|
|
||||||
{suffix}
|
|
||||||
</span>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const precisionClassName = `rating-stars-precision-${props.precision}`;
|
const precisionClassName = `rating-stars-precision-${props.precision}`;
|
||||||
@@ -252,7 +247,7 @@ export const RatingStars = PatchComponent(
|
|||||||
{Array.from(Array(max)).map((value, index) =>
|
{Array.from(Array(max)).map((value, index) =>
|
||||||
renderRatingButton(index + 1)
|
renderRatingButton(index + 1)
|
||||||
)}
|
)}
|
||||||
{maybeRenderStarRatingNumber()}
|
<span className="star-rating-number">{maybeGetStarRatingNumber()}</span>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user