From 7cff998516ad50e0dbbe33d0548e3632d11c5309 Mon Sep 17 00:00:00 2001 From: Herpes3000 <61895715+randemgame@users.noreply.github.com> Date: Mon, 11 Nov 2024 17:05:16 +0200 Subject: [PATCH] prettier --- .../components/Scenes/SceneDetails/Scene.tsx | 19 +++++++----- ui/v2.5/src/components/Scenes/styles.scss | 7 +++-- .../components/Shared/GridCard/GridCard.tsx | 31 +++++++++---------- .../components/Shared/GridCard/styles.scss | 6 ++-- .../src/components/Shared/TitleDisplay.tsx | 15 +++++---- ui/v2.5/src/utils/form.tsx | 6 +++- 6 files changed, 47 insertions(+), 37 deletions(-) diff --git a/ui/v2.5/src/components/Scenes/SceneDetails/Scene.tsx b/ui/v2.5/src/components/Scenes/SceneDetails/Scene.tsx index ab7566faed1..ca9758820f6 100644 --- a/ui/v2.5/src/components/Scenes/SceneDetails/Scene.tsx +++ b/ui/v2.5/src/components/Scenes/SceneDetails/Scene.tsx @@ -50,7 +50,7 @@ import { useRatingKeybinds } from "src/hooks/keybinds"; import { lazyComponent } from "src/utils/lazyComponent"; import cx from "classnames"; import { TruncatedText } from "src/components/Shared/TruncatedText"; -import { TitleDisplay } from 'src/components/Shared/TitleDisplay'; +import { TitleDisplay } from "src/components/Shared/TitleDisplay"; const SubmitStashBoxDraft = lazyComponent( () => import("src/components/Dialogs/SubmitDraft") @@ -584,12 +584,17 @@ const ScenePage: React.FC = ({ )} -

- } - /> -

+

+ + } + /> +

diff --git a/ui/v2.5/src/components/Scenes/styles.scss b/ui/v2.5/src/components/Scenes/styles.scss index 24f0f4d89c4..792335d867e 100644 --- a/ui/v2.5/src/components/Scenes/styles.scss +++ b/ui/v2.5/src/components/Scenes/styles.scss @@ -899,12 +899,13 @@ input[type="range"].blue-slider { word-break: break-all; } } + .title-display { width: 100%; - + br { - display: block; content: ""; + display: block; margin: 2px 0; } -} \ No newline at end of file +} diff --git a/ui/v2.5/src/components/Shared/GridCard/GridCard.tsx b/ui/v2.5/src/components/Shared/GridCard/GridCard.tsx index 3d469ee7af9..e1901a0fb78 100644 --- a/ui/v2.5/src/components/Shared/GridCard/GridCard.tsx +++ b/ui/v2.5/src/components/Shared/GridCard/GridCard.tsx @@ -13,7 +13,7 @@ import useResizeObserver from "@react-hook/resize-observer"; import { Icon } from "../Icon"; import { faGripLines } from "@fortawesome/free-solid-svg-icons"; import { DragSide, useDragMoveSelect } from "./dragMoveSelect"; -import { TitleDisplay } from 'src/components/Shared/TitleDisplay'; +import { TitleDisplay } from "src/components/Shared/TitleDisplay"; interface ICardProps { className?: string; @@ -227,22 +227,19 @@ export const GridCard: React.FC = (props: ICardProps) => { {maybeRenderInteractiveHeatmap()}
-
- {props.pretitleIcon} - - ) : ( - props.title - ) - } - lineCount={2} - /> -
+
+ {props.pretitleIcon} + + ) : ( + props.title + ) + } + lineCount={2} + /> +
{props.details}
diff --git a/ui/v2.5/src/components/Shared/GridCard/styles.scss b/ui/v2.5/src/components/Shared/GridCard/styles.scss index ec678a9fa6c..47789da3d55 100644 --- a/ui/v2.5/src/components/Shared/GridCard/styles.scss +++ b/ui/v2.5/src/components/Shared/GridCard/styles.scss @@ -85,10 +85,10 @@ .title-display { width: 100%; - + br { - display: block; content: ""; + display: block; margin: 2px 0; } -} \ No newline at end of file +} diff --git a/ui/v2.5/src/components/Shared/TitleDisplay.tsx b/ui/v2.5/src/components/Shared/TitleDisplay.tsx index 147a5efe3d7..1f60b2a3a63 100644 --- a/ui/v2.5/src/components/Shared/TitleDisplay.tsx +++ b/ui/v2.5/src/components/Shared/TitleDisplay.tsx @@ -1,21 +1,24 @@ -import React from 'react'; +import React from "react"; interface ITitleDisplayProps { text: string; className?: string; } -export const TitleDisplay: React.FC = ({ text, className }) => { +export const TitleDisplay: React.FC = ({ + text, + className, +}) => { if (!text) return null; - + return (
- {text.split('\n').map((line, i) => ( + {text.split("\n").map((line, i) => ( {line} - {i < text.split('\n').length - 1 &&
} + {i < text.split("\n").length - 1 &&
}
))}
); -}; \ No newline at end of file +}; diff --git a/ui/v2.5/src/utils/form.tsx b/ui/v2.5/src/utils/form.tsx index e856853d586..316b1f328aa 100644 --- a/ui/v2.5/src/utils/form.tsx +++ b/ui/v2.5/src/utils/form.tsx @@ -189,7 +189,11 @@ export function formikUtils( props?: IProps ) { const title = intl.formatMessage({ id: messageID }); - const control = renderFormControl(field, field === "title" ? "textarea" : type, title); + const control = renderFormControl( + field, + field === "title" ? "textarea" : type, + title + ); return renderField(field, title, control, props); }