From b7ca08b00867fccf1c9abb94966532170fc0a1a4 Mon Sep 17 00:00:00 2001 From: PhilReact Date: Sat, 14 Dec 2024 18:28:00 +0200 Subject: [PATCH] added 'all' category for qapps --- src/components/Apps/AppInfoSnippet.tsx | 6 ++- src/components/Apps/AppsCategoryDesktop.tsx | 12 ++++-- src/components/Apps/AppsLibraryDesktop.tsx | 43 ++++++++++++++++++--- 3 files changed, 50 insertions(+), 11 deletions(-) diff --git a/src/components/Apps/AppInfoSnippet.tsx b/src/components/Apps/AppInfoSnippet.tsx index 01a7083..f141222 100644 --- a/src/components/Apps/AppInfoSnippet.tsx +++ b/src/components/Apps/AppInfoSnippet.tsx @@ -22,7 +22,7 @@ import { useRecoilState, useSetRecoilState } from "recoil"; import { settingsLocalLastUpdatedAtom, sortablePinnedAppsAtom } from "../../atoms/global"; import { saveToLocalStorage } from "./AppsNavBar"; -export const AppInfoSnippet = ({ app, myName, isFromCategory }) => { +export const AppInfoSnippet = ({ app, myName, isFromCategory, parentStyles = {} }) => { const isInstalled = app?.status?.status === 'READY' const [sortablePinnedApps, setSortablePinnedApps] = useRecoilState(sortablePinnedAppsAtom); @@ -30,7 +30,9 @@ export const AppInfoSnippet = ({ app, myName, isFromCategory }) => { const isSelectedAppPinned = !!sortablePinnedApps?.find((item)=> item?.name === app?.name && item?.service === app?.service) const setSettingsLocalLastUpdated = useSetRecoilState(settingsLocalLastUpdatedAtom); return ( - + { + if(category?.id === 'all') return availableQapps return availableQapps.filter( (app) => app?.metadata?.category === category?.id ); @@ -133,6 +134,9 @@ export const AppsCategoryDesktop = ({ app={app} myName={myName} isFromCategory={true} + parentStyles={{ + padding: '0px 10px' + }} /> ); }; @@ -206,7 +210,7 @@ export const AppsCategoryDesktop = ({ diff --git a/src/components/Apps/AppsLibraryDesktop.tsx b/src/components/Apps/AppsLibraryDesktop.tsx index 9756d1b..aae46a5 100644 --- a/src/components/Apps/AppsLibraryDesktop.tsx +++ b/src/components/Apps/AppsLibraryDesktop.tsx @@ -24,7 +24,7 @@ import { PublishQAppCTARight, PublishQAppDotsBG, } from "./Apps-styles"; -import { Avatar, Box, ButtonBase, InputBase, styled } from "@mui/material"; +import { Avatar, Box, ButtonBase, InputBase, Typography, styled } from "@mui/material"; import { Add } from "@mui/icons-material"; import { MyContext, getBaseApiReact } from "../../App"; import LogoSelected from "../../assets/svgs/LogoSelected.svg"; @@ -145,6 +145,9 @@ export const AppsLibraryDesktop = ({ key={`${app?.service}-${app?.name}`} app={app} myName={myName} + parentStyles={{ + padding: '0px 10px' + }} /> ); }; @@ -261,7 +264,7 @@ export const AppsLibraryDesktop = ({ + ) : searchedList?.length === 0 && debouncedValue ? ( + + No results + ) : ( <> + { + executeEvent("selectedCategory", { + data: { + id: 'all', + name: 'All' + }, + }); + }} + > + + All + + {categories?.map((category) => { return (