Commit e2fc281a authored by baesangjune's avatar baesangjune
Browse files

.

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