Skip to content

Commit

Permalink
Details redesign bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cj12312021 committed Aug 1, 2023
1 parent 170f45c commit 632a1e0
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 11 deletions.
9 changes: 5 additions & 4 deletions ui/v2.5/src/components/Movies/MovieDetails/Movie.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import { ConfigurationContext } from "src/hooks/Config";
import { IUIConfig } from "src/core/config";
import ImageUtils from "src/utils/image";
import { useRatingKeybinds } from "src/hooks/keybinds";
import UAParser from "ua-parser-js";

interface IProps {
movie: GQL.MovieDataFragment;
Expand Down Expand Up @@ -64,6 +65,8 @@ const MoviePage: React.FC<IProps> = ({ movie }) => {
const [backImage, setBackImage] = useState<string | null>();
const [encodingImage, setEncodingImage] = useState<boolean>(false);

const appleRendering = /(ipad)/i.test(navigator.userAgent) || /(macintosh.*safari)/i.test(navigator.userAgent);

const defaultImage =
movie.front_image_path && movie.front_image_path.includes("default=true")
? true
Expand Down Expand Up @@ -414,16 +417,14 @@ const MoviePage: React.FC<IProps> = ({ movie }) => {
<div
className={`detail-header ${isEditing ? "edit" : ""} ${
collapsed ? "collapsed" : !compactExpandedDetails ? "full-width" : ""
}`}
} ${appleRendering ? "apple" : ""}`}
>
{maybeRenderHeaderBackgroundImage()}
<div className="detail-container">
<div className="detail-header-image">
<div className="logo w-100">
{encodingImage ? (
<LoadingIndicator
message={`${intl.formatMessage({ id: "encoding_image" })}...`}
/>
<LoadingIndicator message="Encoding image..." />
) : (
<div className="movie-images">
{renderFrontImage()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ const PerformerPage: React.FC<IProps> = ({ performer }) => {
const [encodingImage, setEncodingImage] = useState<boolean>(false);
const [loadStickyHeader, setLoadStickyHeader] = useState<boolean>(false);

const appleRendering = /(ipad)/i.test(navigator.userAgent) || /(macintosh.*safari)/i.test(navigator.userAgent);

const activeImage = useMemo(() => {
const performerImage = performer.image_path;
if (isEditing) {
Expand Down Expand Up @@ -546,7 +548,7 @@ const PerformerPage: React.FC<IProps> = ({ performer }) => {
<div
className={`detail-header ${isEditing ? "edit" : ""} ${
collapsed ? "collapsed" : !compactExpandedDetails ? "full-width" : ""
}`}
} ${appleRendering ? "apple" : ""}`}
>
{maybeRenderHeaderBackgroundImage()}
<div className="detail-container">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,11 @@ export const PerformerDetailsPanel: React.FC<IPerformerDetails> = ({
value={performer?.piercings}
fullWidth={fullWidth}
/>
<DetailItem
id="career_length"
value={performer?.career_length}
fullWidth={fullWidth}
/>
<DetailItem id="details" value={details} fullWidth={fullWidth} />
<DetailItem
id="tags"
Expand Down
3 changes: 2 additions & 1 deletion ui/v2.5/src/components/Shared/GridCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ export const GridCard: React.FC<ICardProps> = (props: ICardProps) => {
if (props.selecting) {
props.onSelectedChanged(!props.selected, shiftKey);
event.preventDefault();
} else {
window.scrollTo(0, 0);
}
window.scrollTo(0, 0);
}

function handleDrag(event: React.DragEvent<HTMLElement>) {
Expand Down
4 changes: 3 additions & 1 deletion ui/v2.5/src/components/Studios/StudioDetails/Studio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ const StudioPage: React.FC<IProps> = ({ studio }) => {
const [collapsed, setCollapsed] = useState<boolean>(!showAllDetails);
const [loadStickyHeader, setLoadStickyHeader] = useState<boolean>(false);

const appleRendering = /(ipad)/i.test(navigator.userAgent) || /(macintosh.*safari)/i.test(navigator.userAgent);

// Editing state
const [isEditing, setIsEditing] = useState<boolean>(false);
const [isDeleteAlertOpen, setIsDeleteAlertOpen] = useState<boolean>(false);
Expand Down Expand Up @@ -504,7 +506,7 @@ const StudioPage: React.FC<IProps> = ({ studio }) => {
<div
className={`detail-header ${isEditing ? "edit" : ""} ${
collapsed ? "collapsed" : !compactExpandedDetails ? "full-width" : ""
}`}
} ${appleRendering ? "apple" : ""}`}
>
{maybeRenderHeaderBackgroundImage()}
<div className="detail-container">
Expand Down
4 changes: 3 additions & 1 deletion ui/v2.5/src/components/Tags/TagDetails/Tag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ const TagPage: React.FC<IProps> = ({ tag }) => {
const [collapsed, setCollapsed] = useState<boolean>(!showAllDetails);
const [loadStickyHeader, setLoadStickyHeader] = useState<boolean>(false);

const appleRendering = /(ipad)/i.test(navigator.userAgent) || /(macintosh.*safari)/i.test(navigator.userAgent);

const { tab = "scenes" } = useParams<ITabParams>();

// Editing state
Expand Down Expand Up @@ -496,7 +498,7 @@ const TagPage: React.FC<IProps> = ({ tag }) => {
<div
className={`detail-header ${isEditing ? "edit" : ""} ${
collapsed ? "collapsed" : !compactExpandedDetails ? "full-width" : ""
}`}
} ${appleRendering ? "apple" : ""}`}
>
{maybeRenderHeaderBackgroundImage()}
<div className="detail-container">
Expand Down
19 changes: 16 additions & 3 deletions ui/v2.5/src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ dd {

.detail-header.edit {
background-color: unset;
overflow: auto;

form {
padding-top: 0.5rem;
Expand Down Expand Up @@ -241,7 +242,7 @@ dd {
}

.detail-item {
flex-direction: unset;
display: table;
padding-right: 0;
width: 100%;

Expand All @@ -251,7 +252,11 @@ dd {
}

.detail-item-value {
padding-left: 0.5rem;
margin-left: 1.5rem;
}

.detail-item-value.age {
width: 1.13rem;
}
}

Expand Down Expand Up @@ -336,7 +341,6 @@ dd {
}

.detail-item {
align-items: left;
display: inline-flex;
flex-direction: column;
padding-bottom: 0.5rem;
Expand All @@ -347,6 +351,15 @@ dd {
}
}

.detail-header.apple .detail-container {
display: flex;
}

.detail-header.full-width.apple .detail-header-image,
.detail-header.edit.apple .detail-header-image {
display: unset;
}

.detail-item-title {
color: #868791;
font-weight: 700;
Expand Down

0 comments on commit 632a1e0

Please sign in to comment.