Skip to content

Commit

Permalink
fixed breaking issues in search and error in ListItem
Browse files Browse the repository at this point in the history
  • Loading branch information
dabit3 committed Sep 22, 2016
1 parent 3c30a31 commit 1d30c28
Show file tree
Hide file tree
Showing 3 changed files with 128 additions and 122 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-elements",
"version": "0.5.3",
"version": "0.5.4",
"description": "React Native Elements & UI Toolkit",
"main": "src/index.js",
"repository": {
Expand Down
245 changes: 124 additions & 121 deletions src/input/Search.js
Original file line number Diff line number Diff line change
@@ -1,129 +1,132 @@
import React, { PropTypes } from 'react'
import React, { PropTypes, Component } from 'react'
import { View, StyleSheet, TextInput } from 'react-native'
import Icon from 'react-native-vector-icons/MaterialIcons'
import colors from '../config/colors'

const Search = ({
containerStyle,
inputStyle,
icon,
noIcon,
lightTheme,
round,
/* inherited props */
value,
autoCapitalize,
autoCorrect,
autoFocus,
blurOnSubmit,
defaultValue,
editable,
keyboardType,
maxLength,
multiline,
onBlur,
onChange,
onChangeText,
onContentSizeChange,
onEndEditing,
onFocus,
onLayout,
onSelectionChange,
onSubmitEditing,
placeholder,
placeholderTextColor,
returnKeyType,
secureTextEntry,
selectTextOnFocus,
selectionColor,
inlineImageLeft,
inlineImagePadding,
numberOfLines,
returnKeyLabel,
underlineColorAndroid,
clearButtonMode,
clearTextOnFocus,
dataDetectorTypes,
enablesReturnKeyAutomatically,
keyboardAppearance,
onKeyPress,
selectionState,
isFocused,
clear,
textInputRef,
containerRef
}) => {
return (
<View
ref={containerRef}
style={[
styles.container,
lightTheme && styles.containerLight,
containerStyle && containerStyle
]}>
<TextInput
ref={textInputRef}
autoCapitalize={autoCapitalize}
autoCorrect={autoCorrect}
autoFocus={autoFocus}
blurOnSubmit={blurOnSubmit}
defaultValue={defaultValue}
keyboardType={keyboardType}
maxLength={maxLength}
multiline={multiline}
onBlur={onBlur}
onChange={onChange}
onChangeText={onChangeText}
onContentSizeChange={onContentSizeChange}
onEndEditing={onEndEditing}
onFocus={onFocus}
onLayout={onLayout}
onSelectionChange={onSelectionChange}
onSubmitEditing={onSubmitEditing}
placeholder={placeholder}
placeholderTextColor={placeholderTextColor}
returnKeyType={returnKeyType}
secureTextEntry={secureTextEntry}
selectTextOnFocus={selectTextOnFocus}
inlineImageLeft={inlineImageLeft}
inlineImagePadding={inlineImagePadding}
numberOfLines={numberOfLines}
returnKeyLabel={returnKeyLabel}
underlineColorAndroid={underlineColorAndroid}
clearButtonMode={clearButtonMode}
clearTextOnFocus={clearTextOnFocus}
dataDetectorTypes={dataDetectorTypes}
enablesReturnKeyAutomatically={enablesReturnKeyAutomatically}
keyboardAppearance={keyboardAppearance}
onKeyPress={onKeyPress}
selectionState={selectionState}
editable={editable}
isFocused={isFocused}
clear={clear}
selectionColor={selectionColor || colors.grey3}
value={value}
class Search extends Component {
render () {
const {
containerStyle,
inputStyle,
icon,
noIcon,
lightTheme,
round,
/* inherited props */
value,
autoCapitalize,
autoCorrect,
autoFocus,
blurOnSubmit,
defaultValue,
editable,
keyboardType,
maxLength,
multiline,
onBlur,
onChange,
onChangeText,
onContentSizeChange,
onEndEditing,
onFocus,
onLayout,
onSelectionChange,
onSubmitEditing,
placeholder,
placeholderTextColor,
returnKeyType,
secureTextEntry,
selectTextOnFocus,
selectionColor,
inlineImageLeft,
inlineImagePadding,
numberOfLines,
returnKeyLabel,
underlineColorAndroid,
clearButtonMode,
clearTextOnFocus,
dataDetectorTypes,
enablesReturnKeyAutomatically,
keyboardAppearance,
onKeyPress,
selectionState,
isFocused,
clear,
textInputRef,
containerRef
} = this.props
return (
<View
ref={containerRef}
style={[
styles.input,
lightTheme && styles.inputLight,
noIcon && {paddingLeft: 9},
round && {borderRadius: 15},
inputStyle && inputStyle
]} />
{
!noIcon && (
<Icon
size={16}
style={[
styles.icon,
icon.style && icon.style
]}
name={icon.name || 'search'}
color={icon.color || colors.grey3}
/>
)
}
</View>
)
styles.container,
lightTheme && styles.containerLight,
containerStyle && containerStyle
]}>
<TextInput
ref={textInputRef}
autoCapitalize={autoCapitalize}
autoCorrect={autoCorrect}
autoFocus={autoFocus}
blurOnSubmit={blurOnSubmit}
defaultValue={defaultValue}
keyboardType={keyboardType}
maxLength={maxLength}
multiline={multiline}
onBlur={onBlur}
onChange={onChange}
onChangeText={onChangeText}
onContentSizeChange={onContentSizeChange}
onEndEditing={onEndEditing}
onFocus={onFocus}
onLayout={onLayout}
onSelectionChange={onSelectionChange}
onSubmitEditing={onSubmitEditing}
placeholder={placeholder}
placeholderTextColor={placeholderTextColor}
returnKeyType={returnKeyType}
secureTextEntry={secureTextEntry}
selectTextOnFocus={selectTextOnFocus}
inlineImageLeft={inlineImageLeft}
inlineImagePadding={inlineImagePadding}
numberOfLines={numberOfLines}
returnKeyLabel={returnKeyLabel}
underlineColorAndroid={underlineColorAndroid}
clearButtonMode={clearButtonMode}
clearTextOnFocus={clearTextOnFocus}
dataDetectorTypes={dataDetectorTypes}
enablesReturnKeyAutomatically={enablesReturnKeyAutomatically}
keyboardAppearance={keyboardAppearance}
onKeyPress={onKeyPress}
selectionState={selectionState}
editable={editable}
isFocused={isFocused}
clear={clear}
selectionColor={selectionColor || colors.grey3}
value={value}
style={[
styles.input,
lightTheme && styles.inputLight,
noIcon && {paddingLeft: 9},
round && {borderRadius: 15},
inputStyle && inputStyle
]} />
{
!noIcon && (
<Icon
size={16}
style={[
styles.icon,
icon.style && icon.style
]}
name={icon.name || 'search'}
color={icon.color || colors.grey3}
/>
)
}
</View>
)
}
}

Search.propTypes = {
Expand Down
3 changes: 3 additions & 0 deletions src/list/ListItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ const ListItem = ({
if (component) {
Component = component
}
if (typeof avatar === 'string') {
avatar = {uri: avatar}
}
return (
<Component
onPress={onPress}
Expand Down

0 comments on commit 1d30c28

Please sign in to comment.