Standardized

This commit is contained in:
Sean Edmunds
2025-01-30 17:00:26 -06:00
parent cfdb1b2b4f
commit 9430db990b
20 changed files with 89 additions and 80 deletions

View File

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

View File

@@ -12,8 +12,9 @@ function Links({ contentType }: any) {
endpoint: 'api/categories',
});
const [bookmarkData, setBookmarkData] = useState<any>([]);
const [groups, setGroups] = useState([]);
const { isMobile } = useCommonHooks();
useEffect(() => {
if (linkData && linksIsFetched) {
setBookmarkData(linkData);
@@ -28,7 +29,6 @@ function Links({ contentType }: any) {
setGroups(groupList);
}
}, [groupData, groupsIsFetched]);
const { isMobile } = useCommonHooks();
return (
<>

View File

@@ -20,10 +20,10 @@ function Header({
const { data: personal, isFetched: personalIsFetched } = useQueryAPI({
endpoint: 'api/personalData',
});
const [personalData, setPersonalData] = useState<any>([]);
const { isMobile } = useCommonHooks();
const [time, setTime] = useState(new Date());
const { isMobile } = useCommonHooks();
function fixDigits(k: any) {
if (k < 10) {
return `0${k}`;
@@ -68,6 +68,7 @@ function Header({
});
}
}, [weather, basicWeather]);
return (
<Stack
style={{

View File

@@ -16,15 +16,9 @@ export default function Search({
const { data: providers, isFetched: providersIsFetched } = useQueryAPI({
endpoint: 'api/providers',
});
const [providerData, setProviderData] = useState<any>([]);
useEffect(() => {
if (providers && providersIsFetched) {
setProviderData(providers);
}
}, [providers, providersIsFetched]);
const [providerModalOpened, { open: openProviderModal, close: closeProviderModal }] =
useDisclosure(false);
const {
providerLabel,
setProviderLabel,
@@ -34,9 +28,6 @@ export default function Search({
setSearchValue,
} = useCommonHooks();
const [providerModalOpened, { open: openProviderModal, close: closeProviderModal }] =
useDisclosure(false);
const handleKeyPress = (item: any) => {
let option = '';
let subtext = '';
@@ -78,6 +69,12 @@ export default function Search({
}
};
useEffect(() => {
if (providers && providersIsFetched) {
setProviderData(providers);
}
}, [providers, providersIsFetched]);
return (
<Stack
style={{

View File

@@ -34,10 +34,14 @@ function SettingsButton() {
const { data: allThemes, isFetched: isAllThemesFetched } = useQueryAPI({
endpoint: 'api/themes',
});
const [allThemeData, setAllThemeData] = useState<any>([]);
const { mutateAsync: wakeRequest } = useMutationAPI();
const [allThemeData, setAllThemeData] = useState<any>([]);
const [categories, setCategories] = useState([{ value: 'All', label: 'All' }]);
const [selectedClient, setSelectedClient] = useState<any>(wolClients?.[0]);
const [overlayOpened, setOverlayOpened] = useState(false);
const navigate = useNavigate();
const notify = (notification: any) => toast(notification, { position: 'bottom-right' });
const {
currentTheme,
setCurrentTheme,
@@ -50,10 +54,6 @@ function SettingsButton() {
isMobile,
} = useCommonHooks();
const notify = (notification: any) => toast(notification, { position: 'bottom-right' });
const [selectedClient, setSelectedClient] = useState<any>(wolClients?.[0]);
const [overlayOpened, setOverlayOpened] = useState(false);
const handleWakeRequest = () => {
wakeRequest({
method: 'POST',