Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
search-page
Commits
ea78c498
Commit
ea78c498
authored
Feb 02, 2021
by
baesangjune
Browse files
Merge remote-tracking branch 'origin/cherry' into BAE
parents
c7c00c29
32ab85d9
Changes
3
Hide whitespace changes
Inline
Side-by-side
client/src/Pages/App.js
View file @
ea78c498
...
...
@@ -96,7 +96,7 @@ function App() {
<
h3
class
=
"
mb-0
"
>
{
recommend
.
name
}
<
/h3
>
<
Image
variant
=
"
top
"
style
=
{{
padding
:
"
5%
"
,
width
:
"
100%
"
,
height
:
"
340px
"
}}
src
=
{
recommend
.
img
}
/
>
<
p
class
=
"
card-text mb-auto
"
>
{
recommend
.
address
}
<
/p
>
<
Link
to
=
{
`/place?
id=
${
1
}
&place
=
${
recommend
.
name
}
`
}
>
<
Link
to
=
{
`/place?
name=
${
recommend
.
name
}
&src=
${
recommend
.
img
}
&address
=
${
recommend
.
address
}
`
}
>
<
Button
variant
=
"
info
"
>
{
recommend
.
name
}
자세히
살펴보기
<
/Button
>
<
/Link
>
<
/div
>
...
...
@@ -112,7 +112,7 @@ function App() {
<
h3
class
=
"
mb-0
"
>
{
latest
.
name
}
<
/h3
>
<
Image
variant
=
"
top
"
style
=
{{
padding
:
"
5%
"
,
width
:
"
100%
"
,
height
:
"
340px
"
}}
src
=
{
latest
.
img
}
/
>
<
p
class
=
"
mb-auto
"
>
{
latest
.
address
}
<
/p
>
<
Link
to
=
{
`/place?
id=
${
1
}
&place
=
${
latest
.
name
}
`
}
>
<
Link
to
=
{
`/place?
name=
${
latest
.
name
}
&src=
${
latest
.
img
}
&address
=
${
latest
.
address
}
`
}
>
<
Button
variant
=
"
info
"
>
{
latest
.
name
}
자세히
살펴보기
<
/Button
>
<
/Link
>
<
/div
>
...
...
client/src/Pages/Bookmark.js
View file @
ea78c498
...
...
@@ -68,16 +68,7 @@ function Bookmark() {
return
(
<
Container
>
{
/* <Link to="/" >
<Image style={{ margin: "1%" }} src={ohuh} />
</Link>
<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
style
=
{{
margin
:
"
1%
"
}}
src
=
{
ohuh
}
/></
Link
>
<
Link
to
=
"
/
"
><
Image
style
=
{{
margin
:
"
1%
"
}}
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
>
...
...
@@ -104,7 +95,7 @@ function Bookmark() {
<
Card
.
Body
>
<
Card
.
Text
style
=
{{
overflow
:
'
auto
'
,
fontSize
:
'
25px
'
,
width
:
'
100%
'
,
height
:
"
80px
"
}}
>
{
place
.
address
}
<
/Card.Text
>
<
Link
to
=
{
`/place?
&place
=
${
place
.
name
}
`
}
>
<
Link
to
=
{
`/place?
name=
${
place
.
name
}
&src=
${
place
.
img
}
&address
=
${
place
.
address
}
`
}
>
<
Button
variant
=
"
info
"
>
{
place
.
name
}
자세히
살펴보기
<
/Button
>
<
/Link
>
<
/Card.Body
>
...
...
client/src/Pages/Search.js
View file @
ea78c498
...
...
@@ -7,7 +7,9 @@ import axios from 'axios';
import
queryString
from
'
query-string
'
import
*
as
Icon
from
'
react-bootstrap-icons
'
;
import
{
isAuthenticated
}
from
'
../utils/auth
'
;
import
catchErrors
from
'
../utils/catchErrors
'
import
catchErrors
from
'
../utils/catchErrors
'
;
import
_
from
'
lodash
'
;
function
Search
(
props
)
{
...
...
@@ -43,14 +45,8 @@ function Search(props) {
}
useEffect
(()
=>
{
if
(
association
.
length
<
3
)
{
setPagePlace
(
paginate
(
association
,
index
,
association
.
length
))
}
else
{
setPagePlace
(
paginate
(
association
,
index
,
4
))
}
setEndPage
(
Math
.
floor
((
association
.
length
/
4
)))
setPagePlace
(
paginate
(
association
,
index
,
4
))
setEndPage
(
Math
.
ceil
((
association
.
length
/
4
)))
},
[
association
,
index
])
useEffect
(()
=>
{
...
...
@@ -59,21 +55,8 @@ function Search(props) {
if
(
state
)
{
props
.
history
.
push
(
'
/search?keyword=
'
+
search
)
setState
(
false
)
}
window
.
addEventListener
(
"
scroll
"
,
infiniteScroll
);
return
()
=>
{
window
.
removeEventListener
(
"
scroll
"
,
infiniteScroll
);
}
},
[
state
]);
const
infiniteScroll
=
()
=>
{
const
{
documentElement
,
body
}
=
document
;
const
scrollHeight
=
Math
.
max
(
documentElement
.
scrollHeight
,
body
.
scrollHeight
);
const
scrollTop
=
Math
.
max
(
documentElement
.
scrollTop
,
body
.
scrollTop
);
const
clientHeight
=
documentElement
.
clientHeight
;
if
(
scrollTop
+
clientHeight
>=
scrollHeight
)
{
// getReview();
console
.
log
(
"
더불러
"
)
}
console
.
log
(
scrollHeight
,
scrollTop
,
clientHeight
)
}
},
[
state
]);
const
handlePage
=
(
num
)
=>
{
setIndex
(
num
);
...
...
@@ -81,7 +64,6 @@ function Search(props) {
console
.
log
(
index
)
}
const
handleChange
=
(
e
)
=>
{
setSearch
(
e
.
target
.
value
);
}
...
...
@@ -94,14 +76,12 @@ function Search(props) {
}
function
paginate
(
items
,
pageNumber
,
itemNumber
)
{
const
page
=
[];
const
startIndex
=
(
pageNumber
-
1
)
*
itemNumber
for
(
var
i
=
0
;
i
<
itemNumber
;
i
++
)
{
page
.
push
(
items
[(
startIndex
+
i
)]
)
}
console
.
log
(
"
뿌릴 data22222222222222222
"
,
page
)
return
page
return
_
(
items
)
.
slice
(
startIndex
)
.
take
(
itemNumber
)
.
value
();
}
async
function
handlebookmark
(
index
,
place
)
{
...
...
@@ -132,7 +112,7 @@ function Search(props) {
}
return
(
<
Container
>
<
Link
to
=
"
/
"
><
Image
src
=
{
ohuh
}
/></
Link
>
<
Link
to
=
"
/
"
><
Image
src
=
{
ohuh
}
/></
Link
>
<
Row
className
=
"
mb-2
"
className
=
"
d-flex justify-content-center
"
>
<
Form
style
=
{{
width
:
"
90vw
"
}}
onSubmit
=
{
handleSubmit
}
>
<
InputGroup
size
=
"
lg
"
>
...
...
@@ -172,7 +152,7 @@ function Search(props) {
<
Card
.
Body
>
<
Card
.
Text
style
=
{{
overflow
:
'
auto
'
,
fontSize
:
'
25px
'
,
width
:
'
100%
'
,
height
:
"
80px
"
}}
>
{
place
.
address
}
<
/Card.Text
>
<
Link
to
=
{
`/place?
id=
${
index
}
&place
=
${
place
.
name
}
`
}
>
<
Link
to
=
{
`/place?
name=
${
place
.
name
}
&src=
${
place
.
img
}
&address
=
${
place
.
address
}
`
}
>
<
Button
variant
=
"
info
"
>
{
place
.
name
}
자세히
살펴보기
<
/Button
>
<
/Link
>
<
/Card.Body
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment