Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imports optimization: sort and remove unused imports #211

Merged
merged 1 commit into from
Jan 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 19 additions & 37 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,53 +17,35 @@
// along with Parity. If not, see <http://www.gnu.org/licenses/>.

'use strict';
import '../ReactotronConfig';

import React, { Component } from 'react';
import { Provider as UnstatedProvider, Subscribe, Container } from 'unstated';
import {
View,
Text,
Image,
StyleSheet,
AppState,
Alert,
StatusBar
} from 'react-native';
import {
createStackNavigator,
createBottomTabNavigator,
HeaderTitle,
Header,
HeaderBackButton,
withNavigation
} from 'react-navigation';
import Icon from 'react-native-vector-icons/MaterialIcons';
import { default as HomeHeader } from './components/Header';
import { StatusBar } from 'react-native';
import { createBottomTabNavigator, createStackNavigator, HeaderBackButton, withNavigation } from 'react-navigation';
import { Provider as UnstatedProvider } from 'unstated';
import '../ReactotronConfig';
import colors from './colors';
import Background from './components/Background';
import HeaderLeftHome from './components/HeaderLeftHome';
import SecurityHeader from './components/SecurityHeader';
import Background from './components/Background';
import TabBarBottom from './components/TabBarBottom';
import TouchableItem from './components/TouchableItem';
import Loading from './screens/Loading';
import Security from './screens/Security';
import QrScanner from './screens/QrScanner';
import AccountList from './screens/AccountList';
import About from './screens/About';
import AccountAdd from './screens/AccountAdd';
import AccountNew from './screens/AccountNew';
import AccountNetworkChooser from './screens/AccountNetworkChooser';
import AccountRecover from './screens/AccountRecover';
import AccountBackup from './screens/AccountBackup';
import AccountPin from './screens/AccountPin';
import About from './screens/About';
import TermsAndConditions from './screens/TermsAndConditions';
import PrivacyPolicy from './screens/PrivacyPolicy';
import AccountDetails from './screens/AccountDetails';
import AccountEdit from './screens/AccountEdit';
import TxDetails from './screens/TxDetails';
import AccountList from './screens/AccountList';
import AccountNetworkChooser from './screens/AccountNetworkChooser';
import AccountNew from './screens/AccountNew';
import AccountPin from './screens/AccountPin';
import AccountRecover from './screens/AccountRecover';
import { AccountUnlock, AccountUnlockAndSign } from './screens/AccountUnlock';
import Loading from './screens/Loading';
import PrivacyPolicy from './screens/PrivacyPolicy';
import QrScanner from './screens/QrScanner';
import Security from './screens/Security';
import SignedTx from './screens/SignedTx';
import colors from './colors';
import TermsAndConditions from './screens/TermsAndConditions';
import TxDetails from './screens/TxDetails';


