mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 12:54:38 +03:00
Add classnames to count popovers (#1813)
This commit is contained in:
@@ -36,7 +36,11 @@ export const GalleryCard: React.FC<IProps> = (props) => {
|
|||||||
));
|
));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HoverPopover placement="bottom" content={popoverContent}>
|
<HoverPopover
|
||||||
|
className="scene-count"
|
||||||
|
placement="bottom"
|
||||||
|
content={popoverContent}
|
||||||
|
>
|
||||||
<Button className="minimal">
|
<Button className="minimal">
|
||||||
<Icon icon="play-circle" />
|
<Icon icon="play-circle" />
|
||||||
<span>{props.gallery.scenes.length}</span>
|
<span>{props.gallery.scenes.length}</span>
|
||||||
@@ -53,7 +57,11 @@ export const GalleryCard: React.FC<IProps> = (props) => {
|
|||||||
));
|
));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HoverPopover placement="bottom" content={popoverContent}>
|
<HoverPopover
|
||||||
|
className="tag-count"
|
||||||
|
placement="bottom"
|
||||||
|
content={popoverContent}
|
||||||
|
>
|
||||||
<Button className="minimal">
|
<Button className="minimal">
|
||||||
<Icon icon="tag" />
|
<Icon icon="tag" />
|
||||||
<span>{props.gallery.tags.length}</span>
|
<span>{props.gallery.tags.length}</span>
|
||||||
@@ -73,6 +81,7 @@ export const GalleryCard: React.FC<IProps> = (props) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<PopoverCountButton
|
<PopoverCountButton
|
||||||
|
className="image-count"
|
||||||
type="image"
|
type="image"
|
||||||
count={props.gallery.image_count}
|
count={props.gallery.image_count}
|
||||||
url={NavUtils.makeGalleryImagesUrl(props.gallery)}
|
url={NavUtils.makeGalleryImagesUrl(props.gallery)}
|
||||||
|
|||||||
@@ -27,7 +27,11 @@ export const ImageCard: React.FC<IImageCardProps> = (
|
|||||||
));
|
));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HoverPopover placement="bottom" content={popoverContent}>
|
<HoverPopover
|
||||||
|
className="tag-count"
|
||||||
|
placement="bottom"
|
||||||
|
content={popoverContent}
|
||||||
|
>
|
||||||
<Button className="minimal">
|
<Button className="minimal">
|
||||||
<Icon icon="tag" />
|
<Icon icon="tag" />
|
||||||
<span>{props.image.tags.length}</span>
|
<span>{props.image.tags.length}</span>
|
||||||
|
|||||||
@@ -41,7 +41,11 @@ export const MovieCard: FunctionComponent<IProps> = (props: IProps) => {
|
|||||||
));
|
));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HoverPopover placement="bottom" content={popoverContent}>
|
<HoverPopover
|
||||||
|
className="scene-count"
|
||||||
|
placement="bottom"
|
||||||
|
content={popoverContent}
|
||||||
|
>
|
||||||
<Button className="minimal">
|
<Button className="minimal">
|
||||||
<Icon icon="play-circle" />
|
<Icon icon="play-circle" />
|
||||||
<span>{props.movie.scenes.length}</span>
|
<span>{props.movie.scenes.length}</span>
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ export const PerformerCard: React.FC<IPerformerCardProps> = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<PopoverCountButton
|
<PopoverCountButton
|
||||||
|
className="scene-count"
|
||||||
type="scene"
|
type="scene"
|
||||||
count={performer.scene_count}
|
count={performer.scene_count}
|
||||||
url={NavUtils.makePerformerScenesUrl(performer, extraCriteria?.scenes)}
|
url={NavUtils.makePerformerScenesUrl(performer, extraCriteria?.scenes)}
|
||||||
@@ -86,6 +87,7 @@ export const PerformerCard: React.FC<IPerformerCardProps> = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<PopoverCountButton
|
<PopoverCountButton
|
||||||
|
className="image-count"
|
||||||
type="image"
|
type="image"
|
||||||
count={performer.image_count}
|
count={performer.image_count}
|
||||||
url={NavUtils.makePerformerImagesUrl(performer, extraCriteria?.images)}
|
url={NavUtils.makePerformerImagesUrl(performer, extraCriteria?.images)}
|
||||||
@@ -98,6 +100,7 @@ export const PerformerCard: React.FC<IPerformerCardProps> = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<PopoverCountButton
|
<PopoverCountButton
|
||||||
|
className="gallery-count"
|
||||||
type="gallery"
|
type="gallery"
|
||||||
count={performer.gallery_count}
|
count={performer.gallery_count}
|
||||||
url={NavUtils.makePerformerGalleriesUrl(
|
url={NavUtils.makePerformerGalleriesUrl(
|
||||||
@@ -117,7 +120,7 @@ export const PerformerCard: React.FC<IPerformerCardProps> = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<HoverPopover placement="bottom" content={popoverContent}>
|
<HoverPopover placement="bottom" content={popoverContent}>
|
||||||
<Button className="minimal">
|
<Button className="minimal tag-count">
|
||||||
<Icon icon="tag" />
|
<Icon icon="tag" />
|
||||||
<span>{performer.tags.length}</span>
|
<span>{performer.tags.length}</span>
|
||||||
</Button>
|
</Button>
|
||||||
@@ -130,6 +133,7 @@ export const PerformerCard: React.FC<IPerformerCardProps> = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<PopoverCountButton
|
<PopoverCountButton
|
||||||
|
className="movie-count"
|
||||||
type="movie"
|
type="movie"
|
||||||
count={performer.movie_count}
|
count={performer.movie_count}
|
||||||
url={NavUtils.makePerformerMoviesUrl(performer, extraCriteria?.movies)}
|
url={NavUtils.makePerformerMoviesUrl(performer, extraCriteria?.movies)}
|
||||||
|
|||||||
@@ -139,7 +139,11 @@ export const SceneCard: React.FC<ISceneCardProps> = (
|
|||||||
));
|
));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HoverPopover placement="bottom" content={popoverContent}>
|
<HoverPopover
|
||||||
|
className="tag-count"
|
||||||
|
placement="bottom"
|
||||||
|
content={popoverContent}
|
||||||
|
>
|
||||||
<Button className="minimal">
|
<Button className="minimal">
|
||||||
<Icon icon="tag" />
|
<Icon icon="tag" />
|
||||||
<span>{props.scene.tags.length}</span>
|
<span>{props.scene.tags.length}</span>
|
||||||
@@ -181,7 +185,7 @@ export const SceneCard: React.FC<ISceneCardProps> = (
|
|||||||
<HoverPopover
|
<HoverPopover
|
||||||
placement="bottom"
|
placement="bottom"
|
||||||
content={popoverContent}
|
content={popoverContent}
|
||||||
className="tag-tooltip"
|
className="movie-count tag-tooltip"
|
||||||
>
|
>
|
||||||
<Button className="minimal">
|
<Button className="minimal">
|
||||||
<Icon icon="film" />
|
<Icon icon="film" />
|
||||||
@@ -200,7 +204,11 @@ export const SceneCard: React.FC<ISceneCardProps> = (
|
|||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HoverPopover placement="bottom" content={popoverContent}>
|
<HoverPopover
|
||||||
|
className="marker-count"
|
||||||
|
placement="bottom"
|
||||||
|
content={popoverContent}
|
||||||
|
>
|
||||||
<Button className="minimal">
|
<Button className="minimal">
|
||||||
<Icon icon="map-marker-alt" />
|
<Icon icon="map-marker-alt" />
|
||||||
<span>{props.scene.scene_markers.length}</span>
|
<span>{props.scene.scene_markers.length}</span>
|
||||||
@@ -212,7 +220,7 @@ export const SceneCard: React.FC<ISceneCardProps> = (
|
|||||||
function maybeRenderOCounter() {
|
function maybeRenderOCounter() {
|
||||||
if (props.scene.o_counter) {
|
if (props.scene.o_counter) {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div className="o-counter">
|
||||||
<Button className="minimal">
|
<Button className="minimal">
|
||||||
<span className="fa-icon">
|
<span className="fa-icon">
|
||||||
<SweatDrops />
|
<SweatDrops />
|
||||||
@@ -232,7 +240,11 @@ export const SceneCard: React.FC<ISceneCardProps> = (
|
|||||||
));
|
));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HoverPopover placement="bottom" content={popoverContent}>
|
<HoverPopover
|
||||||
|
className="gallery-count"
|
||||||
|
placement="bottom"
|
||||||
|
content={popoverContent}
|
||||||
|
>
|
||||||
<Button className="minimal">
|
<Button className="minimal">
|
||||||
<Icon icon="images" />
|
<Icon icon="images" />
|
||||||
<span>{props.scene.galleries.length}</span>
|
<span>{props.scene.galleries.length}</span>
|
||||||
@@ -244,7 +256,7 @@ export const SceneCard: React.FC<ISceneCardProps> = (
|
|||||||
function maybeRenderOrganized() {
|
function maybeRenderOrganized() {
|
||||||
if (props.scene.organized) {
|
if (props.scene.organized) {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div className="organized">
|
||||||
<Button className="minimal">
|
<Button className="minimal">
|
||||||
<Icon icon="box" />
|
<Icon icon="box" />
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -30,7 +30,11 @@ export const PerformerPopoverButton: React.FC<IProps> = ({ performers }) => {
|
|||||||
));
|
));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HoverPopover placement="bottom" content={popoverContent}>
|
<HoverPopover
|
||||||
|
className="performer-count"
|
||||||
|
placement="bottom"
|
||||||
|
content={popoverContent}
|
||||||
|
>
|
||||||
<Button className="minimal">
|
<Button className="minimal">
|
||||||
<Icon icon="user" />
|
<Icon icon="user" />
|
||||||
<span>{performers.length}</span>
|
<span>{performers.length}</span>
|
||||||
|
|||||||
@@ -7,12 +7,18 @@ import Icon from "./Icon";
|
|||||||
type PopoverLinkType = "scene" | "image" | "gallery" | "movie";
|
type PopoverLinkType = "scene" | "image" | "gallery" | "movie";
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
|
className?: string;
|
||||||
url: string;
|
url: string;
|
||||||
type: PopoverLinkType;
|
type: PopoverLinkType;
|
||||||
count: number;
|
count: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const PopoverCountButton: React.FC<IProps> = ({ url, type, count }) => {
|
export const PopoverCountButton: React.FC<IProps> = ({
|
||||||
|
className,
|
||||||
|
url,
|
||||||
|
type,
|
||||||
|
count,
|
||||||
|
}) => {
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
|
|
||||||
function getIcon() {
|
function getIcon() {
|
||||||
@@ -61,7 +67,7 @@ export const PopoverCountButton: React.FC<IProps> = ({ url, type, count }) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Link to={url} title={getTitle()}>
|
<Link className={className} to={url} title={getTitle()}>
|
||||||
<Button className="minimal">
|
<Button className="minimal">
|
||||||
<Icon icon={getIcon()} />
|
<Icon icon={getIcon()} />
|
||||||
<span>{count}</span>
|
<span>{count}</span>
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ export const StudioCard: React.FC<IProps> = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<PopoverCountButton
|
<PopoverCountButton
|
||||||
|
className="scene-count"
|
||||||
type="scene"
|
type="scene"
|
||||||
count={studio.scene_count}
|
count={studio.scene_count}
|
||||||
url={NavUtils.makeStudioScenesUrl(studio)}
|
url={NavUtils.makeStudioScenesUrl(studio)}
|
||||||
@@ -70,6 +71,7 @@ export const StudioCard: React.FC<IProps> = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<PopoverCountButton
|
<PopoverCountButton
|
||||||
|
className="image-count"
|
||||||
type="image"
|
type="image"
|
||||||
count={studio.image_count}
|
count={studio.image_count}
|
||||||
url={NavUtils.makeStudioImagesUrl(studio)}
|
url={NavUtils.makeStudioImagesUrl(studio)}
|
||||||
@@ -82,6 +84,7 @@ export const StudioCard: React.FC<IProps> = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<PopoverCountButton
|
<PopoverCountButton
|
||||||
|
className="gallery-count"
|
||||||
type="gallery"
|
type="gallery"
|
||||||
count={studio.gallery_count}
|
count={studio.gallery_count}
|
||||||
url={NavUtils.makeStudioGalleriesUrl(studio)}
|
url={NavUtils.makeStudioGalleriesUrl(studio)}
|
||||||
@@ -94,6 +97,7 @@ export const StudioCard: React.FC<IProps> = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<PopoverCountButton
|
<PopoverCountButton
|
||||||
|
className="movie-count"
|
||||||
type="movie"
|
type="movie"
|
||||||
count={studio.movie_count}
|
count={studio.movie_count}
|
||||||
url={NavUtils.makeStudioMoviesUrl(studio)}
|
url={NavUtils.makeStudioMoviesUrl(studio)}
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ export const TagCard: React.FC<IProps> = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<PopoverCountButton
|
<PopoverCountButton
|
||||||
|
className="scene-count"
|
||||||
type="scene"
|
type="scene"
|
||||||
count={tag.scene_count}
|
count={tag.scene_count}
|
||||||
url={NavUtils.makeTagScenesUrl(tag)}
|
url={NavUtils.makeTagScenesUrl(tag)}
|
||||||
@@ -86,7 +87,7 @@ export const TagCard: React.FC<IProps> = ({
|
|||||||
if (!tag.scene_marker_count) return;
|
if (!tag.scene_marker_count) return;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Link to={NavUtils.makeTagSceneMarkersUrl(tag)}>
|
<Link className="marker-count" to={NavUtils.makeTagSceneMarkersUrl(tag)}>
|
||||||
<Button className="minimal">
|
<Button className="minimal">
|
||||||
<Icon icon="map-marker-alt" />
|
<Icon icon="map-marker-alt" />
|
||||||
<span>{tag.scene_marker_count}</span>
|
<span>{tag.scene_marker_count}</span>
|
||||||
@@ -100,6 +101,7 @@ export const TagCard: React.FC<IProps> = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<PopoverCountButton
|
<PopoverCountButton
|
||||||
|
className="image-count"
|
||||||
type="image"
|
type="image"
|
||||||
count={tag.image_count}
|
count={tag.image_count}
|
||||||
url={NavUtils.makeTagImagesUrl(tag)}
|
url={NavUtils.makeTagImagesUrl(tag)}
|
||||||
@@ -112,6 +114,7 @@ export const TagCard: React.FC<IProps> = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<PopoverCountButton
|
<PopoverCountButton
|
||||||
|
className="gallery-count"
|
||||||
type="gallery"
|
type="gallery"
|
||||||
count={tag.gallery_count}
|
count={tag.gallery_count}
|
||||||
url={NavUtils.makeTagGalleriesUrl(tag)}
|
url={NavUtils.makeTagGalleriesUrl(tag)}
|
||||||
@@ -123,7 +126,7 @@ export const TagCard: React.FC<IProps> = ({
|
|||||||
if (!tag.performer_count) return;
|
if (!tag.performer_count) return;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Link to={NavUtils.makeTagPerformersUrl(tag)}>
|
<Link className="performer-count" to={NavUtils.makeTagPerformersUrl(tag)}>
|
||||||
<Button className="minimal">
|
<Button className="minimal">
|
||||||
<Icon icon="user" />
|
<Icon icon="user" />
|
||||||
<span>{tag.performer_count}</span>
|
<span>{tag.performer_count}</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user