From fb8ef34ffe6144d62892006cd2db31f464c7b9c8 Mon Sep 17 00:00:00 2001 From: Dion Date: Thu, 14 Dec 2023 16:50:02 +0100 Subject: [PATCH] move content --- .../item-list-view/item-list-view.tsx | 22 ------------------- .../shared/warning-box-no-photos-filter.tsx | 20 ++++++++++++++++- 2 files changed, 19 insertions(+), 23 deletions(-) diff --git a/starsky/starsky/clientapp/src/components/molecules/item-list-view/item-list-view.tsx b/starsky/starsky/clientapp/src/components/molecules/item-list-view/item-list-view.tsx index f3336c0291..6e63062706 100644 --- a/starsky/starsky/clientapp/src/components/molecules/item-list-view/item-list-view.tsx +++ b/starsky/starsky/clientapp/src/components/molecules/item-list-view/item-list-view.tsx @@ -1,13 +1,9 @@ import React, { memo, useEffect } from "react"; -import useGlobalSettings from "../../../hooks/use-global-settings"; import useLocation from "../../../hooks/use-location/use-location"; import { PageType } from "../../../interfaces/IDetailView"; import { IFileIndexItem } from "../../../interfaces/IFileIndexItem"; import { INavigateState } from "../../../interfaces/INavigateState"; -import localization from "../../../localization/localization.json"; -import { Language } from "../../../shared/language"; import { URLPath } from "../../../shared/url-path"; -import { UrlQuery } from "../../../shared/url-query"; import FlatListItem from "../../atoms/flat-list-item/flat-list-item"; import ListImageChildItem from "../../atoms/list-image-child-item/list-image-child-item"; import ListImageViewSelectContainer from "../list-image-view-select-container/list-image-view-select-container"; @@ -29,16 +25,6 @@ const ItemListView: React.FunctionComponent = memo((props) => { const history = useLocation(); const folderRef = React.useRef(null); - // Content - const settings = useGlobalSettings(); - const language = new Language(settings.language); - const MessageNoPhotosInFolder = language.key( - localization.MessageNoPhotosInFolder - ); - const MessageNewUserNoPhotosInFolder = language.key( - localization.MessageNewUserNoPhotosInFolder - ); - useEffect(() => { const navigationState = history.location.state as INavigateState; @@ -82,14 +68,6 @@ const ItemListView: React.FunctionComponent = memo((props) => { colorClassUsage={props.colorClassUsage} /> - {props.pageType !== PageType.Loading && - items.length === 0 && - props.subPath === "/" ? ( - - {MessageNewUserNoPhotosInFolder} {MessageNoPhotosInFolder} - - ) : null} - {items.map((item) => ( + {MessageNewUserNoPhotosInFolder} {MessageNoPhotosInFolder} + + ); + } + return <>{warningBox}; });