bluejoyq

add loading animation

{
"devToolsPort": 19002,
"expoServerPort": 19000,
"packagerPort": 19001,
"packagerPid": 12024,
"packagerPort": null,
"packagerPid": null,
"expoServerNgrokUrl": "https://s4-47j.anonymous.searchguide.exp.direct",
"packagerNgrokUrl": "https://packager.s4-47j.anonymous.searchguide.exp.direct",
"ngrokPid": 22188
"ngrokPid": 31700
}
......
import React from 'react';
import { View} from 'react-native';
import { View, ScrollView} from 'react-native';
import {connect} from 'react-redux'
import Icon from 'react-native-vector-icons/FontAwesome';
import SearchBar from '../SearchBar/SearchBar';
......@@ -10,9 +10,11 @@ const Home = ({searchResults}) => {
return(
<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}/>
))}
</ScrollView>
</View>
)
......
......@@ -4,19 +4,12 @@ import { connect } from 'react-redux';
import Loading from '../Loading/Loading';
const Main = ({ isLoading}) => {
if ( isLoading ) {
return(
<>
<Loading / >
<AppTabContainer />
</>
)
}
else{
return (
<AppTabContainer />
)
}
return (
<>
{ isLoading && (<Loading />) }
<AppTabContainer />
</>
)
}
const MainContainer = ({isLoading}) => {
......