Skip to content

Commit 61334e8

Browse files
estebanminoBruno Barbieri
authored andcommitted
Version 0.1.11 (#872)
* bugfix: tx details (#854) * Fix progress bar (#857) * fix progress bar * fix snapshots * improvement: performance (#858) * update gemfile.lock (#859) * fix sourcemaps dir (#860) * fix (#861) * Bugfix: typed sign v3 (#853) * handle gaba changes * bunmp gaba * lock gaba * fix crash (#863) * fix ens stuff (#865) * Improvement: switch account and network performance (#864) * move account elemnt to its own component * an accountchange * avoid calling getaccounts on render * update when there is actually a change * accountlist * fix delete * requestAnimationFrame on network change * minor wallet improvements * snaps * Add payment channels logs (#866) * add payment channels logs * more logs * fix typo * add license and infos (#868) * fix import wallet view (#869) * bugfix: collectibles empty details (#870) * Bump and disclaimer (#871) * add disclaimer on payment channels * version bump * fix payment channels view in small devices * rollback minimagic (#873)
1 parent c0c6fce commit 61334e8

File tree

151 files changed

+757
-715
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+757
-715
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ jobs:
141141
destination: builds
142142
- store_artifacts:
143143
path: sourcemaps/android
144-
destination: sourcemaps
144+
destination: sourcemaps-android
145145
- run:
146146
name: Announcing pre-release
147147
command: npm run build:announce
@@ -162,7 +162,7 @@ jobs:
162162
command: npm run build:ios:pre-release
163163
- store_artifacts:
164164
path: sourcemaps/ios
165-
destination: sourcemaps
165+
destination: sourcemaps-ios
166166
workflows:
167167
version: 2
168168
full_test:

README.md

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
![MetaMask logo](logo.png?raw=true)
2-
# MetaMask
2+
# MetaMask
33
MetaMask is a mobile web browser that provides easy access to websites that use the [Ethereum](https://ethereum.org/) blockchain.
44

55
For up to the minute news, follow our [Twitter](https://twitter.com/metamask_io) or [Medium](https://medium.com/metamask) pages.
66

77
To learn how to develop MetaMask-compatible applications, visit our [Developer Docs](https://metamask.github.io/metamask-docs/).
88

9-
## MetaMask Mobile
9+
## MetaMask Mobile
1010

11-
### Building locally
11+
### Building locally
1212
The code is built using React-Native and running code locally requires a Mac or Linux OS.
1313

1414
- Install [Node.js](https://nodejs.org) **version 8 (latest stable) and npm@6**
@@ -17,7 +17,7 @@ The code is built using React-Native and running code locally requires a Mac or
1717
- Install npm@6 using `npm install -g npm@6`
1818

1919
- Before starting, you need to install React Native dependencies:
20-
- [MacOs](https://facebook.github.io/react-native/docs/getting-started.html#installing-dependencies-1)
20+
- [MacOs](https://facebook.github.io/react-native/docs/getting-started.html#installing-dependencies-1)
2121
- [Linux](https://facebook.github.io/react-native/docs/getting-started.html#installing-dependencies-2)
2222
- Now clone this repo and then install all our dependencies
2323

@@ -26,7 +26,7 @@ cd MetaMask
2626
npm i
2727
```
2828

29-
- Running the app on Android:
29+
- Running the app on Android:
3030

3131
```bash
3232
npm run start:android
@@ -39,24 +39,29 @@ npm run start:ios
3939
```
4040

4141
### Running tests:
42-
- Unit test:
42+
- Unit test:
4343
```
4444
npm run test:unit
45-
```
45+
```
4646
- E2E Tests (iOS)
4747
```
4848
npm run test:e2e:ios
49-
```
49+
```
5050
- E2E Tests (Android)
5151
```
5252
npm run test:e2e:android
53-
```
53+
```
5454

55-
56-
### Troubleshooting
55+
### Troubleshooting
5756

5857
Visit [Troubleshooting for React Native](https://facebook.github.io/react-native/docs/troubleshooting#content)
59-
58+
6059
## License
6160

62-
To be defined...
61+
MetaMask Mobile is an exciting development for our team and our ecosystem. We've always been proud to offer the MetaMask browser extension under the MIT open source software license. We are still working through licensing considerations for the mobile application in light of a new delivery medium and our business goals. We are exploring many models, all with a significant open component, but we have not made any final decisions.
62+
63+
The source code for this beta is currently viewable under the below copyright. A license to use the mobile version will be distributed along with the mobile application. We believe it is important for our users to be able inspect and verify our code for trustworthiness, but we also wish to preserve our licensing options until we're certain what is best for MetaMask, our community, and our ecosystem. If you have any questions or comments, we would really appreciate hearing your feedback – you can reach us at [email protected]
64+
65+
© ConsenSys AG, 2016-2019
66+
67+
You are granted a limited non-exclusive license to inspect and study the code in this repository. There is no associated right to reproduction granted under this license except where reproduction is necessary for inspection and study of the code. You may not otherwise reproduce, distribute, modify or create derivative works of the code without our prior consent. All other rights are expressly reserved.

android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,8 @@ android {
174174
applicationId "io.metamask"
175175
minSdkVersion rootProject.ext.minSdkVersion
176176
targetSdkVersion rootProject.ext.targetSdkVersion
177-
versionCode 11
178-
versionName "0.1.10"
177+
versionCode 12
178+
versionName "0.1.11"
179179
multiDexEnabled true
180180
testBuildType System.getProperty('testBuildType', 'debug')
181181
missingDimensionStrategy "minReactNative", "minReactNative46"

app/components/Nav/Main/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { Component } from 'react';
1+
import React, { PureComponent } from 'react';
22
import {
33
InteractionManager,
44
ActivityIndicator,
@@ -313,7 +313,7 @@ const MainNavigator = createStackNavigator(
313313
}
314314
);
315315

316-
class Main extends Component {
316+
class Main extends PureComponent {
317317
static router = {
318318
...MainNavigator.router
319319
};

app/components/UI/AccountApproval/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { Component } from 'react';
1+
import React, { PureComponent } from 'react';
22
import { connect } from 'react-redux';
33
import PropTypes from 'prop-types';
44
import { StyleSheet, Text, View, InteractionManager } from 'react-native';
@@ -150,7 +150,7 @@ const styles = StyleSheet.create({
150150
/**
151151
* Account access approval component
152152
*/
153-
class AccountApproval extends Component {
153+
class AccountApproval extends PureComponent {
154154
static propTypes = {
155155
/**
156156
* Object containing current page title, url, and icon href

app/components/UI/AccountInput/index.js

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { Component } from 'react';
1+
import React, { PureComponent } from 'react';
22
import Icon from 'react-native-vector-icons/FontAwesome';
33
import Identicon from '../Identicon';
44
import PropTypes from 'prop-types';
@@ -118,7 +118,7 @@ const styles = StyleSheet.create({
118118
* ComboBox form component allowing address input with auto-completion based on
119119
* the current keychain's accounts
120120
*/
121-
class AccountInput extends Component {
121+
class AccountInput extends PureComponent {
122122
static propTypes = {
123123
/**
124124
* List of accounts from the PreferencesController
@@ -171,7 +171,7 @@ class AccountInput extends Component {
171171
/**
172172
* Map representing the address book
173173
*/
174-
addressBook: PropTypes.array,
174+
addressBook: PropTypes.object,
175175
/**
176176
* Callback close all drowpdowns
177177
*/
@@ -223,7 +223,7 @@ class AccountInput extends Component {
223223
const { address } = this.state;
224224
try {
225225
const resolvedAddress = await this.ens.lookup(recipient.trim());
226-
if (address !== ZERO_ADDRESS && resolvedAddress !== address) {
226+
if (address !== ZERO_ADDRESS && isValidAddress(resolvedAddress)) {
227227
this.setState({ address: resolvedAddress, ensRecipient: recipient });
228228
return true;
229229
}
@@ -296,14 +296,7 @@ class AccountInput extends Component {
296296

297297
getVisibleOptions = value => {
298298
const { accounts, addressBook } = this.props;
299-
const addressBookItems = {};
300-
if (addressBook.length > 0) {
301-
addressBook.forEach(contact => {
302-
addressBookItems[contact.address] = contact;
303-
});
304-
}
305-
306-
const allAddresses = { ...addressBookItems, ...accounts };
299+
const allAddresses = { ...addressBook, ...accounts };
307300

308301
if (typeof value !== 'undefined' && value.toString().length > 0) {
309302
// If it's a valid address we don't show any suggestion
@@ -321,7 +314,10 @@ class AccountInput extends Component {
321314
filteredAddresses[address] = allAddresses[address];
322315
}
323316
});
324-
return filteredAddresses;
317+
318+
if (filteredAddresses.length > 0) {
319+
return filteredAddresses;
320+
}
325321
}
326322
return allAddresses;
327323
};
@@ -373,6 +369,10 @@ class AccountInput extends Component {
373369
});
374370
};
375371

372+
closeDropdown = () => {
373+
// nice to have
374+
};
375+
376376
render = () => {
377377
const { value, ensRecipient, address } = this.state;
378378
const { placeholder, isOpen } = this.props;
@@ -398,6 +398,7 @@ class AccountInput extends Component {
398398
numberOfLines={1}
399399
onBlur={this.onBlur}
400400
onFocus={this.onInputFocus}
401+
onSubmitEditing={this.onFocus}
401402
/>
402403
<View style={styles.ensView}>
403404
{ensRecipient && <Text style={styles.ensAddress}>{renderShortAddress(address)}</Text>}
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
import React, { PureComponent } from 'react';
2+
import Identicon from '../../Identicon';
3+
import PropTypes from 'prop-types';
4+
import { TouchableOpacity, StyleSheet, Text, View } from 'react-native';
5+
import { colors, fontStyles } from '../../../../styles/common';
6+
import { renderFromWei } from '../../../../util/number';
7+
import { getTicker } from '../../../../util/transactions';
8+
import { strings } from '../../../../../locales/i18n';
9+
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
10+
11+
const styles = StyleSheet.create({
12+
account: {
13+
borderBottomWidth: StyleSheet.hairlineWidth,
14+
borderColor: colors.grey100,
15+
flexDirection: 'row',
16+
paddingHorizontal: 20,
17+
paddingVertical: 20,
18+
height: 80
19+
},
20+
accountInfo: {
21+
marginLeft: 15,
22+
marginRight: 0,
23+
flex: 1,
24+
flexDirection: 'row'
25+
},
26+
accountLabel: {
27+
fontSize: 18,
28+
color: colors.fontPrimary,
29+
...fontStyles.normal
30+
},
31+
accountBalance: {
32+
paddingTop: 5,
33+
fontSize: 12,
34+
color: colors.fontSecondary,
35+
...fontStyles.normal
36+
},
37+
importedView: {
38+
flex: 0.5,
39+
alignItems: 'center',
40+
marginTop: 2
41+
},
42+
accountMain: {
43+
flex: 1,
44+
flexDirection: 'column'
45+
},
46+
selectedWrapper: {
47+
flex: 0.2,
48+
alignItems: 'flex-end'
49+
},
50+
importedText: {
51+
color: colors.grey400,
52+
fontSize: 10,
53+
...fontStyles.bold
54+
},
55+
importedWrapper: {
56+
width: 73,
57+
paddingHorizontal: 10,
58+
paddingVertical: 3,
59+
borderRadius: 10,
60+
borderWidth: 1,
61+
borderColor: colors.grey400
62+
}
63+
});
64+
65+
/**
66+
* View that renders specific account element in AccountList
67+
*/
68+
export default class AccountElement extends PureComponent {
69+
static propTypes = {
70+
/**
71+
* Callback to be called onPress
72+
*/
73+
onPress: PropTypes.func.isRequired,
74+
/**
75+
* Callback to be called onLongPress
76+
*/
77+
onLongPress: PropTypes.func.isRequired,
78+
/**
79+
* Current ticker
80+
*/
81+
ticker: PropTypes.string,
82+
item: PropTypes.object
83+
};
84+
85+
onPress = () => {
86+
const { onPress } = this.props;
87+
const { index } = this.props.item;
88+
onPress && onPress(index);
89+
};
90+
91+
onLongPress = () => {
92+
const { onLongPress } = this.props;
93+
const { address, isImported, index } = this.props.item;
94+
onLongPress && onLongPress(address, isImported, index);
95+
};
96+
97+
render() {
98+
const { address, balance, ticker, name, isSelected, isImported } = this.props.item;
99+
const selected = isSelected ? <Icon name="check-circle" size={30} color={colors.blue} /> : null;
100+
const imported = isImported ? (
101+
<View style={styles.importedWrapper}>
102+
<Text numberOfLines={1} style={styles.importedText}>
103+
{strings('accounts.imported')}
104+
</Text>
105+
</View>
106+
) : null;
107+
return (
108+
<TouchableOpacity
109+
style={styles.account}
110+
key={`account-${address}`}
111+
onPress={this.onPress}
112+
onLongPress={this.onLongPress}
113+
>
114+
<Identicon address={address} diameter={38} />
115+
<View style={styles.accountInfo}>
116+
<View style={styles.accountMain}>
117+
<Text numberOfLines={1} style={[styles.accountLabel]}>
118+
{name}
119+
</Text>
120+
<Text style={styles.accountBalance}>
121+
{renderFromWei(balance)} {getTicker(ticker)}
122+
</Text>
123+
</View>
124+
{imported && <View style={styles.importedView}>{imported}</View>}
125+
<View style={styles.selectedWrapper}>{selected}</View>
126+
</View>
127+
</TouchableOpacity>
128+
);
129+
}
130+
}

app/components/UI/AccountList/__snapshots__/index.test.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`Accounts should render correctly 1`] = `
4-
<AccountList
4+
<Connect(AccountList)
55
accounts={
66
Object {
77
"0xe7E125654064EEa56229f273dA586F10DF96B0a1": Object {

0 commit comments

Comments
 (0)