Skip to content

Commit e2a571b

Browse files
committed
css upgrade
1 parent c1336e5 commit e2a571b

File tree

5 files changed

+72
-52
lines changed

5 files changed

+72
-52
lines changed

lessons/03-tools/E-vite.md

+3
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ Now let's set up our scripts to start Vite. In package.json, put:
6969

7070
Be sure to also add `"type: module"` to your package.json. Vite has deprecated support for Common.js and now requires you to use ESM style modules.
7171

72+
> Note: you will get a warning from Vite like `Files in the public directory are served at the root path.
73+
Instead of /public/style.css, use /style.css.` – ignore this, we'll fix it in a bit.
74+
7275
`dev` will start the development server, typically on [http://localhost:5173/](). `build` will prepare static files to be deployed (to somewhere like GitHub Pages, Vercel, Netlify, AWS S3, etc.) `preview` lets you preview your production build locally.
7376

7477
> Do note that we've changed domains here. By default Vite uses localhost:5173. Fun fact, 5173 sort of spells VITE if you make the 5 its Roman Numeral version, V.

lessons/04-core-react-concepts/A-jsx.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Make a new file called Pizza.jsx.
1414
```javascript
1515
const Pizza = (props) => {
1616
return (
17-
<div>
17+
<div className="pizza">
1818
<h1>{props.name}</h1>
1919
<p>{props.description}</p>
2020
</div>

lessons/04-core-react-concepts/B-hooks.md

+52-37
Original file line numberDiff line numberDiff line change
@@ -9,50 +9,65 @@ import Pizza from "./Pizza";
99

1010
export default function Order() {
1111
const pizzaType = "pepperoni";
12-
const pizzaSize = "medium";
12+
const pizzaSize = "M";
1313
return (
1414
<div className="order">
15+
<h2>Create Order</h2>
1516
<form>
1617
<div>
17-
<label htmlFor="pizza-type">Pizza Type</label>
18-
<select name="pizza-type" value={pizzaType}>
19-
<option value="pepperoni">The Pepperoni Pizza</option>
20-
<option value="hawaiian">The Hawaiian Pizza</option>
21-
<option value="big_meat">The Big Meat Pizza</option>
22-
</select>
23-
</div>
24-
<div>
25-
<label htmlFor="pizza-size">Pizza Type</label>
2618
<div>
27-
<input
28-
checked={pizzaSize === "small"}
29-
type="radio"
30-
name="pizza-size"
31-
value="small"
32-
/>
33-
<label>Small</label>
34-
<input
35-
checked={pizzaSize === "medium"}
36-
type="radio"
37-
name="pizza-size"
38-
value="medium"
39-
/>
40-
<label>Medium</label>
41-
<input
42-
checked={pizzaSize === "large"}
43-
type="radio"
44-
name="pizza-size"
45-
value="large"
46-
/>
47-
<label>Large</label>
19+
<label htmlFor="pizza-type">Pizza Type</label>
20+
<select name="pizza-type" value={pizzaType}>
21+
<option value="pepperoni">The Pepperoni Pizza</option>
22+
<option value="hawaiian">The Hawaiian Pizza</option>
23+
<option value="big_meat">The Big Meat Pizza</option>
24+
</select>
4825
</div>
26+
<div>
27+
<label htmlFor="pizza-size">Pizza Type</label>
28+
<div>
29+
<span>
30+
<input
31+
checked={pizzaSize === "S"}
32+
type="radio"
33+
name="pizza-size"
34+
value="S"
35+
id="pizza-s"
36+
/>
37+
<label htmlFor="pizza-s">Small</label>
38+
</span>
39+
<span>
40+
<input
41+
checked={pizzaSize === "M"}
42+
type="radio"
43+
name="pizza-size"
44+
value="M"
45+
id="pizza-m"
46+
/>
47+
<label htmlFor="pizza-m">Medium</label>
48+
</span>
49+
<span>
50+
<input
51+
checked={pizzaSize === "L"}
52+
type="radio"
53+
name="pizza-size"
54+
value="L"
55+
id="pizza-l"
56+
/>
57+
<label htmlFor="pizza-l">Large</label>
58+
</span>
59+
</div>
60+
</div>
61+
<button type="submit">Add to Cart</button>
62+
</div>
63+
<div className="order-pizza">
64+
<Pizza
65+
name="Pepperoni"
66+
description="Mozzarella Cheese, Pepperoni"
67+
image="/public/pizzas/pepperoni.webp"
68+
/>
69+
<p>$13.37</p>
4970
</div>
50-
<Pizza
51-
name="Pepperoni"
52-
description="Mozzarella Cheese, Pepperoni"
53-
image="/public/pizzas/pepperoni.webp"
54-
/>
55-
<button type="submit">Add to Cart</button>
5671
</form>
5772
</div>
5873
);

lessons/04-core-react-concepts/C-effects.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ useEffect(() => {
3737
}, []);
3838

3939
async function fetchPizzaTypes() {
40-
await new Promise((resolve) => setTimeout(resolve, 3000));
40+
await new Promise((resolve) => setTimeout(resolve, 3000)); // remove this later, just to show you the loading state
4141

4242
const pizzasRes = await fetch("/api/pizzas");
4343
const pizzasJson = await pizzasRes.json();

lessons/04-core-react-concepts/E-custom-hooks.md

+15-13
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,22 @@ const PizzaOfTheDay = () => {
2121
}
2222

2323
return (
24-
<div>
25-
<div className="pizza-of-the-day-info">
26-
<h2>Pizza of the Day</h2>
27-
<h3>{pizzaOfTheDay.name}</h3>
28-
<p>{pizzaOfTheDay.description}</p>
24+
<div className="pizza-of-the-day">
25+
<h2>Pizza of the Day</h2>
26+
<div>
27+
<div className="pizza-of-the-day-info">
28+
<h3>{pizzaOfTheDay.name}</h3>
29+
<p>{pizzaOfTheDay.description}</p>
30+
<p className="pizza-of-the-day-price">
31+
From: <span>{intl.format(pizzaOfTheDay.sizes.S)}</span>
32+
</p>
33+
</div>
34+
<img
35+
className="pizza-of-the-day-image"
36+
src={pizzaOfTheDay.image}
37+
alt={pizzaOfTheDay.name}
38+
/>
2939
</div>
30-
<img
31-
className="pizza-of-the-day-image"
32-
src={pizzaOfTheDay.image}
33-
alt={pizzaOfTheDay.name}
34-
/>
35-
<p className="pizza-of-the-day-price">
36-
From: <span>{intl.format(pizzaOfTheDay.sizes.S)}</span>
37-
</p>
3840
</div>
3941
);
4042
};

0 commit comments

Comments
 (0)