Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
iRoachie committed Oct 3, 2019
2 parents ee836fb + 4845537 commit ac90c75
Show file tree
Hide file tree
Showing 13 changed files with 14 additions and 37 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": "1.2.3",
"version": "1.2.4",
"description": "React Native Elements & UI Toolkit",
"main": "src/index.js",
"types": "src/index.d.ts",
Expand Down
6 changes: 0 additions & 6 deletions src/buttons/__tests__/__snapshots__/ButtonGroup.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,6 @@ exports[`ButtonGroup Component should apply values from theme 1`] = `
}
>
<Text
replaceTheme={[Function]}
style={
Object {
"color": "red",
Expand Down Expand Up @@ -606,7 +605,6 @@ exports[`ButtonGroup Component should apply values from theme 1`] = `
},
}
}
updateTheme={[Function]}
>
Button 1
</Text>
Expand Down Expand Up @@ -651,7 +649,6 @@ exports[`ButtonGroup Component should apply values from theme 1`] = `
}
>
<Text
replaceTheme={[Function]}
style={
Object {
"color": "#5e6977",
Expand Down Expand Up @@ -702,7 +699,6 @@ exports[`ButtonGroup Component should apply values from theme 1`] = `
},
}
}
updateTheme={[Function]}
>
Button 2
</Text>
Expand Down Expand Up @@ -745,7 +741,6 @@ exports[`ButtonGroup Component should apply values from theme 1`] = `
}
>
<Text
replaceTheme={[Function]}
style={
Object {
"color": "#5e6977",
Expand Down Expand Up @@ -796,7 +791,6 @@ exports[`ButtonGroup Component should apply values from theme 1`] = `
},
}
}
updateTheme={[Function]}
>
Button 3
</Text>
Expand Down
2 changes: 0 additions & 2 deletions src/card/__tests__/__snapshots__/Card.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ exports[`Card Component should apply values from theme 1`] = `
>
<View>
<Text
replaceTheme={[Function]}
style={
Object {
"color": "#43484d",
Expand Down Expand Up @@ -82,7 +81,6 @@ exports[`Card Component should apply values from theme 1`] = `
},
}
}
updateTheme={[Function]}
>
Yea b
</Text>
Expand Down
9 changes: 9 additions & 0 deletions src/helpers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ const isIOS = Platform.OS === 'ios';

const conditionalStyle = (condition, style) => (condition ? style : {});

export const patchWebProps = ({
updateTheme,
replaceTheme,
onClear,
...rest
}) => {
return rest;
};

export {
renderNode,
getIconType,
Expand Down
4 changes: 2 additions & 2 deletions src/input/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
StyleSheet,
} from 'react-native';

import { nodeType, renderNode } from '../helpers';
import { nodeType, renderNode, patchWebProps } from '../helpers';
import { fonts, withTheme, ViewPropTypes, TextPropTypes } from '../config';

