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
butter-studio
Commits
a7e6bbcf
Commit
a7e6bbcf
authored
Jul 21, 2021
by
Kim, Subin
Browse files
client search
parent
48405aa5
Changes
2
Hide whitespace changes
Inline
Side-by-side
client/src/components/Navs/MainNav.js
View file @
a7e6bbcf
...
...
@@ -3,7 +3,7 @@ import { useHistory } from "react-router";
import
Search
from
"
../Search
"
;
const
MainNav
=
()
=>
{
const
[
search
,
setSearch
]
=
useState
({
keyword
:
""
})
const
[
search
,
setSearch
]
=
useState
({
type
:
"
home
"
,
keyword
:
""
})
const
history
=
useHistory
()
function
searchMovie
()
{
...
...
@@ -15,7 +15,7 @@ const MainNav = () => {
<
a
class
=
"
nav-link text-white
"
href
=
"
/movielist
"
>
영화
<
/a
>
<
a
class
=
"
nav-link text-white
"
href
=
"
/ticket
"
>
빠른예매
<
/a
>
<
a
class
=
"
nav-link text-white
"
href
=
"
#
"
>
극장
<
/a
>
<
Search
type
=
"
home
"
search
=
{
search
}
setSearch
=
{
setSearch
}
handleClick
=
{
searchMovie
}
/
>
<
Search
search
=
{
search
}
setSearch
=
{
setSearch
}
handleClick
=
{
searchMovie
}
/
>
<
/nav
>
)
}
...
...
client/src/components/SearchResult.js
View file @
a7e6bbcf
...
...
@@ -18,7 +18,7 @@ const SearchResult = () => {
async
function
findforKeyword
()
{
try
{
setError
(
""
)
const
{
count
,
results
}
=
await
movieApi
.
search
(
title
)
const
{
count
,
results
}
=
await
movieApi
.
search
(
{
type
:
"
home
"
,
keyword
:
title
}
)
setResult
([...
results
])
}
catch
(
error
)
{
catchErrors
(
error
,
setError
)
...
...
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