Slight refactor

This commit is contained in:
Sean Edmunds
2025-01-17 16:16:31 -06:00
parent eef30a84e3
commit 265981bee7
27 changed files with 398 additions and 352 deletions

View File

@@ -1,20 +1,13 @@
import { Stack, Text } from '@mantine/core';
import { useQueryAPI } from 'hooks';
import { useEffect, useState } from 'react';
import { useCommonHooks } from 'hooks';
import { textClasses } from 'styles';
import AppItem from './AppItem';
function Applications({ contentType, isMobile }: any) {
const { data, isFetching } = useQueryAPI({ endpoint: 'api/apps' });
const [applications, setApplications] = useState([]);
useEffect(() => {
if (data && !isFetching) {
setApplications(data);
}
}, [data, isFetching]);
function Applications({ contentType }: any) {
const { isMobile, applicationData } = useCommonHooks();
return (
<>
{applications.length > 0 && contentType.length > 0 && (
{applicationData.length > 0 && contentType.length > 0 && (
<Stack id='apps' style={{ gap: 0 }}>
<Text className={textClasses.sectionTitle} classNames={textClasses}>
Applications
@@ -32,7 +25,7 @@ function Applications({ contentType, isMobile }: any) {
paddingBottom: 'var(--module-spacing)',
}}
>
{applications?.map((application: any) => {
{applicationData?.map((application: any) => {
if (
contentType.includes(application.filterName) ||
contentType.includes('All')
@@ -44,7 +37,6 @@ function Applications({ contentType, isMobile }: any) {
url={application.url}
icon={application.icon}
category={application.category}
isMobile={isMobile}
/>
);
})}