Equalise card styles for movies/galleries/images (#1015)

This commit is contained in:
InfiniteTF
2021-01-05 03:12:16 +01:00
committed by GitHub
parent d84d48bc29
commit 6b1d229a6d
6 changed files with 46 additions and 23 deletions

View File

@@ -4,8 +4,14 @@ import { Link } from "react-router-dom";
import * as GQL from "src/core/generated-graphql";
import { FormattedPlural } from "react-intl";
import { useConfiguration } from "src/core/StashService";
import { HoverPopover, Icon, TagLink } from "../Shared";
import { BasicCard } from "../Shared/BasicCard";
import {
BasicCard,
HoverPopover,
Icon,
TagLink,
TruncatedText,
} from "src/components/Shared";
import { TextUtils } from "src/utils";
interface IProps {
gallery: GQL.GallerySlimDataFragment;
@@ -174,7 +180,14 @@ export const GalleryCard: React.FC<IProps> = (props) => {
<>
<Link to={`/galleries/${props.gallery.id}`}>
<h5 className="card-section-title">
{props.gallery.title ?? props.gallery.path}
<TruncatedText
text={
props.gallery.title
? props.gallery.title
: TextUtils.fileNameFromPath(props.gallery.path ?? "")
}
lineCount={2}
/>
</h5>
</Link>
<span>

View File

@@ -34,6 +34,10 @@
}
}
.card-popovers {
margin-bottom: 0;
}
.card-section-title {
color: $text-color;
}

View File

@@ -3,7 +3,13 @@ import { Button, ButtonGroup, Card, Form } from "react-bootstrap";
import { Link } from "react-router-dom";
import cx from "classnames";
import * as GQL from "src/core/generated-graphql";
import { Icon, TagLink, HoverPopover, SweatDrops } from "src/components/Shared";
import {
Icon,
TagLink,
HoverPopover,
SweatDrops,
TruncatedText,
} from "src/components/Shared";
import { TextUtils } from "src/utils";
interface IImageCardProps {
@@ -200,9 +206,14 @@ export const ImageCard: React.FC<IImageCardProps> = (
</div>
<div className="card-section">
<h5 className="card-section-title">
{props.image.title
? props.image.title
: TextUtils.fileNameFromPath(props.image.path)}
<TruncatedText
text={
props.image.title
? props.image.title
: TextUtils.fileNameFromPath(props.image.path)
}
lineCount={2}
/>
</h5>
</div>

View File

@@ -47,6 +47,7 @@
&-image {
height: 100%;
object-fit: contain;
object-position: top;
width: 100%;
}

View File

@@ -62,7 +62,7 @@ export const MovieCard: FunctionComponent<IProps> = (props: IProps) => {
details={
<>
<h5>
<TruncatedText text={props.movie.name} />
<TruncatedText text={props.movie.name} lineCount={2} />
</h5>
{maybeRenderSceneNumber()}
</>

View File

@@ -1,26 +1,20 @@
.card.movie-card {
padding: 0 0 1rem 0;
}
.movie-details {
max-width: 1200px;
}
.movie-card {
&-header {
height: 240px;
line-height: 240px;
text-align: center;
width: 240px;
@media (max-width: 576px) {
width: 100%;
}
&.card {
padding: 0 0 1rem;
}
&-image {
max-height: 240px;
object-fit: contain;
vertical-align: middle;
width: 320px;
@media (max-width: 576px) {
width: 100%;
}
width: 100%;
}
}