MainLayout for theme persistence

This commit is contained in:
Sean Edmunds
2025-01-17 11:33:30 -06:00
parent f49895dee9
commit e7f5e94ed6
13 changed files with 150 additions and 77 deletions

View File

@@ -55,7 +55,7 @@ export function Homepage({ theme }: any) {
if (data) {
setDisplayedGreeting(greet(data));
}
}, [isFetching]);
}, [data, isFetching]);
useEffect(() => {
if (weather && basicWeather) {

View File

@@ -8,10 +8,10 @@ function Applications({ contentType, isMobile }: any) {
const { data, isFetching } = useQueryAPI({ endpoint: 'api/apps' });
const [applications, setApplications] = useState([]);
useEffect(() => {
if (!isFetching) {
if (data && !isFetching) {
setApplications(data);
}
}, [isFetching]);
}, [data, isFetching]);
return (
<>
{applications.length > 0 && contentType.length > 0 && (

View File

@@ -16,7 +16,6 @@ function Header({
weatherModalOpened,
closeWeatherModal,
openWeatherModal,
setValue,
setProviderLabel,
setProviderURL,
}: any) {
@@ -155,7 +154,6 @@ function Header({
hourly={hourly}
closeWeatherModal={closeWeatherModal}
weatherModalOpened={weatherModalOpened}
setValue={setValue}
setProviderLabel={setProviderLabel}
setProviderURL={setProviderURL}
isMobile={isMobile}

View File

@@ -2,6 +2,7 @@ import { Button, Menu, MultiSelect, NavLink } from '@mantine/core';
import { useQueryAPI } from 'hooks';
import { useEffect, useState } from 'react';
import { FiMenu, FiMonitor } from 'react-icons/fi';
import { useNavigate } from 'react-router-dom';
import { buttonClasses, menuClasses, navLinkClasses, selectClasses } from 'styles';
function SettingsButton({
@@ -12,7 +13,7 @@ function SettingsButton({
}: any) {
const { data, isFetched } = useQueryAPI({ endpoint: 'api/appCategories' });
const [categories, setCategories] = useState([{ value: 'All', label: 'All' }]);
const navigate = useNavigate();
useEffect(() => {
if (data) {
const list: [any] =
@@ -42,9 +43,9 @@ function SettingsButton({
<NavLink
label='Settings'
component='a'
href={`/${import.meta.env.VITE_BASE_URL}/settings`}
className={navLinkClasses.defaultNavLink}
classNames={navLinkClasses}
onClick={() => navigate(`/${import.meta.env.VITE_BASE_URL}/settings`)}
/>
<NavLink
label='Quick Actions'