mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-03-26 08:55:56 +01:00
Revert "Updated Expon and depracated calls. (#44)"
This reverts commit 60b0bdc474
.
This commit is contained in:
parent
62ff3d7441
commit
fc4cee1089
16 changed files with 4998 additions and 8297 deletions
4
App.js
4
App.js
|
@ -2,7 +2,7 @@ import './shim.js';
|
|||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Text, ScrollView, StyleSheet } from 'react-native';
|
||||
import { createDrawerNavigator, SafeAreaView } from 'react-navigation';
|
||||
import { DrawerNavigator, SafeAreaView } from 'react-navigation';
|
||||
import MainBottomTabs from './MainBottomTabs';
|
||||
import Selftest from './screen/selftest';
|
||||
import About from './screen/about';
|
||||
|
@ -51,7 +51,7 @@ const styles = StyleSheet.create({
|
|||
},
|
||||
});
|
||||
|
||||
const TabsInDrawer = createDrawerNavigator(
|
||||
const TabsInDrawer = DrawerNavigator(
|
||||
{
|
||||
MainBottomTabs: {
|
||||
screen: MainBottomTabs,
|
||||
|
|
22
App.test.js
22
App.test.js
|
@ -1,7 +1,7 @@
|
|||
/* global describe, it, expect, jest, jasmine */
|
||||
import React from 'react';
|
||||
import { WatchOnlyWallet, LegacyWallet, SegwitP2SHWallet, AppStorage } from './class';
|
||||
import TestRenderer from 'react-test-renderer';
|
||||
import renderer from 'react-test-renderer';
|
||||
import Settings from './screen/settings';
|
||||
import Selftest from './screen/selftest';
|
||||
import { BlueHeader } from './BlueComponents';
|
||||
|
@ -25,20 +25,6 @@ jest.mock('Picker', () => {
|
|||
}
|
||||
};
|
||||
});
|
||||
jest.mock('ScrollView', () => {
|
||||
const RealComponent = require.requireActual('ScrollView');
|
||||
const React = require('React');
|
||||
class ScrollView extends React.Component {
|
||||
scrollTo() {
|
||||
}
|
||||
|
||||
render() {
|
||||
return React.createElement('ScrollView', this.props, this.props.children);
|
||||
}
|
||||
}
|
||||
ScrollView.propTypes = RealComponent.propTypes;
|
||||
return ScrollView;
|
||||
});
|
||||
|
||||
describe('unit - LegacyWallet', function() {
|
||||
it('serialize and unserialize work correctly', () => {
|
||||
|
@ -63,17 +49,17 @@ describe('unit - LegacyWallet', function() {
|
|||
});
|
||||
|
||||
it('BlueHeader works', () => {
|
||||
const rendered = TestRenderer.create(<BlueHeader />).toJSON();
|
||||
const rendered = renderer.create(<BlueHeader />).toJSON();
|
||||
expect(rendered).toBeTruthy();
|
||||
});
|
||||
|
||||
it('Settings work', () => {
|
||||
const rendered = TestRenderer.create(<Settings />).toJSON();
|
||||
const rendered = renderer.create(<Settings />).toJSON();
|
||||
expect(rendered).toBeTruthy();
|
||||
});
|
||||
|
||||
it('Selftest work', () => {
|
||||
const component = TestRenderer.create(<Selftest />);
|
||||
const component = renderer.create(<Selftest />);
|
||||
const root = component.root;
|
||||
const rendered = component.toJSON();
|
||||
expect(rendered).toBeTruthy();
|
||||
|
|
|
@ -170,16 +170,12 @@ export class BlueCard extends Component {
|
|||
borderColor: 'transparent',
|
||||
paddingTop: 0,
|
||||
marginTop: 0,
|
||||
flex: 1,
|
||||
}}
|
||||
dividerStyle={{
|
||||
backgroundColor: 'transparent',
|
||||
borderColor: 'transparent',
|
||||
}}
|
||||
wrapperStyle={{
|
||||
backgroundColor: 'transparent',
|
||||
flex: 1,
|
||||
}}
|
||||
wrapperStyle={{ backgroundColor: 'transparent' }}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
import { createBottomTabNavigator } from 'react-navigation';
|
||||
import { TabNavigator } from 'react-navigation';
|
||||
|
||||
import transactions from './screen/transactions';
|
||||
import wallets from './screen/wallets';
|
||||
import send from './screen/send';
|
||||
import settings from './screen/settings';
|
||||
import settins from './screen/settings';
|
||||
import receive from './screen/receive';
|
||||
|
||||
/** @type {AppStorage} */
|
||||
let BlueApp = require('./BlueApp');
|
||||
|
||||
const Tabs = createBottomTabNavigator(
|
||||
const Tabs = TabNavigator(
|
||||
{
|
||||
Wallets: {
|
||||
screen: wallets,
|
||||
|
@ -28,7 +28,7 @@ const Tabs = createBottomTabNavigator(
|
|||
path: 'receive',
|
||||
},
|
||||
Settings: {
|
||||
screen: settings,
|
||||
screen: settins,
|
||||
path: 'settings',
|
||||
},
|
||||
|
||||
|
|
2
app.json
2
app.json
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"expo": {
|
||||
"sdkVersion": "30.0.0",
|
||||
"sdkVersion": "23.0.0",
|
||||
"version": "2.4.3",
|
||||
"privacy": "public",
|
||||
"platforms": [
|
||||
|
|
10
loc/index.js
10
loc/index.js
|
@ -1,5 +1,6 @@
|
|||
import Localization from 'react-localization';
|
||||
import LocalizedStrings from 'react-localization';
|
||||
import { AsyncStorage } from 'react-native';
|
||||
import { Util } from 'expo';
|
||||
import { AppStorage } from '../class';
|
||||
let BigNumber = require('bignumber.js');
|
||||
let strings;
|
||||
|
@ -13,8 +14,9 @@ let strings;
|
|||
return;
|
||||
}
|
||||
|
||||
if (Localization.getCurrentLocaleAsync) {
|
||||
let locale = await Localization.getCurrentLocaleAsync();
|
||||
// TODO: rewrite this when Expo version is upped
|
||||
if (Util.getCurrentLocaleAsync) {
|
||||
let locale = await Util.getCurrentLocaleAsync();
|
||||
if (locale) {
|
||||
locale = locale.split('-');
|
||||
locale = locale[0];
|
||||
|
@ -28,7 +30,7 @@ let strings;
|
|||
}
|
||||
})();
|
||||
|
||||
strings = new Localization({
|
||||
strings = new LocalizedStrings({
|
||||
en: require('./en.js'),
|
||||
ru: require('./ru.js'),
|
||||
pt: require('./pt_BR.js'),
|
||||
|
|
13089
package-lock.json
generated
13089
package-lock.json
generated
File diff suppressed because it is too large
Load diff
44
package.json
44
package.json
|
@ -2,20 +2,20 @@
|
|||
"name": "BlueWallet",
|
||||
"version": "2.4.3",
|
||||
"devDependencies": {
|
||||
"babel-eslint": "^8.2.6",
|
||||
"eslint": "^4.19.1",
|
||||
"babel-eslint": "^8.2.2",
|
||||
"eslint": "^4.19.0",
|
||||
"eslint-config-standard": "^11.0.0",
|
||||
"eslint-config-standard-react": "^6.0.0",
|
||||
"eslint-plugin-babel": "^4.1.2",
|
||||
"eslint-plugin-import": "^2.14.0",
|
||||
"eslint-plugin-import": "^2.9.0",
|
||||
"eslint-plugin-node": "^6.0.1",
|
||||
"eslint-plugin-promise": "^3.8.0",
|
||||
"eslint-plugin-react": "^7.11.1",
|
||||
"eslint-plugin-standard": "^3.1.0",
|
||||
"jest-expo": "^30.0.0",
|
||||
"eslint-plugin-promise": "^3.7.0",
|
||||
"eslint-plugin-react": "^7.7.0",
|
||||
"eslint-plugin-standard": "^3.0.1",
|
||||
"jest-expo": "^23.0.0",
|
||||
"prettier-eslint-cli": "^4.7.1",
|
||||
"react-native-scripts": "1.8.1",
|
||||
"react-test-renderer": "16.3.1",
|
||||
"react-test-renderer": "16.0.0",
|
||||
"rn-nodeify": "github:mvayngrib/rn-nodeify",
|
||||
"snazzy": "^7.0.0",
|
||||
"standard": "^11.0.1"
|
||||
|
@ -39,36 +39,34 @@
|
|||
"dependencies": {
|
||||
"asyncstorage-down": "^3.1.1",
|
||||
"bignumber.js": "^5.0.0",
|
||||
"bip21": "^2.0.2",
|
||||
"bip21": "^2.0.1",
|
||||
"bip39": "^2.5.0",
|
||||
"bitcoinjs-lib": "^3.3.2",
|
||||
"buffer": "^5.2.1",
|
||||
"buffer": "^5.1.0",
|
||||
"buffer-reverse": "^1.0.1",
|
||||
"crypto-js": "^3.1.9-1",
|
||||
"eslint-config-prettier": "^2.10.0",
|
||||
"eslint-plugin-prettier": "^2.6.2",
|
||||
"expo": "^30.0.1",
|
||||
"eslint-config-prettier": "^2.9.0",
|
||||
"eslint-plugin-prettier": "^2.6.0",
|
||||
"expo": "^23.0.6",
|
||||
"expo-analytics": "^1.0.7",
|
||||
"frisbee": "^1.6.4",
|
||||
"isaac": "0.0.5",
|
||||
"jest": "^23.6.0",
|
||||
"mocha": "^5.2.0",
|
||||
"mocha": "^5.0.4",
|
||||
"node-libs-react-native": "^1.0.1",
|
||||
"prettier": "^1.14.2",
|
||||
"prettier": "^1.11.1",
|
||||
"process": "^0.11.10",
|
||||
"prop-types": "^15.6.2",
|
||||
"react": "16.3.1",
|
||||
"prop-types": "^15.6.1",
|
||||
"react": "16.0.0",
|
||||
"react-localization": "^1.0.10",
|
||||
"react-native": "https://github.com/expo/react-native/archive/sdk-30.0.0.tar.gz",
|
||||
"react-native": "https://github.com/expo/react-native/archive/sdk-23.0.0.tar.gz",
|
||||
"react-native-camera": "^0.12.0",
|
||||
"react-native-elements": "^0.18.5",
|
||||
"react-native-flexi-radio-button": "^0.2.2",
|
||||
"react-native-level-fs": "^3.0.0",
|
||||
"react-native-material-dropdown": "^0.11.1",
|
||||
"react-native-qrcode": "^0.2.7",
|
||||
"react-native-snap-carousel": "^3.7.4",
|
||||
"react-navigation": "^2.14.2",
|
||||
"react-test-render": "^1.1.1",
|
||||
"react-native-qrcode": "^0.2.6",
|
||||
"react-native-snap-carousel": "^3.7.2",
|
||||
"react-navigation": "^1.0.0-beta.23",
|
||||
"readable-stream": "^1.1.14",
|
||||
"request-promise-native": "^1.0.5",
|
||||
"secure-random": "^1.1.1",
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { createStackNavigator } from 'react-navigation';
|
||||
import { StackNavigator } from 'react-navigation';
|
||||
|
||||
import list from './receive/list';
|
||||
|
||||
const ReceiveNavigator = createStackNavigator(
|
||||
const ReceiveNavigator = StackNavigator(
|
||||
{
|
||||
SendList: {
|
||||
screen: list,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import React, { Component } from 'react';
|
||||
import { FlatList, Text, StyleSheet } from 'react-native';
|
||||
import { ListView, Dimensions } from 'react-native';
|
||||
import Ionicons from 'react-native-vector-icons/Ionicons';
|
||||
import { BlueLoading, SafeBlueArea, BlueCard, BlueListItem, BlueHeader } from '../../BlueComponents';
|
||||
import PropTypes from 'prop-types';
|
||||
|
@ -7,6 +7,8 @@ import PropTypes from 'prop-types';
|
|||
let BlueApp = require('../../BlueApp');
|
||||
let EV = require('../../events');
|
||||
let loc = require('../../loc');
|
||||
const { height } = Dimensions.get('window');
|
||||
let ds = new ListView.DataSource({ rowHasChanged: (r1, r2) => r1 !== r2 });
|
||||
|
||||
export default class ReceiveList extends Component {
|
||||
static navigationOptions = {
|
||||
|
@ -43,7 +45,7 @@ export default class ReceiveList extends Component {
|
|||
this.setState({
|
||||
isLoading: false,
|
||||
list: list,
|
||||
dataSource: list,
|
||||
dataSource: ds.cloneWithRows(list),
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -55,7 +57,7 @@ export default class ReceiveList extends Component {
|
|||
}
|
||||
|
||||
return (
|
||||
<SafeBlueArea forceInset={{ horizontal: 'always' }}>
|
||||
<SafeBlueArea forceInset={{ horizontal: 'always' }} style={{ flex: 1 }}>
|
||||
<BlueHeader
|
||||
centerComponent={{
|
||||
text: loc.receive.list.header,
|
||||
|
@ -64,10 +66,11 @@ export default class ReceiveList extends Component {
|
|||
/>
|
||||
|
||||
<BlueCard containerStyle={{ padding: 0 }}>
|
||||
<FlatList
|
||||
data={this.state.dataSource}
|
||||
style={Styles.flatList}
|
||||
renderItem={item => {
|
||||
<ListView
|
||||
maxHeight={height - 200}
|
||||
enableEmptySections
|
||||
dataSource={this.state.dataSource}
|
||||
renderRow={item => {
|
||||
return (
|
||||
<BlueListItem
|
||||
title={item.title}
|
||||
|
@ -90,12 +93,6 @@ export default class ReceiveList extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
const Styles = StyleSheet.create({
|
||||
flatList: {
|
||||
flex: 1,
|
||||
},
|
||||
});
|
||||
|
||||
ReceiveList.propTypes = {
|
||||
navigation: PropTypes.shape({
|
||||
navigate: PropTypes.func,
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { createStackNavigator } from 'react-navigation';
|
||||
import { StackNavigator } from 'react-navigation';
|
||||
|
||||
import list from './send/list';
|
||||
|
||||
const SendNavigator = createStackNavigator(
|
||||
const SendNavigator = StackNavigator(
|
||||
{
|
||||
SendList: {
|
||||
screen: list,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import React, { Component } from 'react';
|
||||
import { ActivityIndicator, View, FlatList, StyleSheet } from 'react-native';
|
||||
import { Dimensions, ActivityIndicator, View, ListView } from 'react-native';
|
||||
import Ionicons from 'react-native-vector-icons/Ionicons';
|
||||
import { SafeBlueArea, BlueCard, BlueListItem, BlueHeader } from '../../BlueComponents';
|
||||
import PropTypes from 'prop-types';
|
||||
|
@ -7,6 +7,8 @@ let EV = require('../../events');
|
|||
/** @type {AppStorage} */
|
||||
let BlueApp = require('../../BlueApp');
|
||||
let loc = require('../../loc');
|
||||
const { height } = Dimensions.get('window');
|
||||
let ds = new ListView.DataSource({ rowHasChanged: (r1, r2) => r1 !== r2 });
|
||||
|
||||
export default class SendList extends Component {
|
||||
static navigationOptions = {
|
||||
|
@ -43,7 +45,7 @@ export default class SendList extends Component {
|
|||
this.setState({
|
||||
isLoading: false,
|
||||
list: list,
|
||||
dataSource: list,
|
||||
dataSource: ds.cloneWithRows(list),
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -52,16 +54,14 @@ export default class SendList extends Component {
|
|||
|
||||
if (this.state.isLoading) {
|
||||
return (
|
||||
<SafeBlueArea forceInset={{ horizontal: 'always' }}>
|
||||
<View style={{ flex: 1, paddingTop: 20 }}>
|
||||
<ActivityIndicator />
|
||||
</View>
|
||||
</SafeBlueArea>
|
||||
<View style={{ flex: 1, paddingTop: 20 }}>
|
||||
<ActivityIndicator />
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<SafeBlueArea forceInset={{ horizontal: 'always' }}>
|
||||
<SafeBlueArea forceInset={{ horizontal: 'always' }} style={{ flex: 1 }}>
|
||||
<BlueHeader
|
||||
centerComponent={{
|
||||
text: loc.send.list.header,
|
||||
|
@ -70,11 +70,11 @@ export default class SendList extends Component {
|
|||
/>
|
||||
|
||||
<BlueCard containerStyle={{ padding: 0 }}>
|
||||
<FlatList
|
||||
data={this.state.dataSource}
|
||||
extraData={this.state.dataSource}
|
||||
style={Styles.flatList}
|
||||
renderItem={item => {
|
||||
<ListView
|
||||
maxHeight={height - 200}
|
||||
enableEmptySections
|
||||
dataSource={this.state.dataSource}
|
||||
renderRow={item => {
|
||||
return (
|
||||
<BlueListItem
|
||||
title={item.title}
|
||||
|
@ -97,12 +97,6 @@ export default class SendList extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
const Styles = StyleSheet.create({
|
||||
flatList: {
|
||||
flex: 1,
|
||||
},
|
||||
});
|
||||
|
||||
SendList.propTypes = {
|
||||
navigation: PropTypes.shape({
|
||||
navigate: PropTypes.func,
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { createStackNavigator } from 'react-navigation';
|
||||
import { StackNavigator } from 'react-navigation';
|
||||
|
||||
import list from './transactions/list';
|
||||
|
||||
const TransactionsNavigator = createStackNavigator(
|
||||
const TransactionsNavigator = StackNavigator(
|
||||
{
|
||||
TransactionsList: {
|
||||
screen: list,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import React, { Component } from 'react';
|
||||
import { FlatList } from 'react-native';
|
||||
import { ListView, Dimensions } from 'react-native';
|
||||
import Ionicons from 'react-native-vector-icons/Ionicons';
|
||||
import { Header, Icon } from 'react-native-elements';
|
||||
import { BlueLoading, BlueList, SafeBlueArea, BlueCard, BlueText, BlueListItem } from '../../BlueComponents';
|
||||
|
@ -8,6 +8,9 @@ let loc = require('../../loc');
|
|||
let EV = require('../../events');
|
||||
/** @type {AppStorage} */
|
||||
let BlueApp = require('../../BlueApp');
|
||||
const { height } = Dimensions.get('window');
|
||||
|
||||
let ds = new ListView.DataSource({ rowHasChanged: (r1, r2) => r1 !== r2 });
|
||||
|
||||
export default class TransactionsList extends Component {
|
||||
static navigationOptions = {
|
||||
|
@ -41,7 +44,7 @@ export default class TransactionsList extends Component {
|
|||
this.setState({
|
||||
isLoading: false,
|
||||
final_balance: BlueApp.getBalance(),
|
||||
dataSource: BlueApp.getTransactions(),
|
||||
dataSource: ds.cloneWithRows(BlueApp.getTransactions()),
|
||||
});
|
||||
}, 1);
|
||||
},
|
||||
|
@ -78,7 +81,7 @@ export default class TransactionsList extends Component {
|
|||
that.setState({
|
||||
isLoading: false,
|
||||
final_balance: BlueApp.getBalance(),
|
||||
dataSource: BlueApp.getTransactions(),
|
||||
dataSource: ds.cloneWithRows(BlueApp.getTransactions()),
|
||||
});
|
||||
}, 10);
|
||||
},
|
||||
|
@ -106,10 +109,11 @@ export default class TransactionsList extends Component {
|
|||
<BlueText style={{ marginBottom: 10 }}>{loc.transactions.list.description}</BlueText>
|
||||
|
||||
<BlueList>
|
||||
<FlatList
|
||||
data={this.state.dataSource}
|
||||
extraData={this.state.dataSource}
|
||||
renderItem={rowData => {
|
||||
<ListView
|
||||
maxHeight={height - 300}
|
||||
enableEmptySections
|
||||
dataSource={this.state.dataSource}
|
||||
renderRow={rowData => {
|
||||
return (
|
||||
<BlueListItem
|
||||
avatar={
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { createStackNavigator } from 'react-navigation';
|
||||
import { StackNavigator } from 'react-navigation';
|
||||
|
||||
import WalletsList from './wallets/list';
|
||||
import AddWallet from './wallets/add';
|
||||
|
@ -20,7 +20,7 @@ import sendCreate from './send/create';
|
|||
import ManageFunds from './lnd/manageFunds';
|
||||
import ScanLndInvoice from './lnd/scanLndInvoice';
|
||||
|
||||
const WalletsNavigator = createStackNavigator(
|
||||
const WalletsNavigator = StackNavigator(
|
||||
{
|
||||
WalletsList: {
|
||||
screen: WalletsList,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import React, { Component } from 'react';
|
||||
import { View, TouchableOpacity, Dimensions, Text, FlatList } from 'react-native';
|
||||
import { View, TouchableOpacity, Dimensions, Text, ListView } from 'react-native';
|
||||
import {
|
||||
BlueText,
|
||||
BlueTransactionOnchainIcon,
|
||||
|
@ -28,7 +28,9 @@ let A = require('../../analytics');
|
|||
/** @type {AppStorage} */
|
||||
let BlueApp = require('../../BlueApp');
|
||||
let loc = require('../../loc');
|
||||
const { width } = Dimensions.get('window');
|
||||
const { height, width } = Dimensions.get('window');
|
||||
|
||||
let ds = new ListView.DataSource({ rowHasChanged: (r1, r2) => r1 !== r2 });
|
||||
|
||||
export default class WalletsList extends Component {
|
||||
static navigationOptions = {
|
||||
|
@ -119,7 +121,7 @@ export default class WalletsList extends Component {
|
|||
showManageFundsBigButton: showManageFundsBig,
|
||||
showManageFundsSmallButton,
|
||||
showRereshButton,
|
||||
dataSource: BlueApp.getTransactions(this.lastSnappedTo || 0),
|
||||
dataSource: ds.cloneWithRows(BlueApp.getTransactions(this.lastSnappedTo || 0)),
|
||||
});
|
||||
}, 1);
|
||||
}
|
||||
|
@ -156,7 +158,7 @@ export default class WalletsList extends Component {
|
|||
showSendButton: false,
|
||||
showRereshButton: false,
|
||||
// TODO: погуглить че это за ебала ds.cloneWithRows, можно ли быстрее сделать прогрузку транзакций на экран
|
||||
dataSource: BlueApp.getTransactions(index),
|
||||
dataSource: ds.cloneWithRows(BlueApp.getTransactions(index)),
|
||||
});
|
||||
|
||||
if (index < BlueApp.getWallets().length) {
|
||||
|
@ -379,10 +381,13 @@ export default class WalletsList extends Component {
|
|||
|
||||
<View style={{ top: 30, position: 'absolute' }}>
|
||||
<BlueList>
|
||||
<FlatList
|
||||
data={this.state.dataSource}
|
||||
extraData={this.state.dataSource}
|
||||
renderItem={rowData => {
|
||||
<ListView
|
||||
maxHeight={height - 330 + 10}
|
||||
width={width - 5}
|
||||
left={5}
|
||||
enableEmptySections
|
||||
dataSource={this.state.dataSource}
|
||||
renderRow={rowData => {
|
||||
return (
|
||||
<BlueListItem
|
||||
avatar={(() => {
|
||||
|
|
Loading…
Add table
Reference in a new issue