diff --git a/ui/v2.5/src/components/Images/ImageDetails/ImageDetailPanel.tsx b/ui/v2.5/src/components/Images/ImageDetails/ImageDetailPanel.tsx index 65cce87de..a2044fcff 100644 --- a/ui/v2.5/src/components/Images/ImageDetails/ImageDetailPanel.tsx +++ b/ui/v2.5/src/components/Images/ImageDetails/ImageDetailPanel.tsx @@ -6,131 +6,135 @@ import { PerformerCard } from "src/components/Performers/PerformerCard"; import { sortPerformers } from "src/core/performers"; import { FormattedMessage, useIntl } from "react-intl"; import { PhotographerLink } from "src/components/Shared/Link"; +import { PatchComponent } from "../../../patch"; interface IImageDetailProps { image: GQL.ImageDataFragment; } -export const ImageDetailPanel: React.FC = (props) => { - const intl = useIntl(); +export const ImageDetailPanel: React.FC = PatchComponent( + "ImageDetailPanel", + (props) => { + const intl = useIntl(); - function renderDetails() { - if (!props.image.details) return; - return ( - <> -
- :{" "} -
-

{props.image.details}

- - ); - } + function renderDetails() { + if (!props.image.details) return; + return ( + <> +
+ :{" "} +
+

{props.image.details}

+ + ); + } - function renderTags() { - if (props.image.tags.length === 0) return; - const tags = props.image.tags.map((tag) => ( - - )); - return ( - <> -
- -
- {tags} - - ); - } + function renderTags() { + if (props.image.tags.length === 0) return; + const tags = props.image.tags.map((tag) => ( + + )); + return ( + <> +
+ +
+ {tags} + + ); + } - function renderPerformers() { - if (props.image.performers.length === 0) return; - const performers = sortPerformers(props.image.performers); - const cards = performers.map((performer) => ( - - )); + function renderPerformers() { + if (props.image.performers.length === 0) return; + const performers = sortPerformers(props.image.performers); + const cards = performers.map((performer) => ( + + )); + + return ( + <> +
+ +
+
+ {cards} +
+ + ); + } + + function renderGalleries() { + if (props.image.galleries.length === 0) return; + const galleries = props.image.galleries.map((gallery) => ( + + )); + return ( + <> +
+ +
+ {galleries} + + ); + } + + // filename should use entire row if there is no studio + const imageDetailsWidth = props.image.studio ? "col-9" : "col-12"; return ( <> -
- -
-
- {cards} +
+
+ {renderGalleries()} + { +
+ {" "} + :{" "} + {TextUtils.formatDateTime(intl, props.image.created_at)}{" "} +
+ } + { +
+ :{" "} + {TextUtils.formatDateTime(intl, props.image.updated_at)}{" "} +
+ } + {props.image.code && ( +
+ : {props.image.code}{" "} +
+ )} + {props.image.photographer && ( +
+ :{" "} + +
+ )} +
+
+
+
+ {renderDetails()} + {renderTags()} + {renderPerformers()} +
); } - - function renderGalleries() { - if (props.image.galleries.length === 0) return; - const galleries = props.image.galleries.map((gallery) => ( - - )); - return ( - <> -
- -
- {galleries} - - ); - } - - // filename should use entire row if there is no studio - const imageDetailsWidth = props.image.studio ? "col-9" : "col-12"; - - return ( - <> -
-
- {renderGalleries()} - { -
- {" "} - :{" "} - {TextUtils.formatDateTime(intl, props.image.created_at)}{" "} -
- } - { -
- :{" "} - {TextUtils.formatDateTime(intl, props.image.updated_at)}{" "} -
- } - {props.image.code && ( -
- : {props.image.code}{" "} -
- )} - {props.image.photographer && ( -
- :{" "} - -
- )} -
-
-
-
- {renderDetails()} - {renderTags()} - {renderPerformers()} -
-
- - ); -}; +); diff --git a/ui/v2.5/src/docs/en/Manual/UIPluginApi.md b/ui/v2.5/src/docs/en/Manual/UIPluginApi.md index 1357e86cc..7d267d1b1 100644 --- a/ui/v2.5/src/docs/en/Manual/UIPluginApi.md +++ b/ui/v2.5/src/docs/en/Manual/UIPluginApi.md @@ -151,6 +151,7 @@ Returns `void`. - `GallerySelect` - `GallerySelect.sort` - `Icon` +- `ImageDetailPanel` - `ModalSetting` - `MovieIDSelect` - `MovieSelect`