Commit fb137040 by Tonk

fix home searchbar

parent cf4ced4f
......@@ -29,6 +29,7 @@ class ChangePassword extends React.Component {
<View style={styles.container}>
<Text style={theme.description}>Current Password</Text>
<Field
hideCheckmark
forwardRef
ref={c => (this.currentPass = c)}
refField="currentPass"
......
import React, { Component } from 'react';
import { Field, reduxForm } from 'redux-form';
import { View, KeyboardAvoidingView } from 'react-native';
import { KeyboardAvoidingView } from 'react-native';
import Input from './Input';
import { theme } from '../../constants/Styles';
import GradientBtn from '../GradientBtn';
......@@ -28,7 +28,7 @@ class Login extends Component {
keyboardType="default"
component={Input}
validate={[required]}
placeholder={'Username'}
placeholder={'E-mail'}
/>
<Field
hideCheckmark
......
......@@ -84,7 +84,19 @@ class SmartMeterScreen extends PureComponent {
const { data } = this.state;
return !error ? (
<>
<View style={[theme.container, theme.containerWithPadding]}>
<Text style={[theme.smallTitle, theme.textDark, { marginBottom: 10 }]}>Smart Device</Text>
<SearchBar
containerStyle={styles.searchBarContainer}
inputContainerStyle={styles.searchBarInputContainer}
inputStyle={theme.normalText}
lightTheme
placeholder="Search..."
onChangeText={text => this.updateSearch(text)}
value={this.state.search}
/>
<FlatList
refreshControl={
<RefreshControl
......@@ -96,8 +108,7 @@ class SmartMeterScreen extends PureComponent {
colors={[color.primary]}
/>
}
style={[theme.container]}
contentContainerStyle={[theme.containerWithPadding, { paddingBottom: isIphoneX() ? 90 : 55 }]} //iPhoneX BottomSpace = 34
contentContainerStyle={{ paddingBottom: isIphoneX() ? 90 : 55 }} //iPhoneX BottomSpace = 34
data={data}
extraData={this.props || this.state}
keyExtractor={(item, index) => item.deviceId}
......@@ -109,24 +120,9 @@ class SmartMeterScreen extends PureComponent {
</Text>
</View>
)}
ListHeaderComponent={() => (
<>
<Text style={[theme.smallTitle, theme.textDark, { marginBottom: 10 }]}>Smart Device</Text>
<SearchBar
containerStyle={styles.searchBarContainer}
inputContainerStyle={styles.searchBarInputContainer}
inputStyle={theme.normalText}
lightTheme
placeholder="Search..."
onChangeText={text => this.updateSearch(text)}
value={this.state.search}
/>
</>
)}
renderItem={(item, index) => this.renderItem(item)}
/>
</>
</View>
) : (
<View>
<Text>{'Something went wrong ' + error}</Text>
......@@ -137,8 +133,6 @@ class SmartMeterScreen extends PureComponent {
const styles = StyleSheet.create({
searchBarContainer: {
flex: 1,
display: 'flex',
backgroundColor: 'transparent',
height: 35,
padding: 0,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment