Commit 7f193b5a authored by Kim, Chaerin's avatar Kim, Chaerin
Browse files

z

parent e08aede8
[{"C:\\Users\\sag06\\Desktop\\project\\search-page\\client\\src\\index.js":"1","C:\\Users\\sag06\\Desktop\\project\\search-page\\client\\src\\Bookmark.js":"2"},{"size":1382,"mtime":1611896266675,"results":"3","hashOfConfig":"4"},{"size":5395,"mtime":1611896266500,"results":"5","hashOfConfig":"4"},{"filePath":"6","messages":"7","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"1n20xnc",{"filePath":"8","messages":"9","errorCount":0,"warningCount":12,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"C:\\Users\\sag06\\Desktop\\project\\search-page\\client\\src\\index.js",["10"],"C:\\Users\\sag06\\Desktop\\project\\search-page\\client\\src\\Bookmark.js",["11","12","13","14","15","16","17","18","19","20","21","22"],{"ruleId":null,"fatal":true,"severity":2,"message":"23","line":26,"column":2},{"ruleId":"24","severity":1,"message":"25","line":2,"column":10,"nodeType":"26","messageId":"27","endLine":2,"endColumn":15},{"ruleId":"24","severity":1,"message":"28","line":2,"column":39,"nodeType":"26","messageId":"27","endLine":2,"endColumn":43},{"ruleId":"24","severity":1,"message":"29","line":7,"column":8,"nodeType":"26","messageId":"27","endLine":7,"endColumn":13},{"ruleId":"24","severity":1,"message":"30","line":16,"column":12,"nodeType":"26","messageId":"27","endLine":16,"endColumn":16},{"ruleId":"24","severity":1,"message":"31","line":16,"column":18,"nodeType":"26","messageId":"27","endLine":16,"endColumn":25},{"ruleId":"24","severity":1,"message":"32","line":17,"column":12,"nodeType":"26","messageId":"27","endLine":17,"endColumn":17},{"ruleId":"24","severity":1,"message":"33","line":17,"column":19,"nodeType":"26","messageId":"27","endLine":17,"endColumn":27},{"ruleId":"24","severity":1,"message":"34","line":18,"column":12,"nodeType":"26","messageId":"27","endLine":18,"endColumn":17},{"ruleId":"24","severity":1,"message":"35","line":19,"column":12,"nodeType":"26","messageId":"27","endLine":19,"endColumn":17},{"ruleId":"24","severity":1,"message":"36","line":19,"column":19,"nodeType":"26","messageId":"27","endLine":19,"endColumn":27},{"ruleId":"24","severity":1,"message":"37","line":22,"column":12,"nodeType":"26","messageId":"27","endLine":22,"endColumn":19},{"ruleId":"38","severity":1,"message":"39","line":64,"column":8,"nodeType":"40","endLine":64,"endColumn":10,"suggestions":"41"},"Parsing error: Unexpected token\n\n 24 | <Route exact path=\"/\" component={App} />\n 25 | <Route path=\"/search\" component={Search} />\n> 26 | <<<<<<< HEAD\n | ^\n 27 | <Route path=\"/place\" component={Place} />\n 28 | =======\n 29 | <Route path='/signup' component={Signup}/>","no-unused-vars","'Alert' is defined but never used.","Identifier","unusedVar","'Form' is defined but never used.","'Place' is defined but never used.","'page' is assigned a value but never used.","'setPage' is assigned a value but never used.","'index' is assigned a value but never used.","'setIndex' is assigned a value but never used.","'error' is assigned a value but never used.","'state' is assigned a value but never used.","'setState' is assigned a value but never used.","'showSet' is assigned a value but never used.","react-hooks/exhaustive-deps","React Hook useEffect has a missing dependency: 'getBookmark'. Either include it or remove the dependency array.","ArrayExpression",["42"],{"desc":"43","fix":"44"},"Update the dependencies array to be: [getBookmark]",{"range":"45","text":"46"},[2225,2227],"[getBookmark]"]
\ No newline at end of file
[{"C:\\Users\\sag06\\Desktop\\project\\search-page\\client\\src\\index.js":"1","C:\\Users\\sag06\\Desktop\\project\\search-page\\client\\src\\Pages\\Search.js":"2","C:\\Users\\sag06\\Desktop\\project\\search-page\\client\\src\\Pages\\Place.js":"3","C:\\Users\\sag06\\Desktop\\project\\search-page\\client\\src\\Pages\\Bookmark.js":"4","C:\\Users\\sag06\\Desktop\\project\\search-page\\client\\src\\Components\\Paginations.js":"5","C:\\Users\\sag06\\Desktop\\project\\search-page\\client\\src\\Pages\\App.js":"6"},{"size":1382,"mtime":1611896266675,"results":"7","hashOfConfig":"8"},{"size":10702,"mtime":1612140473960,"results":"9","hashOfConfig":"8"},{"size":6447,"mtime":1612140520700,"results":"10","hashOfConfig":"8"},{"size":5229,"mtime":1612006492438,"results":"11","hashOfConfig":"8"},{"size":3725,"mtime":1612140572407,"results":"12","hashOfConfig":"8"},{"size":2131,"mtime":1612140593373,"results":"13","hashOfConfig":"8"},{"filePath":"14","messages":"15","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"1n20xnc",{"filePath":"16","messages":"17","errorCount":0,"warningCount":15,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"18","messages":"19","errorCount":0,"warningCount":5,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"20","messages":"21","errorCount":0,"warningCount":15,"fixableErrorCount":0,"fixableWarningCount":0,"source":"22"},{"filePath":"23","messages":"24","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"25","messages":"26","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"C:\\Users\\sag06\\Desktop\\project\\search-page\\client\\src\\index.js",["27"],"C:\\Users\\sag06\\Desktop\\project\\search-page\\client\\src\\Pages\\Search.js",["28","29","30","31","32","33","34","35","36","37","38","39","40","41","42"],"C:\\Users\\sag06\\Desktop\\project\\search-page\\client\\src\\Pages\\Place.js",["43","44","45","46","47"],"C:\\Users\\sag06\\Desktop\\project\\search-page\\client\\src\\Pages\\Bookmark.js",["48","49","50","51","52","53","54","55","56","57","58","59","60","61","62"],"import React, { useState, useEffect } from 'react'\r\nimport { Alert, Col, Card, Container, Form, Row, Button, Nav, Navbar, Image } from \"react-bootstrap\"\r\nimport axios from \"axios\"\r\nimport ohuh from '../ohuh-sm.PNG';\r\nimport catchErrors from '../utils/catchErrors.js'\r\nimport { isAuthenticated } from '../utils/auth'\r\nimport * as Icon from 'react-bootstrap-icons';\r\nimport { Link, Redirect } from 'react-router-dom';\r\n\r\n\r\nconst INIT_PAGE = {\r\n bookmark: []\r\n}\r\n\r\n\r\nfunction Bookmark() {\r\n const [page, setPage] = useState(INIT_PAGE)\r\n const [index, setIndex] = useState(1);\r\n const [error, setError] = useState('')\r\n const [state, setState] = useState(false);\r\n const [bookmark, setBookmark] = useState([false, false, false, false])\r\n const [pagePlace, setPagePlace] = useState([])\r\n const [showSet, setShowSet] = useState([false, false, false, false]);\r\n\r\n const user = isAuthenticated()\r\n\r\n async function getBookmark() {\r\n try {\r\n const response = await axios.get(`/api/users/bookmark?ID=${user}`)\r\n setPagePlace(response.data.bookmark)\r\n } catch (error) {\r\n catchErrors(error, setError)\r\n }\r\n }\r\n\r\n\r\n async function handleBookmark(index) {\r\n if (!bookmark[index]) {\r\n console.log(pagePlace[index])\r\n try {\r\n const response = await axios.put(`/api/users/bookmark?ID=${user}&place=${pagePlace[index]._id}`)\r\n alert(response.data, '북마크가 저장되었습니다.')\r\n const showArr = bookmark\r\n showArr[index] = true\r\n setBookmark(showArr)\r\n console.log(\"bookmark=\", bookmark)\r\n } catch (error) {\r\n catchErrors(error, setError)\r\n }\r\n } else {\r\n try {\r\n const response = await axios.delete(`/api/users/bookmark?ID=${user}`)\r\n alert(response.data, '저장된 북마크가 삭제되었습니다.')\r\n const showArr = bookmark\r\n showArr[index] = false\r\n setBookmark(showArr)\r\n console.log(\"bookmark=\", bookmark)\r\n } catch (error) {\r\n catchErrors(error, setError)\r\n }\r\n }\r\n }\r\n useEffect(() => {\r\n getBookmark()\r\n }, [])\r\n\r\n\r\n return (\r\n <Container>\r\n <Link to=\"/\" className=\"d-flex justify-content-center\"><Image src={ohuh} /></Link>\r\n <div class=\"d-flex align-items-center p-3 text-white bg-info rounded shadow-sm\">\r\n <div >\r\n <h1 class=\"h6 mb-0 text-white\">북마크</h1>\r\n </div>\r\n </div>\r\n <Row className=\"d-flex flex-wrap\">\r\n {console.log(\"#####################33\", pagePlace)}\r\n {pagePlace.map((place, index) => {\r\n return (\r\n <Col key={index} md={6} >\r\n <Card align=\"center\" border=\"info\" style={{ margin: \"3%\" }}>\r\n\r\n <Card.Title className=\"d-flex justify-content-center\" style={{ margin: \"3%\", fontSize: '200%', fontWeight: 'bold' }} >{place.name}\r\n {user ?\r\n <Button\r\n variant={bookmark[index] ? \"primary\" : \"light\"}\r\n onClick={() => handleBookmark(index, place)}>\r\n <Icon.BookmarkStarFill size={35} />\r\n {console.log(\"bookmark\", bookmark)}\r\n {console.log(\"bookmark[index]\", bookmark[index])}</Button> : null}\r\n </Card.Title>\r\n <Card.Img variant=\"top\" style={{ padding: \"5%\", width: \"100%\", height: \"340px\" }} src={place.img} />\r\n <Card.Body >\r\n <Card.Text style={{ overflow: 'auto', fontSize: '25px', width: '100%', height: \"80px\" }} >\r\n {place.address} </Card.Text>\r\n <Link to={`/place?id=${index}&place=${place.name}`} >\r\n <Button variant=\"info\"> {place.name} 자세히 살펴보기</Button>\r\n </Link>\r\n </Card.Body>\r\n </Card>\r\n </Col>\r\n )\r\n })}\r\n\r\n\r\n </Row>\r\n </Container>\r\n )\r\n}\r\n\r\nexport default Bookmark\r\n\r\n\r\n // async function handleSubmit(e){\r\n // setState(true); //버튼이 눌려서 handlesubmit이될때 setState값이 true로 바뀐다\r\n // try { //respons 서버에 post로 요청하여 데이터를 받아온다\r\n // const response = await axios.post('/api/users/bookmark', page)\r\n // setSuccess(true)\r\n // } catch (error) {\r\n // console.log(error)\r\n // catchErrors(error, setError)\r\n // }\r\n // }\r\n\r\n // useEffect(() => {\r\n // getBookmark(user)\r\n // }, [user])","C:\\Users\\sag06\\Desktop\\project\\search-page\\client\\src\\Components\\Paginations.js",[],"C:\\Users\\sag06\\Desktop\\project\\search-page\\client\\src\\Pages\\App.js",[],{"ruleId":null,"fatal":true,"severity":2,"message":"63","line":26,"column":2},{"ruleId":"64","severity":1,"message":"65","line":2,"column":16,"nodeType":"66","messageId":"67","endLine":2,"endColumn":24},{"ruleId":"64","severity":1,"message":"68","line":4,"column":83,"nodeType":"66","messageId":"67","endLine":4,"endColumn":86},{"ruleId":"64","severity":1,"message":"69","line":16,"column":12,"nodeType":"66","messageId":"67","endLine":16,"endColumn":19},{"ruleId":"64","severity":1,"message":"70","line":16,"column":21,"nodeType":"66","messageId":"67","endLine":16,"endColumn":31},{"ruleId":"64","severity":1,"message":"71","line":20,"column":12,"nodeType":"66","messageId":"67","endLine":20,"endColumn":18},{"ruleId":"64","severity":1,"message":"72","line":20,"column":20,"nodeType":"66","messageId":"67","endLine":20,"endColumn":29},{"ruleId":"64","severity":1,"message":"73","line":24,"column":12,"nodeType":"66","messageId":"67","endLine":24,"endColumn":17},{"ruleId":"64","severity":1,"message":"74","line":26,"column":20,"nodeType":"66","messageId":"67","endLine":26,"endColumn":31},{"ruleId":"64","severity":1,"message":"75","line":28,"column":19,"nodeType":"66","messageId":"67","endLine":28,"endColumn":27},{"ruleId":"76","severity":1,"message":"77","line":50,"column":8,"nodeType":"78","endLine":50,"endColumn":10,"suggestions":"79"},{"ruleId":"76","severity":1,"message":"80","line":63,"column":8,"nodeType":"78","endLine":63,"endColumn":28,"suggestions":"81"},{"ruleId":"76","severity":1,"message":"82","line":78,"column":8,"nodeType":"78","endLine":78,"endColumn":15,"suggestions":"83"},{"ruleId":"64","severity":1,"message":"84","line":93,"column":11,"nodeType":"66","messageId":"67","endLine":93,"endColumn":17},{"ruleId":"64","severity":1,"message":"85","line":183,"column":9,"nodeType":"66","messageId":"67","endLine":183,"endColumn":13},{"ruleId":"86","severity":1,"message":"87","line":188,"column":35,"nodeType":"88","endLine":188,"endColumn":76},{"ruleId":"64","severity":1,"message":"89","line":1,"column":10,"nodeType":"90","messageId":"67","endLine":1,"endColumn":15},{"ruleId":"64","severity":1,"message":"91","line":4,"column":21,"nodeType":"66","messageId":"67","endLine":4,"endColumn":24},{"ruleId":"64","severity":1,"message":"92","line":4,"column":26,"nodeType":"66","messageId":"67","endLine":4,"endColumn":32},{"ruleId":"76","severity":1,"message":"93","line":61,"column":6,"nodeType":"78","endLine":61,"endColumn":8,"suggestions":"94"},{"ruleId":"95","severity":1,"message":"96","line":140,"column":11,"nodeType":"97","endLine":140,"endColumn":23},{"ruleId":"64","severity":1,"message":"98","line":2,"column":10,"nodeType":"66","messageId":"67","endLine":2,"endColumn":15},{"ruleId":"64","severity":1,"message":"99","line":2,"column":39,"nodeType":"66","messageId":"67","endLine":2,"endColumn":43},{"ruleId":"64","severity":1,"message":"68","line":2,"column":58,"nodeType":"66","messageId":"67","endLine":2,"endColumn":61},{"ruleId":"64","severity":1,"message":"100","line":2,"column":63,"nodeType":"66","messageId":"67","endLine":2,"endColumn":69},{"ruleId":"64","severity":1,"message":"65","line":8,"column":16,"nodeType":"66","messageId":"67","endLine":8,"endColumn":24},{"ruleId":"64","severity":1,"message":"101","line":17,"column":12,"nodeType":"66","messageId":"67","endLine":17,"endColumn":16},{"ruleId":"64","severity":1,"message":"102","line":17,"column":18,"nodeType":"66","messageId":"67","endLine":17,"endColumn":25},{"ruleId":"64","severity":1,"message":"103","line":18,"column":12,"nodeType":"66","messageId":"67","endLine":18,"endColumn":17},{"ruleId":"64","severity":1,"message":"104","line":18,"column":19,"nodeType":"66","messageId":"67","endLine":18,"endColumn":27},{"ruleId":"64","severity":1,"message":"73","line":19,"column":12,"nodeType":"66","messageId":"67","endLine":19,"endColumn":17},{"ruleId":"64","severity":1,"message":"105","line":20,"column":12,"nodeType":"66","messageId":"67","endLine":20,"endColumn":17},{"ruleId":"64","severity":1,"message":"106","line":20,"column":19,"nodeType":"66","messageId":"67","endLine":20,"endColumn":27},{"ruleId":"64","severity":1,"message":"69","line":23,"column":12,"nodeType":"66","messageId":"67","endLine":23,"endColumn":19},{"ruleId":"64","severity":1,"message":"70","line":23,"column":21,"nodeType":"66","messageId":"67","endLine":23,"endColumn":31},{"ruleId":"76","severity":1,"message":"107","line":65,"column":8,"nodeType":"78","endLine":65,"endColumn":10,"suggestions":"108"},"Parsing error: Unexpected token\n\n 24 | <Route exact path=\"/\" component={App} />\n 25 | <Route path=\"/search\" component={Search} />\n> 26 | <<<<<<< HEAD\n | ^\n 27 | <Route path=\"/place\" component={Place} />\n 28 | =======\n 29 | <Route path='/signup' component={Signup}/>","no-unused-vars","'Redirect' is defined but never used.","Identifier","unusedVar","'Nav' is defined but never used.","'showSet' is assigned a value but never used.","'setShowSet' is assigned a value but never used.","'mobile' is assigned a value but never used.","'setMobile' is assigned a value but never used.","'error' is assigned a value but never used.","'getBookmark' is defined but never used.","'response' is assigned a value but never used.","react-hooks/exhaustive-deps","React Hook useEffect has a missing dependency: 'getAssociation'. Either include it or remove the dependency array.","ArrayExpression",["109"],"React Hook useEffect has missing dependencies: 'endPage' and 'pagePlace'. Either include them or remove the dependency array.",["110"],"React Hook useEffect has missing dependencies: 'getAssociation', 'props.history', and 'search'. Either include them or remove the dependency array.",["111"],"'places' is assigned a value but never used.","'time' is assigned a value but never used.","react/jsx-no-duplicate-props","No duplicate props allowed","JSXAttribute","'kakao' is defined but never used.","Program","'Row' is defined but never used.","'Button' is defined but never used.","React Hook useEffect has missing dependencies: 'getReview' and 'infiniteScroll'. Either include them or remove the dependency array.",["112"],"jsx-a11y/anchor-is-valid","The href attribute requires a valid value to be accessible. Provide a valid, navigable address as the href value. If you cannot provide a valid href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md","JSXOpeningElement","'Alert' is defined but never used.","'Form' is defined but never used.","'Navbar' is defined but never used.","'page' is assigned a value but never used.","'setPage' is assigned a value but never used.","'index' is assigned a value but never used.","'setIndex' is assigned a value but never used.","'state' is assigned a value but never used.","'setState' is assigned a value but never used.","React Hook useEffect has a missing dependency: 'getBookmark'. Either include it or remove the dependency array.",["113"],{"desc":"114","fix":"115"},{"desc":"116","fix":"117"},{"desc":"118","fix":"119"},{"desc":"120","fix":"121"},{"desc":"122","fix":"123"},"Update the dependencies array to be: [getAssociation]",{"range":"124","text":"125"},"Update the dependencies array to be: [association, endPage, index, pagePlace]",{"range":"126","text":"127"},"Update the dependencies array to be: [getAssociation, props.history, search, state]",{"range":"128","text":"129"},"Update the dependencies array to be: [getReview, infiniteScroll]",{"range":"130","text":"131"},"Update the dependencies array to be: [getBookmark]",{"range":"132","text":"133"},[1976,1978],"[getAssociation]",[2377,2397],"[association, endPage, index, pagePlace]",[2976,2983],"[getAssociation, props.history, search, state]",[1942,1944],"[getReview, infiniteScroll]",[2279,2281],"[getBookmark]"]
\ No newline at end of file
import React, { useState, useEffect } from 'react'
import { Alert, Col, Card, Container, Form, Row, Button, Nav, Navbar } from "react-bootstrap"
import { Alert, Col, Card, Container, Form, Row, Button, Nav, Navbar, Image } from "react-bootstrap"
import axios from "axios"
import catchErrors from './utils/catchErrors.js'
import { isAuthenticated } from './utils/auth'
import ohuh from '../ohuh-sm.PNG';
import catchErrors from '../utils/catchErrors.js'
import { isAuthenticated } from '../utils/auth'
import * as Icon from 'react-bootstrap-icons';
import Place from './Components/Place.js'
import { Link, Redirect } from 'react-router-dom';
const INIT_PAGE = {
......@@ -66,12 +67,12 @@ function Bookmark() {
return (
<Container>
<Navbar bg="info" variant="dark">
<Navbar.Brand href="/">북마크</Navbar.Brand>
<Nav className="mr-auto">
<Nav.Link href="/">Home</Nav.Link>
</Nav>
</Navbar>
<Link to="/" className="d-flex justify-content-center"><Image src={ohuh} /></Link>
<div class="d-flex align-items-center p-3 text-white bg-info rounded shadow-sm">
<div >
<h1 class="h6 mb-0 text-white">북마크</h1>
</div>
</div>
<Row className="d-flex flex-wrap">
{console.log("#####################33", pagePlace)}
{pagePlace.map((place, index) => {
......@@ -92,12 +93,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=${index}&place=${place.name}`} >
<Button variant="info"> {place.name} 자세히 살펴보기</Button>
</Link>
</Card.Body>
</Card>
</Col>
......
/*global kakao*/
import axios from 'axios';
import React, { useEffect, useState } from 'react';
import { Container, Row, Button, } from 'react-bootstrap';
import { Container, Row, Button, Image, } from 'react-bootstrap';
import queryString from 'query-string'
import { Link } from 'react-bootstrap-icons';
import ohuh from '../ohuh-sm.PNG';
import styled from 'styled-components';
const MapContents = styled.div`
width: 100%;
height: 100%;
`;
function Place(props) {
console.log(props)
......@@ -28,6 +37,24 @@ function Place(props) {
}
useEffect(() => {
// const script = document.createElement("script");
// script.async = true;
// script.src =
// "https://dapi.kakao.com/v2/maps/sdk.js?appkey=908d6cabedae3bbac126305e53137d0d&autoload=false";
// document.head.appendChild(script);
// script.onload = () => {
// kakao.maps.load(() => {
// let container = document.getElementById("Mymap");
// let options = {
// center: new kakao.maps.LatLng(37.506502, 127.053617),
// level: 7
// };
// const map = new window.kakao.maps.Map(container, options);
// });
// }
getReview();
window.addEventListener("scroll", infiniteScroll);
return () => { window.removeEventListener("scroll", infiniteScroll); }
......@@ -52,19 +79,82 @@ function Place(props) {
}
return (
<Container {...props}>
{place}
{Array.isArray(reviews) ? reviews.map((review, index) => {
return (
<Row className="mt-4">
<a href={review.link}>{review.title}</a>
<div>{review.summary}</div>
<div>{review.content}</div>
</Row>
)
})
: "리뷰가 없습니다."}
<Container>
<Link to="/" className="d-flex justify-content-center"><Image src={ohuh} /></Link>
<div class="d-flex align-items-center p-3 my-3 text-white bg-info rounded shadow-sm">
<div >
<h1 class="h6 mb-0 text-white">{place}</h1>
</div>
</div>
<div class="my-3 p-3 bg-white rounded shadow-sm">
<h6 class="border-bottom pb-2 mb-0">관광지 정보</h6>
<MapContents id="Mymap"></MapContents>
{/* <div class="d-flex text-muted pt-3">
<p class="pb-3 mb-0 small lh-sm border-bottom">
<strong class="d-block text-gray-dark">@username</strong>
Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.
</p>
</div>
<div class="d-flex text-muted pt-3">
<svg class="bd-placeholder-img flex-shrink-0 me-2 rounded" width="32" height="32" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Placeholder: 32x32" preserveAspectRatio="xMidYMid slice" focusable="false"><title>Placeholder</title><rect width="100%" height="100%" fill="#e83e8c" /><text x="50%" y="50%" fill="#e83e8c" dy=".3em">32x32</text></svg>
<p class="pb-3 mb-0 small lh-sm border-bottom">
<strong class="d-block text-gray-dark">@username</strong>
Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.
</p>
</div>
<div class="d-flex text-muted pt-3">
<svg class="bd-placeholder-img flex-shrink-0 me-2 rounded" width="32" height="32" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Placeholder: 32x32" preserveAspectRatio="xMidYMid slice" focusable="false"><title>Placeholder</title><rect width="100%" height="100%" fill="#6f42c1" /><text x="50%" y="50%" fill="#6f42c1" dy=".3em">32x32</text></svg>
<p class="pb-3 mb-0 small lh-sm border-bottom">
<strong class="d-block text-gray-dark">@username</strong>
Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.
</p>
</div> */}
<small class="d-block text-end mt-3">
<a href={`https://www.google.com/search?q=${place}&tbm=isch`}>사진 더보러가기</a>
</small>
</div>
<div class="my-3 p-3 bg-white rounded shadow-sm">
<h6 class="border-bottom pb-2 mb-0">관광지 후기</h6>
{Array.isArray(reviews) ? reviews.map((review, index) => {
return (
<div class="d-flex text-muted pt-3">
<div class="pb-3 mb-0 small lh-sm border-bottom w-100">
<div class="d-flex justify-content-between">
<strong class="text-gray-dark">{review.title}</strong>
<a href={review.link}>블로그로 이동</a>
</div>
<span class="d-block">{review.summary}</span>
</div>
</div>
)
})
: "리뷰가 없습니다."}
<small class="d-block text-end mt-3">
<a href="#">리뷰 더보기</a>
</small>
</div>
</Container>
// <Container {...props}>
// {place}
// {Array.isArray(reviews) ? reviews.map((review, index) => {
// return (
// <Row className="mt-4">
// <a href={review.link}>{review.title}</a>
// <div>{review.summary}</div>
// <div>{review.content}</div>
// </Row>
// )
// })
// : "리뷰가 없습니다."}
// </Container>
);
}
......
import React, { useState, useEffect } from 'react';
import { Link, Redirect } from 'react-router-dom';
import ohuh from '../ohuh-sm.PNG';
import Place from '../Components/Place';
import { Container, Form, Row, Col, Card, Image, InputGroup, FormControl, Button, Nav } from 'react-bootstrap';
import Paginations from '../Components/Paginations';
import axios from 'axios';
......@@ -185,7 +184,7 @@ function Search(props) {
return (
<Container >
<Link to="/path" 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">
<Form style={{ width: "90vw" }} onSubmit={handleSubmit}>
<InputGroup size="lg">
......@@ -197,7 +196,7 @@ function Search(props) {
onChange={handleChange}
/>
<InputGroup.Append>
<Button type="submit" variant="outline-secondary" >검색</Button>
<Button type="submit" variant="info" >검색</Button>
</InputGroup.Append>
</InputGroup>
</Form>
......@@ -214,7 +213,7 @@ function Search(props) {
<Card.Title className="d-flex justify-content-center" style={{ margin: "3%", fontSize: '200%', fontWeight: 'bold' }} >{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)}
......@@ -225,7 +224,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>
......
......@@ -8,7 +8,7 @@ import reportWebVitals from './reportWebVitals';
import Signup from './Components/Signup'
import Login from './Components/Login'
import PrivateRoute from "./Components/PrivateRoute";
import Bookmark from "./Bookmark"
import Bookmark from "./Pages/Bookmark"
import {
BrowserRouter as Router,
Switch,
......
......@@ -273,6 +273,11 @@
"tweetnacl": "^0.14.3"
}
},
"bcryptjs": {
"version": "2.4.3",
"resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz",
"integrity": "sha1-mrVie5PmBiH/fNrF2pczAn3x0Ms="
},
"bl": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/bl/-/bl-2.2.1.tgz",
......@@ -324,6 +329,11 @@
"resolved": "https://registry.npmjs.org/bson/-/bson-1.1.5.tgz",
"integrity": "sha512-kDuEzldR21lHciPQAIulLs1LZlCXdLziXI6Mb/TDkwXhb//UORJNPXgcRs2CuO4H0DcMkpfT3/ySsP3unoZjBg=="
},
"buffer-equal-constant-time": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz",
"integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk="
},
"bytes": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz",
......@@ -544,6 +554,14 @@
"safer-buffer": "^2.1.0"
}
},
"ecdsa-sig-formatter": {
"version": "1.0.11",
"resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz",
"integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==",
"requires": {
"safe-buffer": "^5.0.1"
}
},
"ee-first": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
......@@ -821,6 +839,30 @@
"resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
"integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus="
},
"jsonwebtoken": {
"version": "8.5.1",
"resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz",
"integrity": "sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w==",
"requires": {
"jws": "^3.2.2",
"lodash.includes": "^4.3.0",
"lodash.isboolean": "^3.0.3",
"lodash.isinteger": "^4.0.4",
"lodash.isnumber": "^3.0.3",
"lodash.isplainobject": "^4.0.6",
"lodash.isstring": "^4.0.1",
"lodash.once": "^4.0.0",
"ms": "^2.1.1",
"semver": "^5.6.0"
},
"dependencies": {
"ms": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
}
}
},
"jsprim": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz",
......@@ -832,6 +874,25 @@
"verror": "1.10.0"
}
},
"jwa": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz",
"integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==",
"requires": {
"buffer-equal-constant-time": "1.0.1",
"ecdsa-sig-formatter": "1.0.11",
"safe-buffer": "^5.0.1"
}
},
"jws": {
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz",
"integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==",
"requires": {
"jwa": "^1.4.1",
"safe-buffer": "^5.0.1"
}
},
"kareem": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/kareem/-/kareem-2.3.2.tgz",
......@@ -842,6 +903,49 @@
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz",
"integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA=="
},
"lodash.includes": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz",
"integrity": "sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8="
},
"lodash.isboolean": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz",
"integrity": "sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY="
},
"lodash.isinteger": {
"version": "4.0.4",
"resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz",
"integrity": "sha1-YZwK89A/iwTDH1iChAt3sRzWg0M="
},
"lodash.isnumber": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz",
"integrity": "sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w="
},
"lodash.isplainobject": {
"version": "4.0.6",
"resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz",
"integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs="
},
"lodash.isstring": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz",
"integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE="
},
"lodash.once": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz",
"integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w="
},
"loose-envify": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
"integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==",
"requires": {
"js-tokens": "^3.0.0 || ^4.0.0"
}
},
"media-typer": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
......@@ -980,6 +1084,11 @@
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz",
"integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ=="
},
"object-assign": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM="
},
"on-finished": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz",
......@@ -1026,6 +1135,16 @@
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
},
"prop-types": {
"version": "15.7.2",
"resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz",
"integrity": "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==",
"requires": {
"loose-envify": "^1.4.0",
"object-assign": "^4.1.1",
"react-is": "^16.8.1"
}
},
"proxy-addr": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz",
......@@ -1086,6 +1205,14 @@
}
}
},
"react-bootstrap-icons": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/react-bootstrap-icons/-/react-bootstrap-icons-1.3.0.tgz",
"integrity": "sha512-84ne6JNYd/aT4/lk9IT23YmPdat7RrBFuf1rSIdrufX5bAkVzDPqNUkLS1gZqylZIzjjKJvIevLHLGYaMCo7Ig==",
"requires": {
"prop-types": "^15.7.2"
}
},
"react-is": {
"version": "16.13.1",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
......@@ -1411,6 +1538,11 @@
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
"integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A=="
},
"validator": {
"version": "13.5.2",
"resolved": "https://registry.npmjs.org/validator/-/validator-13.5.2.tgz",
"integrity": "sha512-mD45p0rvHVBlY2Zuy3F3ESIe1h5X58GPfAtslBjY7EtTqGquZTj+VX/J4RnHWN8FKq0C9WRVt1oWAcytWRuYLQ=="
},
"vary": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
......
......@@ -37,7 +37,7 @@ const searchImg = async (req, res, next) => {
const newPlaces = await new Places(req.places).save()
next()
} else if (req.places.img === "https://t1.daumcdn.net/thumb/R600x0/?fname=http%3A%2F%2Ft1.daumcdn.net%2Fqna%2Fimage%2F4b035cdf8372d67108f7e8d339660479dfb41bbd") {
const imgUrl = "https://www.google.com/search?q=" + encodeURI(req.query.keyword) + "+site:tistory.com/&sxsrf=ALeKk023Dv08KQDodRmpB5222lQuzw2Vaw:1610612821100&source=lnms&tbm=isch"
const imgUrl = "https://www.google.com/search?q=" + encodeURI(req.query.keyword) + "+site:tistory.com/&tbm=isch"
axios.get(imgUrl)
.then(async (response) => {
......
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