File size: 1,089 Bytes
1e92f2d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
import React from 'react';
import { Button, View, Platform, Dimensions } from 'react-native';
import { connectStats } from 'react-instantsearch-native';
import { Actions } from 'react-native-router-flux';
import Spinner from './Spinner';
const { height, width } = Dimensions.get('window');
const styles = {
stats: {
position: 'absolute',
height: 100,
left: 0,
...Platform.select({
ios: {
top: height - 100,
},
android: {
top: height - 120,
paddingLeft: 10,
paddingRight: 10,
},
}),
width,
},
};
export default connectStats(({ nbHits, searchState, onSearchStateChange }) => (
<View style={styles.stats}>
<Button
title={`See ${nbHits} products`}
onPress={() =>
/* eslint-disable new-cap */
Actions.Home({
searchState,
onSearchStateChange,
})
}
/* eslint-enable new-cap */
color="#162331"
/>
<Spinner
left={Platform.OS === 'ios' ? 100 : 210}
bottom={Platform.OS === 'ios' ? 597 : 530}
/>
</View>
));
|