import Icon from '../icons/Icon';
Expand Down Expand Up @@ -114,7 +114,7 @@ class Input extends React.Component {
testID="RNE__Input__text-input"
underlineColorAndroid="transparent"
editable={!disabled}
{...attributes}
{...patchWebProps(attributes)}
ref={ref => {
this.input = ref;
}}
Expand Down
2 changes: 0 additions & 2 deletions src/input/__tests__/__snapshots__/Input.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,6 @@ exports[`Input component should apply values from theme 1`] = `
editable={true}
placeholder="Enter text"
rejectResponderTermination={true}
replaceTheme={[Function]}
style={
Object {
"alignSelf": "center",
Expand All @@ -773,7 +772,6 @@ exports[`Input component should apply values from theme 1`] = `
}
testID="RNE__Input__text-input"
underlineColorAndroid="transparent"
updateTheme={[Function]}
/>
</View>
</View>
Expand Down
2 changes: 0 additions & 2 deletions src/list/__tests__/__snapshots__/ListItem.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ exports[`ListItem component should apply values from theme 1`] = `
}
>
<Text
replaceTheme={[Function]}
style={
Object {
"backgroundColor": "transparent",
Expand Down Expand Up @@ -73,7 +72,6 @@ exports[`ListItem component should apply values from theme 1`] = `
},
}
}
updateTheme={[Function]}
>
List Title
</Text>
Expand Down
10 changes: 0 additions & 10 deletions src/pricing/__tests__/__snapshots__/PricingCard.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ exports[`PricingCard component should apply values from theme 1`] = `
}
>
<Text
replaceTheme={[Function]}
style={
Object {
"color": "#2089dc",
Expand Down Expand Up @@ -80,12 +79,10 @@ exports[`PricingCard component should apply values from theme 1`] = `
},
}
}
updateTheme={[Function]}
>
ALL YOU CAN EAT
</Text>
<Text
replaceTheme={[Function]}
style={
Object {
"fontSize": 50,
Expand Down Expand Up @@ -135,12 +132,10 @@ exports[`PricingCard component should apply values from theme 1`] = `
},
}
}
updateTheme={[Function]}
>
$0
</Text>
<Text
replaceTheme={[Function]}
style={
Object {
"color": "#86939e",
Expand Down Expand Up @@ -190,12 +185,10 @@ exports[`PricingCard component should apply values from theme 1`] = `
},
}
}
updateTheme={[Function]}
>
1 User
</Text>
<Text
replaceTheme={[Function]}
style={
Object {
"color": "#86939e",
Expand Down Expand Up @@ -245,12 +238,10 @@ exports[`PricingCard component should apply values from theme 1`] = `
},
}
}
updateTheme={[Function]}
>
Basic Support
</Text>
<Text
replaceTheme={[Function]}
style={
Object {
"color": "#86939e",
Expand Down Expand Up @@ -300,7 +291,6 @@ exports[`PricingCard component should apply values from theme 1`] = `
},
}
}
updateTheme={[Function]}
>
All Core Features
</Text>
Expand Down
3 changes: 0 additions & 3 deletions src/searchbar/__tests__/__snapshots__/SearchBar.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,10 @@ exports[`SearchBar wrapper component should apply values from theme 1`] = `
onBlur={[Function]}
onCancel={[Function]}
onChangeText={[Function]}
onClear={[Function]}
onFocus={[Function]}
placeholder="Enter search term"
platform="android"
rejectResponderTermination={true}
replaceTheme={[Function]}
style={
Object {
"alignSelf": "center",
Expand All @@ -148,7 +146,6 @@ exports[`SearchBar wrapper component should apply values from theme 1`] = `
}
testID="searchInput"
underlineColorAndroid="transparent"
updateTheme={[Function]}
value=""
/>
<View
Expand Down
3 changes: 2 additions & 1 deletion src/text/Text.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
import { Text, StyleSheet, Platform } from 'react-native';

import { fonts, withTheme } from '../config';
import { patchWebProps } from '../helpers';
import normalize from '../helpers/normalizeText';

const TextElement = props => {
Expand Down Expand Up @@ -34,7 +35,7 @@ const TextElement = props => {
h3 && StyleSheet.flatten([{ fontSize: normalize(28) }, h3Style]),
h4 && StyleSheet.flatten([{ fontSize: normalize(22) }, h4Style]),
])}
{...rest}
{...patchWebProps(rest)}
>
{children}
</Text>
Expand Down
4 changes: 0 additions & 4 deletions src/text/__tests__/__snapshots__/Text.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

exports[`Text Component local props should override style props on theme 1`] = `
<Text
replaceTheme={[Function]}
style={
Object {
"fontSize": 42.5,
Expand Down Expand Up @@ -50,7 +49,6 @@ exports[`Text Component local props should override style props on theme 1`] = `
},
}
}
updateTheme={[Function]}
>
Hey
</Text>
Expand All @@ -64,7 +62,6 @@ exports[`Text Component should render without issues 1`] = `

exports[`Text Component should use values from the theme 1`] = `
<Text
replaceTheme={[Function]}
style={
Object {
"fontSize": 27.5,
Expand Down Expand Up @@ -110,7 +107,6 @@ exports[`Text Component should use values from the theme 1`] = `
},
}
}
updateTheme={[Function]}
>
Hey
</Text>
Expand Down
2 changes: 0 additions & 2 deletions src/tile/__tests__/__snapshots__/FeaturedTile.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ exports[`FeaturedTitle component should apply values from theme 1`] = `
}
/>
<Text
replaceTheme={[Function]}
style={
Object {
"backgroundColor": "rgba(0,0,0,0)",
Expand Down Expand Up @@ -204,7 +203,6 @@ exports[`FeaturedTitle component should apply values from theme 1`] = `
},
}
}
updateTheme={[Function]}
>
I am featured
</Text>
Expand Down
2 changes: 0 additions & 2 deletions src/tile/__tests__/__snapshots__/Tile.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ exports[`Tile component should apply styles from theme 1`] = `
}
>
<Text
replaceTheme={[Function]}
style={
Object {
"backgroundColor": "rgba(0,0,0,0)",
Expand Down Expand Up @@ -279,7 +278,6 @@ exports[`Tile component should apply styles from theme 1`] = `
},
}
}
updateTheme={[Function]}
>
Mary is friendly
</Text>
Expand Down

0 comments on commit ac90c75

Please sign in to comment.