Skip to content

Commit

Permalink
[react-packager] change all but one ix to require
Browse files Browse the repository at this point in the history
  • Loading branch information
Amjad Masad committed Mar 20, 2015
1 parent 258a813 commit f1746ac
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 48 deletions.
5 changes: 2 additions & 3 deletions Examples/UIExplorer/ImageCapInsetsExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ var {
StyleSheet,
Text,
View,
ix,
} = React;

var ImageCapInsetsExample = React.createClass({
Expand All @@ -23,7 +22,7 @@ var ImageCapInsetsExample = React.createClass({
capInsets: none
</Text>
<Image
source={ix('story-background')}
source={require('image!story-background')}
style={styles.storyBackground}
capInsets={{left: 0, right: 0, bottom: 0, top: 0}}
/>
Expand All @@ -33,7 +32,7 @@ var ImageCapInsetsExample = React.createClass({
capInsets: 15
</Text>
<Image
source={ix('story-background')}
source={require('image!story-background')}
style={styles.storyBackground}
capInsets={{left: 15, right: 15, bottom: 15, top: 15}}
/>
Expand Down
21 changes: 10 additions & 11 deletions Examples/UIExplorer/ImageExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ var {
StyleSheet,
Text,
View,
ix,
} = React;

var ImageCapInsetsExample = require('./ImageCapInsetsExample');
Expand All @@ -34,15 +33,15 @@ exports.examples = [
},
{
title: 'Plain Static Image',
description: 'Static assets must be referenced with the `ix` wrapper and ' +
'located in the app bundle.',
description: 'Static assets should be required by prefixing with `image!` ' +
'and are located in the app bundle.',
render: function() {
return (
<View style={styles.horizontal}>
<Image source={ix('uie_thumb_normal')} style={styles.icon} />
<Image source={ix('uie_thumb_selected')} style={styles.icon} />
<Image source={ix('uie_comment_normal')} style={styles.icon} />
<Image source={ix('uie_comment_highlighted')} style={styles.icon} />
<Image source={require('image!uie_thumb_normal')} style={styles.icon} />
<Image source={require('image!uie_thumb_selected')} style={styles.icon} />
<Image source={require('image!uie_comment_normal')} style={styles.icon} />
<Image source={require('image!uie_comment_highlighted')} style={styles.icon} />
</View>
);
},
Expand Down Expand Up @@ -184,19 +183,19 @@ exports.examples = [
return (
<View style={styles.horizontal}>
<Image
source={ix('uie_thumb_normal')}
source={require('image!uie_thumb_normal')}
style={[styles.icon, {tintColor: 'blue' }]}
/>
<Image
source={ix('uie_thumb_normal')}
source={require('image!uie_thumb_normal')}
style={[styles.icon, styles.leftMargin, {tintColor: 'green' }]}
/>
<Image
source={ix('uie_thumb_normal')}
source={require('image!uie_thumb_normal')}
style={[styles.icon, styles.leftMargin, {tintColor: 'red' }]}
/>
<Image
source={ix('uie_thumb_normal')}
source={require('image!uie_thumb_normal')}
style={[styles.icon, styles.leftMargin, {tintColor: 'black' }]}
/>
</View>
Expand Down
7 changes: 3 additions & 4 deletions Examples/UIExplorer/TabBarExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ var StyleSheet = require('StyleSheet');
var Text = require('Text');
var View = require('View');

var ix = require('ix');

var TabBarExample = React.createClass({

Expand Down Expand Up @@ -42,7 +41,7 @@ var TabBarExample = React.createClass({
selectedTab={this.state.selectedTab}>
<TabBarItemIOS
name="blueTab"
icon={ix('favorites')}
icon={require('image!favorites')}
accessibilityLabel="Blue Tab"
selected={this.state.selectedTab === 'blueTab'}
onPress={() => {
Expand All @@ -55,7 +54,7 @@ var TabBarExample = React.createClass({
<TabBarItemIOS
accessibilityLabel="Red Tab"
name="redTab"
icon={ix('history')}
icon={require('image!history')}
badgeValue={this.state.notifCount ? String(this.state.notifCount) : null}
selected={this.state.selectedTab === 'redTab'}
onPress={() => {
Expand All @@ -68,7 +67,7 @@ var TabBarExample = React.createClass({
</TabBarItemIOS>
<TabBarItemIOS
name="greenTab"
icon={ix('more')}
icon={require('image!more')}
accessibilityLabel="Green Tab"
selected={this.state.selectedTab === 'greenTab'}
onPress={() => {
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Components/Touchable/TouchableHighlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var DEFAULT_PROPS = {
* <TouchableHighlight onPress={this._onPressButton}>
* <Image
* style={styles.button}
* source={ix('myButton')}
* source={require('image!myButton')}
* />
* </View>
* );
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Components/Touchable/TouchableOpacity.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var onlyChild = require('onlyChild');
* <TouchableOpacity onPress={this._onPressButton}>
* <Image
* style={styles.button}
* source={ix('myButton')}
* source={require('image!myButton')}
* />
* </View>
* );
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Image/Image.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ var warning = require('warning');
* <View>
* <Image
* style={styles.icon}
* source={ix('myIcon')}
* source={require('image!myIcon')}
* />
* <Image
* style={styles.logo}
Expand Down
26 changes: 0 additions & 26 deletions Libraries/Image/ix.js

This file was deleted.

2 changes: 1 addition & 1 deletion Libraries/react-native/react-native.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ var ReactNative = {
TimerMixin: require('TimerMixin'),
VibrationIOS: require('VibrationIOS'),

ix: require('ix'),
invariant: require('invariant'),
};

module.exports = ReactNative;

0 comments on commit f1746ac

Please sign in to comment.