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,25 +1,20 @@
import { Group, Stack, Text } from '@mantine/core';
import { WeatherModal } from 'components';
import { useCommonHooks } from 'hooks';
import { useEffect, useState } from 'react';
import { textClasses } from 'styles';
function Header({
greet,
date,
isMobile,
current,
setCurrent,
weather,
basicWeather,
outlook,
hourly,
weatherModalOpened,
closeWeatherModal,
openWeatherModal,
setProviderLabel,
setProviderURL,
setValue,
}: any) {
const { isMobile, weather, basicWeather } = useCommonHooks();
const [time, setTime] = useState(new Date());
function fixDigits(k: any) {
if (k < 10) {
@@ -80,7 +75,7 @@ function Header({
<Text
className={textClasses.greeting}
classNames={textClasses}
fz={isMobile && 24}
fz={isMobile ? 24 : undefined}
>
{greet}
</Text>
@@ -152,13 +147,8 @@ function Header({
<WeatherModal
current={current}
outlook={outlook}
hourly={hourly}
closeWeatherModal={closeWeatherModal}
weatherModalOpened={weatherModalOpened}
setProviderLabel={setProviderLabel}
setProviderURL={setProviderURL}
setValue={setValue}
isMobile={isMobile}
/>
</Stack>
);