MainLayout for theme persistence
This commit is contained in:
@@ -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 && (
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user