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
4fb36f66
Commit
4fb36f66
authored
Jan 20, 2021
by
Lee SeoYeon
Browse files
.
parent
d88a9d19
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
client/.eslintcache
View file @
4fb36f66
This diff is collapsed.
Click to expand it.
client/src/Search.js
View file @
4fb36f66
...
...
@@ -6,6 +6,7 @@ import { Container, Form, Row, Col, Card, Image, InputGroup, FormControl, Button
import
Paginations
from
'
./pagination.js
'
;
import
{
addFavorite
}
from
'
./Bookmark.js
'
function
Search
(
props
)
{
const
endPage
=
10
;
const
[
state
,
setState
]
=
useState
(
false
);
...
...
@@ -19,7 +20,7 @@ function Search(props) {
setMobile
(
true
)
}
else
{
setMobile
(
false
)
}
}
},
[]);
const
places
=
[{
...
...
@@ -449,65 +450,93 @@ function Search(props) {
return
page
}
function
addicon
()
{
const
[
show
,
setShow
]
=
useState
(
false
);
const
handleClose
=
()
=>
setShow
(
false
);
const
handleShow
=
()
=>
setShow
(
true
);
const
pagePlace
=
paginate
(
places
,
index
)
return
(
<
Container
>
<
Link
to
=
"
/
"
className
=
"
d-flex justify-content-center
"
><
Image
src
=
{
ohuh
}
/></
Link
>
const
pagePlace
=
paginate
(
places
,
index
)
<
Row
className
=
"
mb-2
"
className
=
"
d-flex justify-content-center
"
>
<
Form
style
=
{{
width
:
"
90vw
"
}}
onSubmit
=
{
handleSubmit
}
>
<
InputGroup
size
=
"
lg
"
>
<
Link
to
=
"
/
"
>
<
Col
>
{
/* <Image src={ohuh} fluid width="130px" /> */
}
<
/Col
>
<
/Link
>
<
FormControl
placeholder
=
"
검색어를 입력하세요.
"
value
=
{
search
}
aria
-
label
=
"
Large
"
aria
-
describedby
=
"
inputGroup-sizing-sm
"
onChange
=
{
handleChange
}
/
>
<
InputGroup
.
Append
>
<
Button
type
=
"
submit
"
variant
=
"
outline-secondary
"
style
=
{{
maxHeight
:
"
8vh
"
,
maxWidth
:
"
14vh
"
}}
>
검색
<
/Button
>
<
/InputGroup.Append
>
<
/InputGroup
>
<
/Form
>
<
/Row
>
<
Row
className
=
"
d-flex flex-wrap
"
>
{
pagePlace
.
map
((
place
,
index
)
=>
{
return
(
<
Col
key
=
{
index
}
md
=
{
6
}
>
<
Card
align
=
"
center
"
border
=
"
info
"
style
=
{{
margin
:
"
3%
"
}}
>
<
Card
.
Title
style
=
{{
margin
:
"
3%
"
,
fontSize
:
'
200%
'
,
fontWeight
:
'
bold
'
}}
>
{
place
.
name
}
<
/Card.Title
>
<
Card
.
Img
variant
=
"
top
"
style
=
{{
padding
:
"
5%
"
,
width
:
"
100%
"
,
height
:
"
340px
"
}}
src
=
{
place
.
img
}
/
>
<
Card
.
Body
>
<
Card
.
Text
style
=
{{
overflow
:
'
auto
'
,
fontSize
:
'
25px
'
,
width
:
'
100%
'
,
height
:
"
80px
"
}}
>
{
place
.
address
}
<
/Card.Text
>
<
Button
variant
=
"
primary
"
onClick
=
{()
=>
{
const
showArr
=
[
false
,
false
,
false
,
false
]
showArr
[
index
]
=
true
setShowSet
(
showArr
)
}}
>
{
place
.
name
}
자세히
살펴보기
<
/Button
>
<
Place
search
=
{
place
}
index
=
{
index
}
show
=
{
showSet
[
index
]}
onHide
=
{()
=>
setShowSet
([
false
,
false
,
false
,
false
])}
/
>
<
/Card.Body
>
return
(
<
Container
>
<
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
"
>
<
Link
to
=
"
/
"
>
<
Col
>
{
/* <Image src={ohuh} fluid width="130px" /> */
}
<
/Col
>
<
/Link
>
<
FormControl
placeholder
=
"
검색어를 입력하세요.
"
value
=
{
search
}
aria
-
label
=
"
Large
"
aria
-
describedby
=
"
inputGroup-sizing-sm
"
onChange
=
{
handleChange
}
/
>
<
InputGroup
.
Append
>
<
Button
type
=
"
submit
"
variant
=
"
outline-secondary
"
style
=
{{
maxHeight
:
"
8vh
"
,
maxWidth
:
"
14vh
"
}}
>
검색
<
/Button
>
<
/InputGroup.Append
>
<
/InputGroup
>
<
/Form
>
<
/Row
>
<
Row
className
=
"
d-flex flex-wrap
"
>
{
pagePlace
.
map
((
place
,
index
)
=>
{
return
(
<
Col
key
=
{
index
}
md
=
{
6
}
>
<
Card
align
=
"
center
"
border
=
"
info
"
style
=
{{
margin
:
"
3%
"
}}
>
<
Card
.
Title
style
=
{{
margin
:
"
3%
"
,
fontSize
:
'
200%
'
,
fontWeight
:
'
bold
'
}}
>
{
place
.
name
}
<
Button
onClick
=
{
handleShow
}
>
<
Modal
show
=
{
show
}
onHide
=
{
handleClose
}
backdrop
=
"
static
"
keyboard
=
{
false
}
><
Form
>
<
Form
.
Group
controlId
=
"
formBasicEmail
"
>
<
Form
.
Label
>
이름
<
/Form.Label
>
<
Form
.
Control
type
=
"
email
"
placeholder
=
"
Enter email
"
/>
<
Form
.
Text
className
=
"
text-muted
"
>
We
'
ll never share your email with anyone else.
</Form.Text>
</Form.Group>
<Form.Group controlId="formBasicPassword">
<Form.Label>폴더</Form.Label>
<Form.Control type="password" placeholder="Password" />
</Form.Group>
<Form.Group controlId="formBasicCheckbox">
<Form.Check type="checkbox" label="Check me out" />
</Form.Group>
<Button variant="primary" type="submit">
Submit
</Button>
</Form></Modal></Button></Card.Title>
<Card.Img variant="top" style={{ padding: "5%", width: "100%", height: "340px" }} src={place.img} />
<Card.Body >
<Card.Text style={{ overflow:
'
auto
'
, fontSize:
'
25
px
'
, width:
'
100
%
'
, height: "80px" }} >
{place.address} </Card.Text>
<Button variant="primary" onClick={() => {
const showArr = [false, false, false, false]
showArr[index] = true
setShowSet(showArr)
}}>{place.name} 자세히 살펴보기</Button>
<Place search={place} index={index} show={showSet[index]} onHide={() => setShowSet([false, false, false, false])} />
</Card.Body>
</Card>
</Col>
)
})}
</Row>
{
console
.
log
(
showSet
)}
{
/* show가 전부 true로 바뀌어서 전부 다 보이게 되는 것이다. */
}
<
Row
className
=
"
mt-2 d-flex justify-content-center
"
>
<
Paginations
index
=
{
index
}
endPage
=
{
endPage
}
handlePage
=
{
handlePage
}
><
/Paginations
>
<
/Row
>
{
console.log(showSet)
}
{/* show가 전부 true로 바뀌어서 전부 다 보이게 되는 것이다. */
}
<Row className="mt-2 d-flex justify-content-center">
<Paginations index={index} endPage={endPage} handlePage={handlePage}></Paginations>
</Row>
</Container>
);
}
export
default
Search
;
export default Search
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