Name | Progress |
---|---|
Course outline | Not Read |
Name | Progress |
---|---|
Key Concepts | Not Read |
Project: Pet Parade | Not Read |
Challenge 1 | Not Attempted |
Quiz 1 | Not Attempted |
Name | Progress |
---|---|
Project: Profile Card Creator | Not Read |
Key Concepts | Not Read |
Challenge 2 | Not Attempted |
Quiz 2 | Not Attempted |
Name | Progress |
---|---|
Key Concepts | Not Read |
Project: Magic Garden | Not Read |
Challenge 3 | Not Attempted |
Quiz 3 | Not Attempted |
Name | Progress |
---|---|
Key Concepts | Not Read |
Project: "Interactive Quiz App" | Not Read |
Challenge 5 | Not Attempted |
Quiz 5 | Not Attempted |
Name | Progress |
---|---|
Key Concepts | Not Read |
Project: "Photo Gallery" | Not Read |
Challenge 6 | Not Attempted |
Quiz 6 | Not Attempted |
Name | Progress |
---|---|
Key Concepts | Not Read |
Project: "Registration Form" | Not Read |
Challenge 7 | Not Read |
Quiz 7 | Not Attempted |
Name | Progress |
---|---|
Key Concepts | Not Read |
Project: "Weather Dashboard" | Not Read |
Challenge 8 | Not Attempted |
Quiz 8 | Not Attempted |
Objective: Create an application that recommends clothing based on the weather conditions.
Description: In this project, you will build a simple application that shows different clothing recommendations based on the current weather conditions. The app will render different outfits for sunny, rainy, snowy, and windy weather.
Instructions:
Example Code:
import React, { useState } from 'react';
import './WeatherWardrobe.css';
function WeatherWardrobe() {
const [weather, setWeather] = useState('sunny');
let outfit;
if (weather === 'sunny') {
outfit = <div className="outfit">๐ Wear sunglasses and a t-shirt!</div>;
} else if (weather === 'rainy') {
outfit = <div className="outfit">๐ง๏ธ Don't forget your umbrella and raincoat!</div>;
} else if (weather === 'snowy') {
outfit = <div className="outfit">โ๏ธ Bundle up with a warm coat and gloves!</div>;
} else if (weather === 'windy') {
outfit = <div className="outfit">๐ฌ๏ธ A windbreaker and scarf will keep you cozy!</div>;
}
return (
<div className="weather-wardrobe">
<h1>Weather Wardrobe</h1>
<div className="outfit-container">
{outfit}
</div>
</div>
);
}
export default WeatherWardrobe;
Styling (WeatherWardrobe.css):
.weather-wardrobe {
text-align: center;
font-family: Arial, sans-serif;
}
.outfit-container {
margin-top: 20px;
}
.outfit {
font-size: 24px;
margin-top: 20px;
}
By completing this project, you'll get hands-on experience with conditional rendering in React, making your learning experience both fun and practical.