Commit e2fc281a authored by baesangjune's avatar baesangjune
Browse files

.

parent c7df9b76
This diff is collapsed.
...@@ -18,7 +18,7 @@ function Bookmark() { ...@@ -18,7 +18,7 @@ function Bookmark() {
const [index, setIndex] = useState(1); const [index, setIndex] = useState(1);
const [error, setError] = useState('') const [error, setError] = useState('')
const [state, setState] = useState(false); const [state, setState] = useState(false);
const [bookmark, setBookmark] = useState([false, false, false, false]) const [bookmark, setBookmark] = useState([true, true, true, true])
const [pagePlace, setPagePlace] = useState([]) const [pagePlace, setPagePlace] = useState([])
const [showSet, setShowSet] = useState([false, false, false, false]); const [showSet, setShowSet] = useState([false, false, false, false]);
...@@ -49,7 +49,7 @@ function Bookmark() { ...@@ -49,7 +49,7 @@ function Bookmark() {
} }
} else { } else {
try { try {
const response = await axios.delete(`/api/users/bookmark?ID=${user}`) const response = await axios.delete(`/api/users/bookmark?ID=${user}&place=${pagePlace[index]._id}`)
alert(response.data, '저장된 북마크가 삭제되었습니다.') alert(response.data, '저장된 북마크가 삭제되었습니다.')
const showArr = bookmark const showArr = bookmark
showArr[index] = false showArr[index] = false
...@@ -68,7 +68,7 @@ function Bookmark() { ...@@ -68,7 +68,7 @@ function Bookmark() {
return ( return (
<Container> <Container>
<Link to="/" className="d-flex justify-content-center"> <Link to="/" className="d-flex justify-content-center">
<Image style={{margin:"1%"}} src={ohuh} /> <Image style={{ margin: "1%" }} src={ohuh} />
</Link> </Link>
<Navbar bg="info" variant="dark"> <Navbar bg="info" variant="dark">
<Navbar.Brand href="/">북마크</Navbar.Brand> <Navbar.Brand href="/">북마크</Navbar.Brand>
...@@ -96,12 +96,9 @@ function Bookmark() { ...@@ -96,12 +96,9 @@ function Bookmark() {
<Card.Body > <Card.Body >
<Card.Text style={{ overflow: 'auto', fontSize: '25px', width: '100%', height: "80px" }} > <Card.Text style={{ overflow: 'auto', fontSize: '25px', width: '100%', height: "80px" }} >
{place.address} </Card.Text> {place.address} </Card.Text>
<Button variant="info" onClick={() => { <Link to={`/place?id=${1}&place=${place.name}`} >
const showArr = [false, false, false, false] <Button variant="info"> {place.name} 자세히 살펴보기</Button>
showArr[index] = true </Link>
setShowSet(showArr)
}}>{place.name} 자세히 살펴보기</Button>
{/* <Place place={place} index={index} show={showSet[index]} onHide={() => setShowSet([false, false, false, false])} /> */}
</Card.Body> </Card.Body>
</Card> </Card>
</Col> </Col>
......
...@@ -96,7 +96,7 @@ function App() { ...@@ -96,7 +96,7 @@ function App() {
<Card.Text style={{ overflow: 'auto', fontSize: '25px', width: '100%', height: "80px" }} > <Card.Text style={{ overflow: 'auto', fontSize: '25px', width: '100%', height: "80px" }} >
{recommend.address} </Card.Text> {recommend.address} </Card.Text>
<Link to={`/place?id=${1}&place=${recommend.name}`} > <Link to={`/place?id=${1}&place=${recommend.name}`} >
<Button variant="primary"> {recommend.name} 자세히 살펴보기</Button> <Button variant="info"> {recommend.name} 자세히 살펴보기</Button>
</Link> </Link>
</Card.Body> </Card.Body>
</Card> </Card>
...@@ -111,7 +111,7 @@ function App() { ...@@ -111,7 +111,7 @@ function App() {
<Card.Text style={{ overflow: 'auto', fontSize: '25px', width: '100%', height: "80px" }} > <Card.Text style={{ overflow: 'auto', fontSize: '25px', width: '100%', height: "80px" }} >
{latest.address} </Card.Text> {latest.address} </Card.Text>
<Link to={`/place?id=${1}&place=${latest.name}`} > <Link to={`/place?id=${1}&place=${latest.name}`} >
<Button variant="primary"> {latest.name} 자세히 살펴보기</Button> <Button variant="info"> {latest.name} 자세히 살펴보기</Button>
</Link> </Link>
</Card.Body> </Card.Body>
</Card> </Card>
......
...@@ -100,6 +100,7 @@ function Search(props) { ...@@ -100,6 +100,7 @@ function Search(props) {
e.preventDefault() e.preventDefault()
setState(true) setState(true)
setIndex(1) setIndex(1)
setBookmark([false, false, false, false])
} }
function paginate(items, pageNumber, itemNumber) { function paginate(items, pageNumber, itemNumber) {
...@@ -139,13 +140,9 @@ function Search(props) { ...@@ -139,13 +140,9 @@ function Search(props) {
} }
} }
} }
let time = new Date()
return ( return (
<Container > <Container >
<Link to="/" className="d-flex justify-content-center" ><Image src={ohuh} /></Link> <Link to="/" className="d-flex justify-content-center" ><Image src={ohuh} /></Link>
<Row className="mb-2" className="d-flex justify-content-center"> <Row className="mb-2" className="d-flex justify-content-center">
<Form style={{ width: "90vw" }} onSubmit={handleSubmit}> <Form style={{ width: "90vw" }} onSubmit={handleSubmit}>
<InputGroup size="lg"> <InputGroup size="lg">
...@@ -162,7 +159,6 @@ function Search(props) { ...@@ -162,7 +159,6 @@ function Search(props) {
</InputGroup> </InputGroup>
</Form> </Form>
</Row> </Row>
{time.toLocaleString()}
<Row className="d-flex flex-wrap"> <Row className="d-flex flex-wrap">
{console.log("#####################33", pagePlace)} {console.log("#####################33", pagePlace)}
...@@ -170,15 +166,16 @@ function Search(props) { ...@@ -170,15 +166,16 @@ function Search(props) {
return ( return (
<Col key={index} md={6} > <Col key={index} md={6} >
<Card align="center" border="info" style={{ margin: "2%" }}> <Card align="center" border="info" style={{ margin: "2%" }}>
<Row className="d-flex justify-content-center"> <Row>
<Card.Header style={{ margin: "0", marginLeft:"3%",marginRight:"3%",fontSize: '200%', fontWeight: 'bold', width :"100vw"}} >{place.name} <Card.Header style={{ margin: "0", marginLeft: "3%", marginRight: "3%", fontSize: '200%', fontWeight: 'bold', width: "100vw" }} >{place.name}
{user ? {user ?
<Button <Button
variant={bookmark[index] ? "primary" : "light"} variant={bookmark[index] ? "info" : "light"}
onClick={() => handlebookmark(index, place)}> onClick={() => handlebookmark(index, place)}>
<Icon.BookmarkStarFill size={35} /> <Icon.BookmarkStarFill size={35} />
{console.log("bookmark", bookmark)} {console.log("bookmark", bookmark)}
{console.log("bookmark[index]", bookmark[index])}</Button> : null} {console.log("bookmark[index]", bookmark[index])}</Button>
: null}
</Card.Header> </Card.Header>
</Row> </Row>
<Card.Img variant="top" style={{ padding: "5%", width: "100%", height: "340px" }} src={place.img} /> <Card.Img variant="top" style={{ padding: "5%", width: "100%", height: "340px" }} src={place.img} />
...@@ -186,7 +183,7 @@ function Search(props) { ...@@ -186,7 +183,7 @@ function Search(props) {
<Card.Text style={{ overflow: 'auto', fontSize: '25px', width: '100%', height: "80px" }} > <Card.Text style={{ overflow: 'auto', fontSize: '25px', width: '100%', height: "80px" }} >
{place.address} </Card.Text> {place.address} </Card.Text>
<Link to={`/place?id=${index}&place=${place.name}`} > <Link to={`/place?id=${index}&place=${place.name}`} >
<Button variant="primary"> {place.name} 자세히 살펴보기</Button> <Button variant="info"> {place.name} 자세히 살펴보기</Button>
</Link> </Link>
</Card.Body> </Card.Body>
</Card> </Card>
......
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