Skip to content
Snippets Groups Projects
Commit 5ff3aa63 authored by JYCHOI's avatar JYCHOI
Browse files

modify state selection using array.map()

parent 9fb7403e
Branches
No related tags found
No related merge requests found
Source diff could not be displayed: it is too large. Options to address this: view the blob.
......@@ -6,6 +6,8 @@ const App = (props) => {
let [showProduct, setShowProduct] = useState(true);
let [order, setOrder] = useState({firstName : '', lastName : '', state : 'CA', address: ''});
let states = ['AL', 'AR', 'CA', 'NV', 'NY', 'FL'];
let product = {
id: 1001,
title: "고양이 사료, 25파운드",
......@@ -109,23 +111,17 @@ const App = (props) => {
</div>
<div className="form-group">
<div className="col-md-2"> <strong>:</strong>
<div className="col-md-12"> <strong>:</strong>
<select className="form-control" name="state" value={order.state} onChange={updateOrder}>
<option disabled value=""></option>
<option>AL</option>
<option>AR</option>
<option>CA</option>
<option>NV</option>
{states.map((st) => <option value={st}> {st}</option>)}
</select>
</div>
</div>
<div className="form-group">
<div className="col-md-6 boxes">
{/* <div className="col-md-12"> */}
<input type="checkbox" name="gift" id="gift" value={true} onChange={updateOrder}/>
<label htmlFor="gift">선물로 보내기?</label>
{/* </div> */}
</div>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment