Skip to content
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.

Commit

Permalink
Fix imports from React and React Native modules.
Browse files Browse the repository at this point in the history
  • Loading branch information
alloy committed May 25, 2016
1 parent 22e3fc7 commit a9a51d9
Show file tree
Hide file tree
Showing 29 changed files with 73 additions and 66 deletions.
9 changes: 5 additions & 4 deletions lib/app_registry.js
@@ -1,7 +1,8 @@
'use strict';

import React from 'react-native';
import Relay from 'react-relay';
import React from 'react';
import { AppRegistry, Text } from 'react-native';
import { RootContainer } from 'react-relay';

import Spinner from './components/spinner';
import Containers from './containers';
Expand All @@ -12,7 +13,7 @@ class Artist extends React.Component {
const artistRoute = new Routes.Artist({ artistID: this.props.artistID });

// https://facebook.github.io/relay/docs/guides-root-container.html
return (<Relay.RootContainer
return (<RootContainer
Component={Containers.Artist}
route={artistRoute}
renderLoading={() => {
Expand All @@ -25,4 +26,4 @@ class Artist extends React.Component {
}
}

React.AppRegistry.registerComponent('Artist', () => Artist);
AppRegistry.registerComponent('Artist', () => Artist);
4 changes: 2 additions & 2 deletions lib/components/artist/about.js
@@ -1,8 +1,8 @@
'use strict';

import Relay from 'react-relay';
import React from 'react-native';
const { View, StyleSheet } = React;
import React from 'react';
import { View, StyleSheet } from 'react-native';

import Biography from './biography';
import Articles from './articles';
Expand Down
4 changes: 2 additions & 2 deletions lib/components/artist/articles/article.js
Expand Up @@ -2,8 +2,8 @@
'use strict';

import Relay from 'react-relay';
import React from 'react-native';
const { ScrollView, StyleSheet, View, Text, TouchableWithoutFeedback } = React;
import React from 'react';
import { ScrollView, StyleSheet, View, Text, TouchableWithoutFeedback } from 'react-native';

import colors from '../../../../data/colors';
import SerifText from '../../text/serif';
Expand Down
4 changes: 2 additions & 2 deletions lib/components/artist/articles/index.js
Expand Up @@ -2,8 +2,8 @@
'use strict';

import Relay from 'react-relay';
import React from 'react-native';
const { ScrollView, StyleSheet, View } = React;
import React from 'react';
import { ScrollView, StyleSheet, View } from 'react-native';

import colors from '../../../../data/colors';
import SerifText from '../../text/serif';
Expand Down
4 changes: 2 additions & 2 deletions lib/components/artist/artworks/artwork.js
@@ -1,8 +1,8 @@
'use strict';

import Relay from 'react-relay';
import React from 'react-native';
const { Text, View, StyleSheet, TouchableWithoutFeedback } = React;
import React from 'react';
import { Text, View, StyleSheet, TouchableWithoutFeedback } from 'react-native';

import ImageView from '../../opaque_image_view';
import SerifText from '../../text/serif';
Expand Down
4 changes: 2 additions & 2 deletions lib/components/artist/artworks/grid.js
Expand Up @@ -9,8 +9,8 @@
// 4. Update height of grid to encompass all items.

import Relay from 'react-relay';
import React from 'react-native';
const { Dimensions, View, ScrollView, StyleSheet } = React;
import React from 'react';
import { Dimensions, View, ScrollView, StyleSheet } from 'react-native';

import Artwork from './artwork';
import Spinner from '../../spinner';
Expand Down
4 changes: 2 additions & 2 deletions lib/components/artist/artworks/index.js
@@ -1,8 +1,8 @@
'use strict';

import Relay from 'react-relay';
import React from 'react-native';
const { Text, View, StyleSheet } = React;
import React from 'react';
import { Text, View, StyleSheet } from 'react-native';

import Separator from '../../separator'
import SerifText from '../../text/serif';
Expand Down
4 changes: 2 additions & 2 deletions lib/components/artist/biography.js
Expand Up @@ -2,8 +2,8 @@
'use strict';

import Relay from 'react-relay';
import React from 'react-native';
const { View, Text, Dimensions } = React;
import React from 'react';
import { View, Text, Dimensions } from 'react-native';

import removeMarkdown from 'remove-markdown';

Expand Down
6 changes: 3 additions & 3 deletions lib/components/artist/header.js
Expand Up @@ -6,9 +6,9 @@
// * Fix label that includes birthday is it’s unknown, e.g. banksy

import Relay from 'react-relay';
import React from 'react-native';
const { StyleSheet, View, Text, TouchableHighlight } = React;
const { ARTemporaryAPIModule } = React.NativeModules;
import React from 'react';
import { NativeModules, StyleSheet, View, Text, TouchableHighlight } from 'react-native';
const { ARTemporaryAPIModule } = NativeModules;

import colors from '../../../data/colors';
import InvertedButton from '../buttons/inverted_button';
Expand Down
4 changes: 2 additions & 2 deletions lib/components/artist/related_artists/index.js
Expand Up @@ -2,8 +2,8 @@
'use strict';

import Relay from 'react-relay';
import React from 'react-native';
const { ScrollView, StyleSheet, View } = React;
import React from 'react';
import { ScrollView, StyleSheet, View } from 'react-native';

import colors from '../../../../data/colors';
import SerifText from '../../text/serif';
Expand Down
4 changes: 2 additions & 2 deletions lib/components/artist/related_artists/related_artist.js
Expand Up @@ -2,8 +2,8 @@
'use strict';

import Relay from 'react-relay';
import React from 'react-native';
const { ScrollView, StyleSheet, View, Text, TouchableWithoutFeedback, Dimensions } = React;
import React from 'react';
import { ScrollView, StyleSheet, View, Text, TouchableWithoutFeedback, Dimensions } from 'react-native';

import colors from '../../../../data/colors';
import SerifText from '../../text/serif';
Expand Down
4 changes: 2 additions & 2 deletions lib/components/artist/shows/index.js
Expand Up @@ -2,8 +2,8 @@
'use strict';

import Relay from 'react-relay';
import React from 'react-native';
const { View, Text, StyleSheet, Dimensions } = React;
import React from 'react';
import { View, Text, StyleSheet, Dimensions } from 'react-native';

import SerifText from '../../text/serif'
import Separator from '../../separator'
Expand Down
4 changes: 2 additions & 2 deletions lib/components/artist/shows/large_image_show.js
Expand Up @@ -2,8 +2,8 @@
'use strict';

import Relay from 'react-relay';
import React from 'react-native';
const { View, Text, StyleSheet, Dimensions, TouchableWithoutFeedback } = React;
import React from 'react';
import { View, Text, StyleSheet, Dimensions, TouchableWithoutFeedback } from 'react-native';

import Headline from '../../text/headline'
import SerifText from '../../text/serif'
Expand Down
4 changes: 2 additions & 2 deletions lib/components/artist/shows/large_list.js
Expand Up @@ -2,8 +2,8 @@
'use strict';

import Relay from 'react-relay';
import React from 'react-native';
const { View, StyleSheet } = React;
import React from 'react';
import { View, StyleSheet } from 'react-native';

import LargeImageShow from './large_image_show'

Expand Down
4 changes: 2 additions & 2 deletions lib/components/artist/shows/medium_image_show.js
Expand Up @@ -2,8 +2,8 @@
'use strict';

import Relay from 'react-relay';
import React from 'react-native';
const { View, Text, StyleSheet, Dimensions, TouchableWithoutFeedback } = React;
import React from 'react';
import { View, Text, StyleSheet, Dimensions, TouchableWithoutFeedback } from 'react-native';

import Headline from '../../text/headline'
import SerifText from '../../text/serif'
Expand Down
4 changes: 2 additions & 2 deletions lib/components/artist/shows/medium_list.js
Expand Up @@ -2,8 +2,8 @@
'use strict';

import Relay from 'react-relay';
import React from 'react-native';
const { View, StyleSheet } = React;
import React from 'react';
import { View, StyleSheet } from 'react-native';

import MediumImageShow from './medium_image_show'

Expand Down
4 changes: 2 additions & 2 deletions lib/components/artist/shows/metadata.js
Expand Up @@ -2,8 +2,8 @@
'use strict';

import Relay from 'react-relay';
import React from 'react-native';
const { View, Text, StyleSheet } = React;
import React from 'react';
import { View, Text, StyleSheet } from 'react-native';

import colors from '../../../../data/colors';
import SerifText from '../../text/serif'
Expand Down
4 changes: 2 additions & 2 deletions lib/components/artist/shows/small_image_show.js
Expand Up @@ -2,8 +2,8 @@
'use strict';

import Relay from 'react-relay';
import React from 'react-native';
const { View, TouchableWithoutFeedback, StyleSheet } = React;
import React from 'react';
import { View, TouchableWithoutFeedback, StyleSheet } from 'react-native';

import OpaqueImageView from '../../opaque_image_view'
import ShowMetadata from './metadata'
Expand Down
4 changes: 2 additions & 2 deletions lib/components/artist/shows/small_list.js
Expand Up @@ -2,8 +2,8 @@
'use strict';

import Relay from 'react-relay';
import React from 'react-native';
const { View, StyleSheet, ListView } = React;
import React from 'react';
import { View, StyleSheet, ListView } from 'react-native';

import Headline from '../../text/headline'
import SerifText from '../../text/serif'
Expand Down
4 changes: 2 additions & 2 deletions lib/components/buttons/inverted_button.js
@@ -1,8 +1,8 @@
/* @flow */
'use strict';

import React from 'react-native';
const { StyleSheet, TouchableHighlight, View, Dimensions } = React;
import React from 'react';
import { StyleSheet, TouchableHighlight, View, Dimensions } from 'react-native';

import Headline from '../text/headline';
import colors from '../../../data/colors';
Expand Down
16 changes: 11 additions & 5 deletions lib/components/opaque_image_view.js
@@ -1,8 +1,14 @@
/* @flow */
'use strict';

import React from 'react-native';
const { PixelRatio, StyleSheet } = React;
import React from 'react';
import {
processColor,
requireNativeComponent,
ColorPropType,
PixelRatio,
StyleSheet
} from 'react-native';

import colors from '../../data/colors';

Expand Down Expand Up @@ -45,7 +51,7 @@ export default class OpaqueImageView extends React.Component {
imageURL: isLaidOut ? this.imageURL() : null,
onLayout: isLaidOut ? null : this.onLayout.bind(this),
});
return <NativeOpaqueImageView placeholderBackgroundColor={React.processColor(placeholderBackgroundColor)} style={style} {...props} />;
return <NativeOpaqueImageView placeholderBackgroundColor={processColor(placeholderBackgroundColor)} style={style} {...props} />;
}
}

Expand All @@ -70,11 +76,11 @@ OpaqueImageView.propTypes = {
*/
onLoad: React.PropTypes.func,

placeholderBackgroundColor: React.ColorPropType,
placeholderBackgroundColor: ColorPropType,
};

OpaqueImageView.defaultProps = {
placeholderBackgroundColor: colors['gray-regular'],
};

const NativeOpaqueImageView = React.requireNativeComponent('AROpaqueImageView', OpaqueImageView);
const NativeOpaqueImageView = requireNativeComponent('AROpaqueImageView', OpaqueImageView);
4 changes: 2 additions & 2 deletions lib/components/separator.js
@@ -1,8 +1,8 @@
/* @flow */
'use strict';

import React from 'react-native';
const { StyleSheet, View, Dimensions } = React;
import React from 'react';
import { StyleSheet, View, Dimensions } from 'react-native';

import colors from '../../data/colors';

Expand Down
6 changes: 3 additions & 3 deletions lib/components/spinner.js
@@ -1,8 +1,8 @@
/* @flow */
'use strict';

import React from 'react-native';
const { View, StyleSheet } = React;
import React from 'react';
import { requireNativeComponent, View, StyleSheet } from 'react-native';

export default class Spinner extends React.Component {
render() {
Expand All @@ -28,4 +28,4 @@ const styles = StyleSheet.create({
// Only needed so React doesn’t complain about ARSpinner not havig any propTypes.
Spinner.propTypes = {};

const NativeSpinner = React.requireNativeComponent('ARSpinner', Spinner);
const NativeSpinner = requireNativeComponent('ARSpinner', Spinner);
5 changes: 3 additions & 2 deletions lib/components/switch_view.js
@@ -1,7 +1,8 @@
/* @flow */
'use strict';

import React from 'react-native';
import React from 'react';
import { requireNativeComponent } from 'react-native';

export default class SwitchView extends React.Component {
render() {
Expand All @@ -16,7 +17,7 @@ SwitchView.propTypes = {
onSelectionChange: React.PropTypes.func.isRequired,
};

const NativeSwitchView = React.requireNativeComponent('ARSwitchView', SwitchView);
const NativeSwitchView = requireNativeComponent('ARSwitchView', SwitchView);

export type SwitchEvent = {
nativeEvent: {
Expand Down
4 changes: 2 additions & 2 deletions lib/components/tab_view.js
@@ -1,8 +1,8 @@
/* @flow */
'use strict';

import React from 'react-native';
const { StyleSheet, View, Dimensions } = React;
import React from 'react';
import { StyleSheet, View, Dimensions } from 'react-native';

import SwitchView from './switch_view';
import type SwitchEvent from './switch_view';
Expand Down
4 changes: 2 additions & 2 deletions lib/components/text/headline.js
@@ -1,8 +1,8 @@
/* @flow */
'use strict';

import React from 'react-native';
const { StyleSheet, Text } = React;
import React from 'react';
import { StyleSheet, Text } from 'react-native';

export default class Headline extends React.Component {
render() {
Expand Down
4 changes: 2 additions & 2 deletions lib/components/text/serif.js
@@ -1,8 +1,8 @@
/* @flow */
'use strict';

import React from 'react-native';
const { StyleSheet, Text } = React;
import React from 'react';
import { StyleSheet, Text } from 'react-native';

export default class Serif extends React.Component {
render() {
Expand Down
4 changes: 2 additions & 2 deletions lib/containers/artist.js
Expand Up @@ -2,8 +2,8 @@
'use strict';

import Relay from 'react-relay';
import React from 'react-native';
const { ScrollView, View, Dimensions } = React;
import React from 'react';
import { ScrollView, View, Dimensions } from 'react-native';

import Header from '../components/artist/header';
import About from '../components/artist/about';
Expand Down
5 changes: 2 additions & 3 deletions lib/modules/switch_board.js
@@ -1,8 +1,7 @@
'use strict';

import React from 'react-native';
const { findNodeHandle } = React;
const { ARSwitchBoardModule } = React.NativeModules;
import { findNodeHandle, NativeModules } from 'react-native';
const { ARSwitchBoardModule } = NativeModules;

function presentNavigationViewController(component, route) {
ARSwitchBoardModule.presentNavigationViewController(findNodeHandle(component), route);
Expand Down

0 comments on commit a9a51d9

Please sign in to comment.