Commit 4fb36f66 authored by Lee SeoYeon's avatar Lee SeoYeon
Browse files

.

parent d88a9d19
This diff is collapsed.
...@@ -6,6 +6,7 @@ import { Container, Form, Row, Col, Card, Image, InputGroup, FormControl, Button ...@@ -6,6 +6,7 @@ import { Container, Form, Row, Col, Card, Image, InputGroup, FormControl, Button
import Paginations from './pagination.js'; import Paginations from './pagination.js';
import { addFavorite } from './Bookmark.js' import { addFavorite } from './Bookmark.js'
function Search(props) { function Search(props) {
const endPage = 10; const endPage = 10;
const [state, setState] = useState(false); const [state, setState] = useState(false);
...@@ -19,7 +20,7 @@ function Search(props) { ...@@ -19,7 +20,7 @@ function Search(props) {
setMobile(true) setMobile(true)
} else { } else {
setMobile(false) setMobile(false)
} }
}, []); }, []);
const places = [{ const places = [{
...@@ -449,65 +450,93 @@ function Search(props) { ...@@ -449,65 +450,93 @@ function Search(props) {
return page return page
} }
function addicon() {
const [show, setShow] = useState(false);
const handleClose = () => setShow(false);
const handleShow = () => setShow(true);
const pagePlace = paginate(places, index)
return ( const pagePlace = paginate(places, index)
<Container >
<Link to="/" className="d-flex justify-content-center"><Image src={ohuh} /></Link>
<Row className="mb-2" className="d-flex justify-content-center"> return (
<Form style={{ width: "90vw" }} onSubmit={handleSubmit}> <Container >
<InputGroup size="lg"> <Link to="/" className="d-flex justify-content-center"><Image src={ohuh} /></Link>
<Link to="/"> <Row className="mb-2" className="d-flex justify-content-center">
<Col> <Form style={{ width: "90vw" }} onSubmit={handleSubmit}>
{/* <Image src={ohuh} fluid width="130px" /> */} <InputGroup size="lg">
</Col> <Link to="/">
</Link> <Col>
<FormControl {/* <Image src={ohuh} fluid width="130px" /> */}
placeholder="검색어를 입력하세요." </Col>
value={search} </Link>
aria-label="Large" <FormControl
aria-describedby="inputGroup-sizing-sm" placeholder="검색어를 입력하세요."
onChange={handleChange} value={search}
/> aria-label="Large"
<InputGroup.Append> aria-describedby="inputGroup-sizing-sm"
<Button type="submit" variant="outline-secondary" style={{ maxHeight: "8vh", maxWidth: "14vh" }} >검색</Button> onChange={handleChange}
</InputGroup.Append> />
</InputGroup> <InputGroup.Append>
</Form> <Button type="submit" variant="outline-secondary" style={{ maxHeight: "8vh", maxWidth: "14vh" }} >검색</Button>
</Row> </InputGroup.Append>
<Row className="d-flex flex-wrap"> </InputGroup>
{pagePlace.map((place, index) => { </Form>
return ( </Row>
<Col key={index} md={6} > <Row className="d-flex flex-wrap">
<Card align="center" border="info" style={{ margin: "3%" }}> {pagePlace.map((place, index) => {
<Card.Title style={{ margin: "3%", fontSize: '200%', fontWeight: 'bold' }}>{place.name}</Card.Title> return (
<Card.Img variant="top" style={{ padding: "5%", width: "100%", height: "340px" }} src={place.img} /> <Col key={index} md={6} >
<Card.Body > <Card align="center" border="info" style={{ margin: "3%" }}>
<Card.Text style={{ overflow: 'auto', fontSize: '25px', width: '100%', height: "80px" }} > <Card.Title style={{ margin: "3%", fontSize: '200%', fontWeight: 'bold' }}>{place.name}<Button onClick={handleShow}> <Modal
{place.address} </Card.Text> show={show}
<Button variant="primary" onClick={() => { onHide={handleClose}
const showArr = [false, false, false, false] backdrop="static"
showArr[index] = true keyboard={false}
setShowSet(showArr) ><Form>
}}>{place.name} 자세히 살펴보기</Button> <Form.Group controlId="formBasicEmail">
<Place search={place} index={index} show={showSet[index]} onHide={() => setShowSet([false, false, false, false])} /> <Form.Label>이름</Form.Label>
</Card.Body> <Form.Control type="email" placeholder="Enter email" />
<Form.Text className="text-muted">
We'll never share your email with anyone else.
</Form.Text>
</Form.Group>
<Form.Group controlId="formBasicPassword">
<Form.Label>폴더</Form.Label>
<Form.Control type="password" placeholder="Password" />
</Form.Group>
<Form.Group controlId="formBasicCheckbox">
<Form.Check type="checkbox" label="Check me out" />
</Form.Group>
<Button variant="primary" type="submit">
Submit
</Button>
</Form></Modal></Button></Card.Title>
<Card.Img variant="top" style={{ padding: "5%", width: "100%", height: "340px" }} src={place.img} />
<Card.Body >
<Card.Text style={{ overflow: 'auto', fontSize: '25px', width: '100%', height: "80px" }} >
{place.address} </Card.Text>
<Button variant="primary" onClick={() => {
const showArr = [false, false, false, false]
showArr[index] = true
setShowSet(showArr)
}}>{place.name} 자세히 살펴보기</Button>
<Place search={place} index={index} show={showSet[index]} onHide={() => setShowSet([false, false, false, false])} />
</Card.Body>
</Card> </Card>
</Col> </Col>
) )
})} })}
</Row> </Row>
{console.log(showSet)} { console.log(showSet) }
{/* show가 전부 true로 바뀌어서 전부 다 보이게 되는 것이다. */} {/* show가 전부 true로 바뀌어서 전부 다 보이게 되는 것이다. */ }
<Row className="mt-2 d-flex justify-content-center"> <Row className="mt-2 d-flex justify-content-center">
<Paginations index={index} endPage={endPage} handlePage={handlePage}></Paginations> <Paginations index={index} endPage={endPage} handlePage={handlePage}></Paginations>
</Row> </Row>
</Container> </Container>
); );
} }
export default Search; export default Search
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment