Slight refactor
This commit is contained in:
@@ -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>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user