Commit cf982a25 authored by baesangjune's avatar baesangjune
Browse files

랜더링문제해결

parent 0a8413a1
[{"C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Pages\\Bookmark.js":"1","C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Pages\\Place.js":"2","C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Pages\\Search.js":"3","C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Pages\\App.js":"4","C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Components\\Signup.js":"5","C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Components\\Paginations.js":"6"},{"size":5982,"mtime":1612283271210,"results":"7","hashOfConfig":"8"},{"size":6513,"mtime":1612273971390,"results":"9","hashOfConfig":"8"},{"size":6981,"mtime":1612283645060,"results":"10","hashOfConfig":"8"},{"size":7440,"mtime":1612280171800,"results":"11","hashOfConfig":"8"},{"size":2959,"mtime":1612275114296,"results":"12","hashOfConfig":"8"},{"size":4208,"mtime":1612282364720,"results":"13","hashOfConfig":"8"},{"filePath":"14","messages":"15","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"13y9yvi",{"filePath":"16","messages":"17","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"18","messages":"19","errorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"20","messages":"21","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"22","messages":"23","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"24","messages":"25","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Pages\\Bookmark.js",["26","27"],"C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Pages\\Place.js",["28"],"C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Pages\\Search.js",["29","30","31"],"C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Pages\\App.js",["32"],"C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Components\\Signup.js",[],"C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Components\\Paginations.js",[],{"ruleId":"33","severity":1,"message":"34","line":26,"column":19,"nodeType":"35","messageId":"36","endLine":26,"endColumn":30},{"ruleId":"37","severity":1,"message":"38","line":77,"column":8,"nodeType":"39","endLine":77,"endColumn":10,"suggestions":"40"},{"ruleId":null,"fatal":true,"severity":2,"message":"41","line":4,"column":2},{"ruleId":"33","severity":1,"message":"42","line":23,"column":12,"nodeType":"35","messageId":"36","endLine":23,"endColumn":17},{"ruleId":"37","severity":1,"message":"43","line":58,"column":8,"nodeType":"39","endLine":58,"endColumn":15,"suggestions":"44"},{"ruleId":"45","severity":1,"message":"46","line":116,"column":35,"nodeType":"47","endLine":116,"endColumn":76},{"ruleId":"33","severity":1,"message":"48","line":4,"column":64,"nodeType":"35","messageId":"36","endLine":4,"endColumn":68},"no-unused-vars","'bookmarkArr' is assigned a value but never used.","Identifier","unusedVar","react-hooks/exhaustive-deps","React Hook useEffect has a missing dependency: 'getBookmark'. Either include it or remove the dependency array.","ArrayExpression",["49"],"Parsing error: Unexpected token\n\n 2 | import axios from 'axios';\n 3 | import React, { useEffect, useState } from 'react';\n> 4 | <<<<<<< HEAD\n | ^\n 5 | import { Container, Image } from 'react-bootstrap';\n 6 | import queryString from 'query-string'\n 7 | import ohuh from '../ohuh-sm.PNG';","'error' is assigned a value but never used.","React Hook useEffect has missing dependencies: 'getAssociation', 'getBookmark', 'props.history', and 'search'. Either include them or remove the dependency array.",["50"],"react/jsx-no-duplicate-props","No duplicate props allowed","JSXAttribute","'Card' is defined but never used.",{"desc":"51","fix":"52"},{"desc":"53","fix":"54"},"Update the dependencies array to be: [getBookmark]",{"range":"55","text":"56"},"Update the dependencies array to be: [getAssociation, getBookmark, props.history, search, state]",{"range":"57","text":"58"},[2593,2595],"[getBookmark]",[2100,2107],"[getAssociation, getBookmark, props.history, search, state]"] [{"C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Pages\\Bookmark.js":"1","C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Pages\\Place.js":"2","C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Pages\\Search.js":"3","C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Pages\\App.js":"4","C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Components\\Signup.js":"5","C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Components\\Paginations.js":"6","C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\index.js":"7","C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Components\\PrivateRoute.js":"8","C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\utils\\auth.js":"9","C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\utils\\catchErrors.js":"10","C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Components\\Login.js":"11"},{"size":5982,"mtime":1612287694300,"results":"12","hashOfConfig":"13"},{"size":6513,"mtime":1612273971390,"results":"14","hashOfConfig":"13"},{"size":6651,"mtime":1612289495466,"results":"15","hashOfConfig":"13"},{"size":7387,"mtime":1612287154488,"results":"16","hashOfConfig":"13"},{"size":2959,"mtime":1612275114296,"results":"17","hashOfConfig":"13"},{"size":4208,"mtime":1612282364720,"results":"18","hashOfConfig":"13"},{"size":1345,"mtime":1612156521448,"results":"19","hashOfConfig":"13"},{"size":438,"mtime":1612133560394,"results":"20","hashOfConfig":"13"},{"size":766,"mtime":1612140214129,"results":"21","hashOfConfig":"13"},{"size":405,"mtime":1612133560400,"results":"22","hashOfConfig":"13"},{"size":3150,"mtime":1612140232971,"results":"23","hashOfConfig":"13"},{"filePath":"24","messages":"25","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"13y9yvi",{"filePath":"26","messages":"27","errorCount":1,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"28","messages":"29","errorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"30","messages":"31","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"32","messages":"33","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"34"},{"filePath":"35","messages":"36","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"37","messages":"38","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"39","messages":"40","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"41","messages":"42","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"43","messages":"44","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"45","messages":"46","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Pages\\Bookmark.js",["47","48"],"C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Pages\\Place.js",["49"],"C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Pages\\Search.js",["50","51","52"],"C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Pages\\App.js",[],"C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Components\\Signup.js",[],["53","54"],"C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Components\\Paginations.js",[],"C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\index.js",[],"C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Components\\PrivateRoute.js",[],"C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\utils\\auth.js",[],"C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\utils\\catchErrors.js",[],"C:\\Users\\노트북펜\\Desktop\\2021YDK\\search-page\\client\\src\\Components\\Login.js",[],{"ruleId":"55","severity":1,"message":"56","line":26,"column":19,"nodeType":"57","messageId":"58","endLine":26,"endColumn":30},{"ruleId":"59","severity":1,"message":"60","line":77,"column":8,"nodeType":"61","endLine":77,"endColumn":10,"suggestions":"62"},{"ruleId":null,"fatal":true,"severity":2,"message":"63","line":4,"column":2},{"ruleId":"55","severity":1,"message":"64","line":23,"column":12,"nodeType":"57","messageId":"58","endLine":23,"endColumn":17},{"ruleId":"59","severity":1,"message":"65","line":58,"column":8,"nodeType":"61","endLine":58,"endColumn":15,"suggestions":"66"},{"ruleId":"67","severity":1,"message":"68","line":107,"column":35,"nodeType":"69","endLine":107,"endColumn":76},{"ruleId":"70","replacedBy":"71"},{"ruleId":"72","replacedBy":"73"},"no-unused-vars","'bookmarkArr' is assigned a value but never used.","Identifier","unusedVar","react-hooks/exhaustive-deps","React Hook useEffect has a missing dependency: 'getBookmark'. Either include it or remove the dependency array.","ArrayExpression",["74"],"Parsing error: Unexpected token\n\n 2 | import axios from 'axios';\n 3 | import React, { useEffect, useState } from 'react';\n> 4 | <<<<<<< HEAD\n | ^\n 5 | import { Container, Image } from 'react-bootstrap';\n 6 | import queryString from 'query-string'\n 7 | import ohuh from '../ohuh-sm.PNG';","'error' is assigned a value but never used.","React Hook useEffect has missing dependencies: 'getAssociation', 'getBookmark', 'props.history', and 'search'. Either include them or remove the dependency array.",["75"],"react/jsx-no-duplicate-props","No duplicate props allowed","JSXAttribute","no-native-reassign",["76"],"no-negated-in-lhs",["77"],{"desc":"78","fix":"79"},{"desc":"80","fix":"81"},"no-global-assign","no-unsafe-negation","Update the dependencies array to be: [getBookmark]",{"range":"82","text":"83"},"Update the dependencies array to be: [getAssociation, getBookmark, props.history, search, state]",{"range":"84","text":"85"},[2593,2595],"[getBookmark]",[2100,2107],"[getAssociation, getBookmark, props.history, search, state]"]
\ No newline at end of file \ No newline at end of file
...@@ -56,24 +56,15 @@ function App() { ...@@ -56,24 +56,15 @@ function App() {
<> <>
<style type="text/css"> <style type="text/css">
{` {`
@font-face { .nav-link{
font-family: 'Jal_Onuel'; color: #17a2b8;
src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_20-10-21@1.0/Jal_Onuel.woff') format('woff');
font-weight: normal;
font-style: normal;
}
body{font-family:'Jal_Onuel'}
Nav{
font-color: 'red';
} }
`} `}
</style> </style>
<Container className="vh-100 "> <Container className="vh-100 ">
<Col xs={12} > <Col xs={12} >
<Nav className="justify-content-end" bg="#fff" variant="light" style={{}} > <Nav className="justify-content-end" bg="#fff" variant="light" id="nav">
{user ? <> {user ? <>
<Nav.Link onClick={() => handleLogout()}>로그아웃</Nav.Link> <Nav.Link onClick={() => handleLogout()}>로그아웃</Nav.Link>
<Nav.Link href='/bookmark'>북마크</Nav.Link> <Nav.Link href='/bookmark'>북마크</Nav.Link>
...@@ -100,13 +91,13 @@ function App() { ...@@ -100,13 +91,13 @@ function App() {
aria-describedby="inputGroup-sizing-sm" aria-describedby="inputGroup-sizing-sm"
onChange={handleChange} onChange={handleChange}
/> />
<InputGroup.Append> <InputGroup.Append >
<Button type='submit' variant="outline-secondary">검색</Button> <Button type='submit' variant="outline-secondary">검색</Button>
</InputGroup.Append> </InputGroup.Append>
</InputGroup> </InputGroup>
</Form> </Form>
</Row> </Row>
<div class="row mb-2"> {/* <div class="row mb-2">
<div class="col-md-6"> <div class="col-md-6">
<div class="row g-0 border rounded overflow-hidden flex-md-row mb-4 shadow-sm h-md-250 position-relative"> <div class="row g-0 border rounded overflow-hidden flex-md-row mb-4 shadow-sm h-md-250 position-relative">
<div class="col p-4 d-flex flex-column position-static"> <div class="col p-4 d-flex flex-column position-static">
...@@ -139,40 +130,42 @@ function App() { ...@@ -139,40 +130,42 @@ function App() {
</div> </div>
</div> </div>
</div> </div>
</div> </div> */}
{/* <Row xs={6}> <Row xs={6}>
<Col md={6} xs={12}> <Col md={6} xs={12}>
<h1 className=" d-flex justify-content-center" style={{ marginBottom: "7%" ,marginTop:"30%" }}>인기관광지</h1> <Card border="info" style={{ margin: "3%" }}>
<Card align="center" border="info" style={{ margin: "3%" }}> <Card.Title style={{ margin: "0", paddingTop: "3%", fontSize: '200%', fontWeight: 'bold' }} >
<Card.Header style={{ margin: "0",fontSize: '200%', fontWeight: 'bold' }} >{recommend.name}</Card.Header> <Row style={{ fontSize: "60%", marginLeft: "7%" }}><strong class="border p-2 text-danger mb-2">인기관광지</strong></Row>
<Card.Img variant="top" style={{ padding: "5%", width: "100%", height: "340px" }} src={recommend.img} /> <Row style={{ fontSize: "100%", marginLeft: "8%" }}>{recommend.name}</Row></Card.Title>
<Card.Body > <Card.Img variant="top" style={{ padding: "5%", width: "100%", height: "340px" }} src={recommend.img} />
<Card.Text style={{ overflow: 'auto', fontSize: '25px', width: '100%', height: "80px" }} > <Card.Body style={{ paddingTop: "0" }} >
{recommend.address} </Card.Text> <Card.Text style={{ margin: "0", overflow: 'auto', fontSize: '130%', width: '100%', height: "60px" }} >
{recommend.address} </Card.Text>
<Link to={`/place?id=${1}&place=${recommend.name}`} > <Link to={`/place?id=${1}&place=${recommend.name}`} >
<Button variant="info"> {recommend.name} 자세히 살펴보기</Button> <Button variant="info"> {recommend.name} 자세히 살펴보기</Button>
</Link> </Link>
</Card.Body> </Card.Body>
</Card> </Card>
</Col> </Col>
<Col md={6} xs={12}> <Col md={6} xs={12}>
<h1 className=" d-flex justify-content-center" style={{ marginBottom: "7%",marginTop:"30%" }}>최근 검색관광지</h1> <Card border="info" style={{ margin: "3%" }} >
<Card align="center" border="info" style={{ margin: "3%" }} > <Card.Title style={{ margin: "0", paddingTop: "3%", fontSize: '200%', fontWeight: 'bold' }} >
<Card.Header style={{ margin: "0", fontSize: '200%', fontWeight: 'bold'}} bg="danger">{latest.name}</Card.Header> <Row style={{ fontSize: "60%", marginLeft: "7%" }}><strong class="border p-2 text-success mb-2">최근 검색 관광지</strong></Row>
<Card.Img variant="top" style={{ padding: "5%", width: "100%", height: "340px" }} src={latest.img} /> <Row style={{ fontSize: "100%", marginLeft: "8%" }}>{latest.name}</Row></Card.Title>
<Card.Body > <Card.Img variant="top" style={{ padding: "5%", width: "100%", height: "340px" }} src={latest.img} />
<Card.Text style={{ overflow: 'auto', fontSize: '25px', width: '100%', height: "80px" }} > <Card.Body style={{ paddingTop: "0" }}>
{latest.address} </Card.Text> <Card.Text style={{ margin: "0", overflow: 'auto', fontSize: '130%', width: '100%', height: "60px" }} >
<Link to={`/place?id=${1}&place=${latest.name}`} > {latest.address} </Card.Text>
<Button variant="info"> {latest.name} 자세히 살펴보기</Button> <Link to={`/place?id=${1}&place=${latest.name}`} >
</Link> <Button variant="info"> {latest.name} 자세히 살펴보기</Button>
</Card.Body> </Link>
</Card> </Card.Body>
</Col> </Card>
</Row> */} </Col>
</Row>
</Col> </Col>
</Container> </Container>
</> </>
......
...@@ -82,16 +82,12 @@ function Search(props) { ...@@ -82,16 +82,12 @@ function Search(props) {
} }
async function handlebookmark(index, place) { async function handlebookmark(index, place) {
if (!bookmark[index]) { const include = bookmark.findIndex(i => i.name === place.name) !== -1
console.log(pagePlace[index]) if (!include) {
try { try {
const response = await axios.put(`/api/users/bookmark?ID=${user}&place=${pagePlace[index]._id}`) const response = await axios.put(`/api/users/bookmark?ID=${user}&place=${pagePlace[index]._id}`)
alert(response.data, '북마크가 저장되었습니다.') alert(response.data, '북마크가 저장되었습니다.')
const showArr = bookmark
showArr[index] = true
setBookmark(showArr)
getBookmark() getBookmark()
console.log("bookmark111111=", bookmark)
} catch (error) { } catch (error) {
catchErrors(error, setError) catchErrors(error, setError)
} }
...@@ -99,12 +95,7 @@ function Search(props) { ...@@ -99,12 +95,7 @@ function Search(props) {
try { try {
const response = await axios.delete(`/api/users/bookmark?ID=${user}&place=${pagePlace[index]._id}`) const response = await axios.delete(`/api/users/bookmark?ID=${user}&place=${pagePlace[index]._id}`)
alert(response.data, '저장된 북마크가 삭제되었습니다.') alert(response.data, '저장된 북마크가 삭제되었습니다.')
const showArr = bookmark
showArr[index] = false
setBookmark(showArr)
getBookmark() getBookmark()
console.log("bookmark2222222=", bookmark)
} catch (error) { } catch (error) {
catchErrors(error, setError) catchErrors(error, setError)
} }
......
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