Skip to content

Commit

Permalink
Details redesign bug fixes (#3982)
Browse files Browse the repository at this point in the history
* setting page top padding
* better age tooltip full width fix with table improvment
  • Loading branch information
cj12312021 authored Aug 1, 2023
1 parent 2cf0841 commit 29fb570
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 9 deletions.
5 changes: 4 additions & 1 deletion 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 { isPlatformUniquelyRenderedByApple } from "src/utils/apple";

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 = isPlatformUniquelyRenderedByApple();

const defaultImage =
movie.front_image_path && movie.front_image_path.includes("default=true")
? true
Expand Down Expand Up @@ -414,7 +417,7 @@ const MoviePage: React.FC<IProps> = ({ movie }) => {
<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 @@ -43,6 +43,7 @@ import { faInstagram, faTwitter } from "@fortawesome/free-brands-svg-icons";
import { IUIConfig } from "src/core/config";
import { useRatingKeybinds } from "src/hooks/keybinds";
import ImageUtils from "src/utils/image";
import { isPlatformUniquelyRenderedByApple } from "src/utils/apple";

interface IProps {
performer: GQL.PerformerDataFragment;
Expand Down Expand Up @@ -72,6 +73,8 @@ const PerformerPage: React.FC<IProps> = ({ performer }) => {
const [encodingImage, setEncodingImage] = useState<boolean>(false);
const [loadStickyHeader, setLoadStickyHeader] = useState<boolean>(false);

const appleRendering = isPlatformUniquelyRenderedByApple();

const activeImage = useMemo(() => {
const performerImage = performer.image_path;
if (isEditing) {
Expand Down Expand Up @@ -546,7 +549,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
5 changes: 4 additions & 1 deletion ui/v2.5/src/components/Studios/StudioDetails/Studio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import TextUtils from "src/utils/text";
import { RatingSystem } from "src/components/Shared/Rating/RatingSystem";
import ImageUtils from "src/utils/image";
import { useRatingKeybinds } from "src/hooks/keybinds";
import { isPlatformUniquelyRenderedByApple } from "src/utils/apple";

interface IProps {
studio: GQL.StudioDataFragment;
Expand All @@ -68,6 +69,8 @@ const StudioPage: React.FC<IProps> = ({ studio }) => {
const [collapsed, setCollapsed] = useState<boolean>(!showAllDetails);
const [loadStickyHeader, setLoadStickyHeader] = useState<boolean>(false);

const appleRendering = isPlatformUniquelyRenderedByApple();

// Editing state
const [isEditing, setIsEditing] = useState<boolean>(false);
const [isDeleteAlertOpen, setIsDeleteAlertOpen] = useState<boolean>(false);
Expand Down Expand Up @@ -504,7 +507,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
5 changes: 4 additions & 1 deletion ui/v2.5/src/components/Tags/TagDetails/Tag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import {
} from "@fortawesome/free-solid-svg-icons";
import { IUIConfig } from "src/core/config";
import ImageUtils from "src/utils/image";
import { isPlatformUniquelyRenderedByApple } from "src/utils/apple";

interface IProps {
tag: GQL.TagDataFragment;
Expand All @@ -63,6 +64,8 @@ const TagPage: React.FC<IProps> = ({ tag }) => {
const [collapsed, setCollapsed] = useState<boolean>(!showAllDetails);
const [loadStickyHeader, setLoadStickyHeader] = useState<boolean>(false);

const appleRendering = isPlatformUniquelyRenderedByApple();

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

// Editing state
Expand Down Expand Up @@ -496,7 +499,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
30 changes: 26 additions & 4 deletions ui/v2.5/src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ body {
-webkit-font-smoothing: antialiased;
margin: 0;
overflow-x: hidden;
padding: 3.5rem 0 0 0;
padding: 4rem 0 0 0;

@include media-breakpoint-down(xs) {
@media (orientation: portrait) {
Expand All @@ -52,6 +52,13 @@ body {
}
}

#movie-page,
#performer-page,
#studio-page,
#tag-page {
margin-top: -0.5rem;
}

code,
.code {
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
Expand Down Expand Up @@ -188,6 +195,7 @@ dd {

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

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

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

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

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

.detail-item-value.age {
width: fit-content;
}
}

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

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

/* the .apple class denotes areas where rendering on some apple platforms has been inconsistent with other platforms
these rules aim to address those inconsistences */
.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
6 changes: 6 additions & 0 deletions ui/v2.5/src/utils/apple.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export function isPlatformUniquelyRenderedByApple() {
return (
/(ipad)/i.test(navigator.userAgent) ||
/(macintosh.*safari)/i.test(navigator.userAgent)
);
}

0 comments on commit 29fb570

Please sign in to comment.