-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathApp.js
35 lines (29 loc) · 839 Bytes
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import React, { useState } from 'react';
import 'bootstrap/dist/css/bootstrap.min.css';
import './App.scss';
import { Container, Row, Col } from 'react-bootstrap';
import { PizzaCard } from './components/PizzaCard';
import { Confirmation } from './components/Confirmation';
import pizzas from './data';
function App() {
const [ordered, setOrdered] = useState(false);
function displayConfirmation() {
setOrdered(true);
setTimeout(() => {
setOrdered(false);
}, 3000);
}
return (
<Container>
{ordered && <Confirmation toggle={setOrdered} />}
<Row>
{pizzas.map(data => (
<Col xs={3} className="mb-5" key={`${data.id}`}>
<PizzaCard data={data} setOrdered={displayConfirmation} />
</Col>
))}
</Row>
</Container>
);
}
export default App;