Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sofiahag committed Dec 10, 2023
1 parent b66ef3c commit c09595b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/components/Weather.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ const api = {
base: 'https://api.openweathermap.org/data/2.5/',
};

//TODO Clean up code

function Weather() {
const [query, setQuery] = useState('');
const [weather, setWeather] = useState({});
Expand Down Expand Up @@ -73,7 +75,7 @@ function Weather() {
};

const lottieStyles = {
marginTop: isMediumScreen ? '30%' : (isSmallScreen ? '55%' : '10%'),
marginTop: isMediumScreen ? '30%' : (isSmallScreen ? '55%' : '0%'),
};

useEffect(() => {
Expand Down Expand Up @@ -188,12 +190,12 @@ function Weather() {
</Box>
)}
{weather.weather[0].main === 'Thunderstorm' && (
<Box>
<Box style={lottieStyles}>
<Lottie animationData={lightning} loop />
</Box>
)}
{(weather.weather[0].main === 'Drizzle' || weather.weather[0].main === 'Rain') && (
<Box>
<Box style={lottieStyles}>
<Lottie animationData={rain} loop />
</Box>
)}
Expand All @@ -203,7 +205,7 @@ function Weather() {
</Box>
)}
{weather.weather[0].main === 'Snow' && (
<Box>
<Box style={lottieStyles}>
<Lottie animationData={snow} loop />
</Box>
)}
Expand Down

0 comments on commit c09595b

Please sign in to comment.