bluejoyq

add promptSearch.js

1 { 1 {
2 "devToolsPort": 19002, 2 "devToolsPort": 19002,
3 "expoServerPort": 19000, 3 "expoServerPort": 19000,
4 - "packagerPort": null, 4 + "packagerPort": 19001,
5 - "packagerPid": null, 5 + "packagerPid": 23132,
6 - "expoServerNgrokUrl": "https://s4-47j.anonymous.searchguide.exp.direct", 6 + "expoServerNgrokUrl": null,
7 - "packagerNgrokUrl": "https://packager.s4-47j.anonymous.searchguide.exp.direct", 7 + "packagerNgrokUrl": null,
8 - "ngrokPid": 31700 8 + "ngrokPid": null
9 } 9 }
......
1 import React from 'react'; 1 import React from 'react';
2 -import { View, ScrollView} from 'react-native'; 2 +import { View, ScrollView,Text } from 'react-native';
3 import {connect} from 'react-redux' 3 import {connect} from 'react-redux'
4 import Icon from 'react-native-vector-icons/FontAwesome'; 4 import Icon from 'react-native-vector-icons/FontAwesome';
5 import SearchBar from '../SearchBar/SearchBar'; 5 import SearchBar from '../SearchBar/SearchBar';
6 import SearchCard from '../SearchCard/SearchCard'; 6 import SearchCard from '../SearchCard/SearchCard';
7 +import PromptSearch from '../PromptSearch/PromptSearch'
7 8
8 9
9 const Home = ({searchResults}) => { 10 const Home = ({searchResults}) => {
...@@ -11,9 +12,10 @@ const Home = ({searchResults}) => { ...@@ -11,9 +12,10 @@ const Home = ({searchResults}) => {
11 <View style={{flex: 1, backgroundColor:'#eee', margin:0,padding:0}}> 12 <View style={{flex: 1, backgroundColor:'#eee', margin:0,padding:0}}>
12 <SearchBar /> 13 <SearchBar />
13 <ScrollView> 14 <ScrollView>
14 - { searchResults && searchResults.map((searchResult, index) => ( 15 + { searchResults.length ? ( searchResults.map((searchResult, index) => (
15 - <SearchCard key={index} title={searchResult.title} content={searchResult.passage} url={searchResult.url}/> 16 + <SearchCard key={index} title={searchResult.title} content={searchResult.passage} url={searchResult.url}/>)))
16 - ))} 17 + : <PromptSearch />
18 + }
17 </ScrollView> 19 </ScrollView>
18 </View> 20 </View>
19 21
......
1 +import React from 'react';
2 +import { View,Text, StyleSheet } from 'react-native';
3 +import Icon from 'react-native-vector-icons/FontAwesome';
4 +
5 +export default PromptSearch = () => {
6 +
7 + return(
8 + <View style={styles.container} >
9 + <Icon name='search' style={styles.icon} size={50} />
10 + <Text style={styles.text}>당신이 궁금해하는</Text>
11 + <Text style={styles.text}>질문을 검색하세요</Text>
12 + <Text style={styles.subtext}>길잡이가 당신의</Text>
13 + <Text style={styles.subtext}>질문을 이해할거에요</Text>
14 + </View>
15 + )
16 +}
17 +
18 +
19 +const styles = StyleSheet.create({
20 + container: {
21 + height: 270,
22 + width: '100%',
23 + display: 'flex',
24 + alignItems: 'center',
25 + justifyContent:'center',
26 + },
27 + text:{
28 + marginBottom: 10,
29 + fontSize: 30,
30 + fontWeight: 'bold',
31 + color:'#999999',
32 + },
33 + icon: {
34 + marginBottom: 20,
35 + color: '#999999'
36 + },
37 + subtext:{
38 + marginBottom: 10,
39 + fontSize: 20,
40 + fontWeight: 'bold',
41 + color:'#999999',
42 + }
43 + });
...\ No newline at end of file ...\ No newline at end of file
...@@ -5,7 +5,7 @@ import Icon from 'react-native-vector-icons/FontAwesome'; ...@@ -5,7 +5,7 @@ import Icon from 'react-native-vector-icons/FontAwesome';
5 const Rate = () => { 5 const Rate = () => {
6 return( 6 return(
7 <View style={{flex: 1, backgroundColor:'#eee', margin:0,padding:0}}> 7 <View style={{flex: 1, backgroundColor:'#eee', margin:0,padding:0}}>
8 - <Text >평가</Text> 8 + <Text ></Text>
9 </View> 9 </View>
10 ) 10 )
11 } 11 }
......
...@@ -16,8 +16,8 @@ export const submit = (text) => async (dispatch) => { ...@@ -16,8 +16,8 @@ export const submit = (text) => async (dispatch) => {
16 try{ 16 try{
17 /*const response = await sendSearch(text);*/ 17 /*const response = await sendSearch(text);*/
18 const response = await readTest(); // 테스트용입니당~ 18 const response = await readTest(); // 테스트용입니당~
19 - dispatch( { type:SUCCESS, result:response }) 19 + //dispatch( { type:SUCCESS, result:response }
20 - //setTimeout(()=>,1000); // 셋타임아웃도 테스트용 20 + setTimeout(()=>dispatch( { type:SUCCESS, result:response }),500); // 셋타임아웃도 테스트용
21 } 21 }
22 catch(err){ 22 catch(err){
23 dispatch({ type:FAILURE, result:response }) 23 dispatch({ type:FAILURE, result:response })
......