export default class App extends Component {
render() {
Expand Down
22 changes: 4 additions & 18 deletions src/components/AccountCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,13 @@

// @flow

import React from 'react';
import PropTypes from 'prop-types';
import {
View,
Text,
Platform,
StyleSheet,
TouchableNativeFeedback,
TouchableOpacity,
ViewPropTypes
} from 'react-native';
import React from 'react';
import { StyleSheet, Text, View, ViewPropTypes } from 'react-native';
import colors from '../colors';
import { DEFAULT_NETWORK_COLOR, NETWORK_COLOR, NETWORK_TITLES } from '../constants';
import AccountIcon from './AccountIcon';
import Card from './Card';
import TouchableItem from './TouchableItem';
import {
NETWORK_LIST,
NETWORK_TITLES,
NETWORK_COLOR,
DEFAULT_NETWORK_COLOR
} from '../constants';
import colors from '../colors';

export default class AccountCard extends React.PureComponent<{
title: ?string,
Expand Down
21 changes: 4 additions & 17 deletions src/components/AccountDetailsCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,13 @@

// @flow

import React from 'react';
import PropTypes from 'prop-types';
import {
View,
Text,
Platform,
StyleSheet,
TouchableNativeFeedback,
TouchableOpacity
} from 'react-native';
import Card from './Card';
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import colors from '../colors';
import { DEFAULT_NETWORK_COLOR, NETWORK_COLOR, NETWORK_TITLES } from '../constants';
import AccountIcon from './AccountIcon';
import TouchableItem from './TouchableItem';
import {
NETWORK_LIST,
NETWORK_TITLES,
NETWORK_COLOR,
DEFAULT_NETWORK_COLOR
} from '../constants';
import colors from '../colors';

export default class AccountDetailsCard extends React.PureComponent<{
title: string,
Expand Down
4 changes: 2 additions & 2 deletions src/components/AccountIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

'use strict';

import React from 'react';
import PropTypes from 'prop-types';
import { Image, View, StyleSheet } from 'react-native';
import React from 'react';
import { Image, StyleSheet, View } from 'react-native';
import { blockiesIcon } from '../util/native';

export default class AccountIcon extends React.PureComponent {
Expand Down
13 changes: 3 additions & 10 deletions src/components/AccountIconChooser.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,11 @@

// @flow

import React from 'react';
import PropTypes from 'prop-types';
import {
View,
Text,
StyleSheet,
ListView,
TouchableOpacity
} from 'react-native';
import { brainWalletAddress, words } from '../util/native';
import React from 'react';
import { ListView, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import colors from '../colors';
import Card from './Card';
import { brainWalletAddress, words } from '../util/native';
import AccountIcon from './AccountIcon';

export default class AccountIconChooser extends React.PureComponent<{
Expand Down
8 changes: 4 additions & 4 deletions src/components/AccountSeed.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
'use strict';

import React, { Component } from 'react';
import { Animated, Text, View, StyleSheet } from 'react-native';
import TouchableItem from './TouchableItem';
import TextInput from './TextInput';
import { WORDS, WORDS_INDEX } from '../util/account';
import { Animated, StyleSheet, Text, View } from 'react-native';
import colors from '../colors';
import { WORDS, WORDS_INDEX } from '../util/account';
import TextInput from './TextInput';
import TouchableItem from './TouchableItem';

export default class AccountSeed extends Component {
state = {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Background.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// along with Parity. If not, see <http://www.gnu.org/licenses/>.

import React from 'react';
import { View, StyleSheet } from 'react-native';
import { StyleSheet, View } from 'react-native';
import colors from '../colors';

export default class Background extends React.PureComponent {
Expand Down
12 changes: 2 additions & 10 deletions src/components/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,9 @@

// @flow

import React from 'react';
import PropTypes from 'prop-types';
import {
View,
Text,
Platform,
StyleSheet,
TouchableNativeFeedback,
TouchableOpacity,
ViewPropTypes
} from 'react-native';
import React from 'react';
import { Platform, StyleSheet, Text, TouchableNativeFeedback, TouchableOpacity, View, ViewPropTypes } from 'react-native';
import colors from '../colors';

export default class Button extends React.PureComponent<{
Expand Down
12 changes: 2 additions & 10 deletions src/components/Card.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,9 @@

// @flow

import React from 'react';
import PropTypes from 'prop-types';
import {
View,
Text,
Platform,
StyleSheet,
TouchableNativeFeedback,
TouchableOpacity,
ViewPropTypes
} from 'react-native';
import React from 'react';
import { Platform, StyleSheet, Text, TouchableNativeFeedback, TouchableOpacity, View, ViewPropTypes } from 'react-native';
import colors from '../colors';

export default class Card extends React.PureComponent<{
Expand Down
4 changes: 2 additions & 2 deletions src/components/DataDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

'use strict';

import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { View, Button, Text } from 'react-native';
import React, { Component } from 'react';
import { Button, Text, View } from 'react-native';
import AppStyles from '../styles';

function isAscii(data) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// along with Parity. If not, see <http://www.gnu.org/licenses/>.

import React from 'react';
import { Text, View, StyleSheet, Image, SafeAreaView } from 'react-native';
import { Image, SafeAreaView, StyleSheet, Text, View } from 'react-native';
import colors from '../colors';

export default function() {
Expand Down
2 changes: 1 addition & 1 deletion src/components/HeaderLeftHome.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Text, View, StyleSheet, Image } from 'react-native';
import { Image, StyleSheet, Text, View } from 'react-native';
import colors from '../colors';

export default class HeaderLeftHome extends React.PureComponent {
Expand Down
3 changes: 1 addition & 2 deletions src/components/Markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
// @flow

import React from 'react';
import PropTypes from 'prop-types';
import { View, Text, Platform, StyleSheet } from 'react-native';
import { StyleSheet } from 'react-native';
import { default as MarkdownRender } from 'react-native-markdown-renderer';
import colors from '../colors';

Expand Down
3 changes: 1 addition & 2 deletions src/components/QrView.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
'use strict';

import React from 'react';
import PropTypes from 'prop-types';
import { View, StyleSheet, Dimensions } from 'react-native';
import { Dimensions, StyleSheet, View } from 'react-native';
import QRCode from 'react-native-qrcode';
import colors from '../colors';

Expand Down
8 changes: 4 additions & 4 deletions src/components/SecurityHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
// along with Parity. If not, see <http://www.gnu.org/licenses/>.

import React from 'react';
import { Text, View, StyleSheet } from 'react-native';
import { StyleSheet, Text, View } from 'react-native';
import Icon from 'react-native-vector-icons/MaterialIcons';
import { withNavigation } from 'react-navigation';
import { Subscribe } from 'unstated';
import Icon from 'react-native-vector-icons/MaterialIcons';
import TouchableItem from './TouchableItem';
import SecurityStore from '../stores/SecurityStore';
import colors from '../colors';
import SecurityStore from '../stores/SecurityStore';
import TouchableItem from './TouchableItem';

export default class SecurityHeader extends React.Component {
render() {
Expand Down
10 changes: 1 addition & 9 deletions src/components/TabBarBottom.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,7 @@
/* @flow */

import React from 'react';
import {
Text,
Animated,
TouchableWithoutFeedback,
StyleSheet,
View,
Platform,
SafeAreaView
} from 'react-native';
import { Platform, SafeAreaView, StyleSheet, Text, TouchableWithoutFeedback, View } from 'react-native';
import Icon from 'react-native-vector-icons/FontAwesome';
import colors from '../colors';
import withDimensions from './utils/withDimensions';
Expand Down
7 changes: 1 addition & 6 deletions src/components/TextInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,7 @@
// along with Parity. If not, see <http://www.gnu.org/licenses/>.

import React from 'react';
import PropTypes from 'prop-types';
import {
TextInput as TextInputOrigin,
Platform,
StyleSheet
} from 'react-native';
import { StyleSheet, TextInput as TextInputOrigin } from 'react-native';
import colors from '../colors';

export default class TextInput extends React.PureComponent {
Expand Down
7 changes: 1 addition & 6 deletions src/components/TouchableItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,7 @@
* of TouchableNativeFeedback.
*/
import React from 'react';
import {
Platform,
TouchableNativeFeedback,
TouchableOpacity,
View
} from 'react-native';
import { Platform, TouchableNativeFeedback, TouchableOpacity, View } from 'react-native';

const ANDROID_VERSION_LOLLIPOP = 21;

Expand Down
14 changes: 2 additions & 12 deletions src/components/TxDetailsCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,10 @@

// @flow

import React from 'react';
import PropTypes from 'prop-types';
import {
View,
Text,
Platform,
StyleSheet,
TouchableNativeFeedback,
TouchableOpacity,
ViewPropTypes
} from 'react-native';
import React from 'react';
import { StyleSheet, Text, View, ViewPropTypes } from 'react-native';
import colors from '../colors';
import Card from './Card';
import AccountIcon from './AccountIcon';

const WEI_IN_ETH = 1000000000000000000;

Expand Down
20 changes: 1 addition & 19 deletions src/screens/About.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,7 @@
'use strict';

import React from 'react';
import PropTypes from 'prop-types';
import {
Alert,
ScrollView,
View,
Text,
TouchableOpacity,
Share,
StyleSheet,
Linking
} from 'react-native';
import { Subscribe } from 'unstated';
import Icon from 'react-native-vector-icons/MaterialIcons';
import AccountsStore from '../stores/AccountsStore';
import Background from '../components/Background';
import AccountSeed from '../components/AccountSeed';
import AccountIconChooser from '../components/AccountIconChooser';
import TextInput from '../components/TextInput';
import TouchableItem from '../components/TouchableItem';
import { Linking, ScrollView, StyleSheet, Text, View } from 'react-native';
import colors from '../colors';

export default class About extends React.PureComponent {
Expand Down
Loading