Toggle navigation
Toggle navigation
This project
Loading...
Sign in
윤창신
/
searchGuide
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
bluejoyq
2019-11-20 19:17:16 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c57c63118afdd71b2a5cb1791e551e08810b7188
c57c6311
1 parent
98b6d6ff
add promptSearch.js
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
57 additions
and
12 deletions
searchGuide/.expo/packager-info.json
searchGuide/components/Home/Home.js
searchGuide/components/PromptSearch/PromptSearch.js
searchGuide/components/Rate/Rate.js
searchGuide/reducers/search.js
searchGuide/.expo/packager-info.json
View file @
c57c631
{
"devToolsPort"
:
19002
,
"expoServerPort"
:
19000
,
"packagerPort"
:
null
,
"packagerPid"
:
null
,
"expoServerNgrokUrl"
:
"https://s4-47j.anonymous.searchguide.exp.direct"
,
"packagerNgrokUrl"
:
"https://packager.s4-47j.anonymous.searchguide.exp.direct"
,
"ngrokPid"
:
31700
"packagerPort"
:
19001
,
"packagerPid"
:
23132
,
"expoServerNgrokUrl"
:
null
,
"packagerNgrokUrl"
:
null
,
"ngrokPid"
:
null
}
...
...
searchGuide/components/Home/Home.js
View file @
c57c631
import
React
from
'react'
;
import
{
View
,
ScrollView
}
from
'react-native'
;
import
{
View
,
ScrollView
,
Text
}
from
'react-native'
;
import
{
connect
}
from
'react-redux'
import
Icon
from
'react-native-vector-icons/FontAwesome'
;
import
SearchBar
from
'../SearchBar/SearchBar'
;
import
SearchCard
from
'../SearchCard/SearchCard'
;
import
PromptSearch
from
'../PromptSearch/PromptSearch'
const
Home
=
({
searchResults
})
=>
{
...
...
@@ -11,9 +12,10 @@ const Home = ({searchResults}) => {
<
View
style
=
{{
flex
:
1
,
backgroundColor
:
'#eee'
,
margin
:
0
,
padding
:
0
}}
>
<
SearchBar
/>
<
ScrollView
>
{
searchResults
&&
searchResults
.
map
((
searchResult
,
index
)
=>
(
<
SearchCard
key
=
{
index
}
title
=
{
searchResult
.
title
}
content
=
{
searchResult
.
passage
}
url
=
{
searchResult
.
url
}
/
>
))}
{
searchResults
.
length
?
(
searchResults
.
map
((
searchResult
,
index
)
=>
(
<
SearchCard
key
=
{
index
}
title
=
{
searchResult
.
title
}
content
=
{
searchResult
.
passage
}
url
=
{
searchResult
.
url
}
/>
))
)
:
<
PromptSearch
/>
}
<
/ScrollView
>
<
/View
>
...
...
searchGuide/components/PromptSearch/PromptSearch.js
0 → 100644
View file @
c57c631
import
React
from
'react'
;
import
{
View
,
Text
,
StyleSheet
}
from
'react-native'
;
import
Icon
from
'react-native-vector-icons/FontAwesome'
;
export
default
PromptSearch
=
()
=>
{
return
(
<
View
style
=
{
styles
.
container
}
>
<
Icon
name
=
'search'
style
=
{
styles
.
icon
}
size
=
{
50
}
/
>
<
Text
style
=
{
styles
.
text
}
>
당신이
궁금해하는
<
/Text
>
<
Text
style
=
{
styles
.
text
}
>
질문을
검색하세요
<
/Text
>
<
Text
style
=
{
styles
.
subtext
}
>
길잡이가
당신의
<
/Text
>
<
Text
style
=
{
styles
.
subtext
}
>
질문을
이해할거에요
<
/Text
>
<
/View
>
)
}
const
styles
=
StyleSheet
.
create
({
container
:
{
height
:
270
,
width
:
'100%'
,
display
:
'flex'
,
alignItems
:
'center'
,
justifyContent
:
'center'
,
},
text
:{
marginBottom
:
10
,
fontSize
:
30
,
fontWeight
:
'bold'
,
color
:
'#999999'
,
},
icon
:
{
marginBottom
:
20
,
color
:
'#999999'
},
subtext
:{
marginBottom
:
10
,
fontSize
:
20
,
fontWeight
:
'bold'
,
color
:
'#999999'
,
}
});
\ No newline at end of file
searchGuide/components/Rate/Rate.js
View file @
c57c631
...
...
@@ -5,7 +5,7 @@ import Icon from 'react-native-vector-icons/FontAwesome';
const
Rate
=
()
=>
{
return
(
<
View
style
=
{{
flex
:
1
,
backgroundColor
:
'#eee'
,
margin
:
0
,
padding
:
0
}}
>
<
Text
>
평가
<
/Text
>
<
Text
>
평
ㄴ
가
<
/Text
>
<
/View
>
)
}
...
...
searchGuide/reducers/search.js
View file @
c57c631
...
...
@@ -16,8 +16,8 @@ export const submit = (text) => async (dispatch) => {
try
{
/*const response = await sendSearch(text);*/
const
response
=
await
readTest
();
// 테스트용입니당~
dispatch
(
{
type
:
SUCCESS
,
result
:
response
})
//setTimeout(()=>,10
00); // 셋타임아웃도 테스트용
//dispatch( { type:SUCCESS, result:response }
setTimeout
(()
=>
dispatch
(
{
type
:
SUCCESS
,
result
:
response
}),
5
00
);
// 셋타임아웃도 테스트용
}
catch
(
err
){
dispatch
({
type
:
FAILURE
,
result
:
response
})
...
...
Please
register
or
login
to post a comment