Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2021-1-capstone-design1
/
GCL_Project1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
이승윤
2021-06-12 00:11:10 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6cd4ca8b44ad7f3f254fc486acc2c7635d944fbb
6cd4ca8b
1 parent
36eddf49
feat: 고급 검색 Input 쿼리 형식 변경
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
38 deletions
frontend/src/components/SearchOptionModal.js
frontend/src/components/SearchOptionModal.js
View file @
6cd4ca8
import
React
,
{
useRef
}
from
'react'
;
import
{
Card
}
from
'@mantine/core'
;
import
React
,
{
useRef
,
useState
}
from
'react'
;
import
{
Card
,
TextInput
}
from
'@mantine/core'
;
import
{
useHistory
}
from
'react-router-dom'
;
import
styled
from
'styled-components'
;
import
Button
from
'./common/Button'
;
import
Input
from
'./common/Input'
;
const
Background
=
styled
.
div
``
;
...
...
@@ -34,13 +34,13 @@ const CloseWrap = styled.div`
const
StandardWrap
=
styled
.
div
`
position: absolute;
width: 50px;
width:
2
50px;
top: 15px;
left: 30%;
`
;
const
AdvancedWrap
=
styled
.
div
`
width: 50px;
width:
2
50px;
position: absolute;
top: 75px;
left: 30%;
...
...
@@ -57,6 +57,11 @@ const TextWrap = styled.div`
`
;
const
Modal
=
({
showModal
,
setShowModal
})
=>
{
const
[
query
,
setQuery
]
=
useState
(
''
);
const
[
keywordQuery
,
setKeywordQuery
]
=
useState
(
''
);
const
[
writerQuery
,
setWriterQuery
]
=
useState
(
''
);
const
[
dateQuery
,
setDateQuery
]
=
useState
(
''
);
const
history
=
useHistory
();
const
modalRef
=
useRef
();
const
closeModal
=
e
=>
{
if
(
modalRef
.
current
===
e
.
target
)
{
...
...
@@ -75,47 +80,62 @@ const Modal = ({ showModal, setShowModal }) => {
기본검색
<
/TextWrap
>
<
StandardWrap
>
<
Input
float
=
"left"
color
=
"blue"
width
=
"350px"
height
=
"40px"
paddingsize
=
"3px"
fontsize
=
"15px"
<
TextInput
inputStyle
=
{{
marginBottom
:
18
,
fontSize
:
15
,
}}
placeholder
=
"내용을 입력해 주세요."
type
=
"text"
value
=
{
decodeURIComponent
(
query
)}
onChange
=
{
e
=>
setQuery
(
e
.
target
.
value
)}
onKeyPress
=
{
e
=>
{
if
(
e
.
key
===
'Enter'
)
{
if
(
query
===
''
)
{
alert
(
'검색어를 입력 해 주세요.'
);
return
;
}
const
params
=
new
URLSearchParams
({
query
});
history
.
push
(
`search?
${
decodeURIComponent
(
params
.
toString
())}
`
);
}
}}
/
>
<
/StandardWrap
>
<
TextWrap
top
=
"24%"
right
=
"10%"
bottom
=
"31%"
>
고급검색
<
/TextWrap
>
<
AdvancedWrap
>
<
Input
float
=
"left"
color
=
"blue"
width
=
"350px"
height
=
"40px"
paddingsize
=
"3px"
fontsize
=
"15px"
placeholder
=
"단어/ 문장검색"
<
TextInput
inputStyle
=
{{
marginBottom
:
18
,
fontSize
:
15
,
}}
placeholder
=
"단어/문장 검색"
type
=
"text"
value
=
{
decodeURIComponent
(
keywordQuery
)}
onChange
=
{
e
=>
setKeywordQuery
(
e
.
target
.
value
)}
/
>
<
br
/>
<
br
/>
<
Input
float
=
"left"
color
=
"blue"
width
=
"350px"
height
=
"40px
"
paddingsize
=
"3px
"
fontsize
=
"15px"
placeholder
=
"최초 작성자"
<
TextInput
inputStyle
=
{{
marginBottom
:
18
,
fontSize
:
15
,
}}
placeholder
=
"작성자
"
type
=
"text
"
value
=
{
decodeURIComponent
(
writerQuery
)}
onChange
=
{
e
=>
setWriterQuery
(
e
.
target
.
value
)}
/
>
<
br
/>
<
br
/>
<
Input
float
=
"left"
color
=
"blue"
width
=
"350px"
height
=
"40px
"
paddingsize
=
"3px
"
fontsize
=
"15px"
placeholder
=
"최종 수정자"
<
TextInput
inputStyle
=
{{
marginBottom
:
18
,
fontSize
:
15
,
}}
placeholder
=
"생성 날짜
"
type
=
"text
"
value
=
{
decodeURIComponent
(
dateQuery
)}
onChange
=
{
e
=>
setDateQuery
(
e
.
target
.
value
)}
/
>
<
/AdvancedWrap
>
<
/ModalContent
>
...
...
Please
register
or
login
to post a comment