-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Wallet UI #14
Merged
+3,787
−320
Merged
Wallet UI #14
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
6320a28
navbar with icons
brunobar79 c7a0290
fix statusbar color
brunobar79 63cf98b
decent progress
brunobar79 b547f1c
clean up
brunobar79 40d12d5
added gradient bg
brunobar79 9381ca6
added roboto font
brunobar79 2b6b9fe
clean up
brunobar79 8776f05
fix merge conflicts
brunobar79 6077fb9
fixed icons and navigation flow
brunobar79 1e06cec
updated UI. working on both platforms
brunobar79 d4fb0c8
fix warning
brunobar79 606ace0
added tests
brunobar79 0a4b7d0
added assets
brunobar79 7ae75c0
fixed tests
brunobar79 d8bb19a
settings working properly
brunobar79 9d74187
singleton works
brunobar79 fbb44a9
engine singleton and redux
brunobar79 64473c7
fix tests
brunobar79 14d05c1
fix merge conflicts
brunobar79 4f89e88
clean up eslintigore
brunobar79 dd7e131
fix eslint ignore
brunobar79 150bac9
add shim.js back to .gitignore
brunobar79 1c5e5a6
fix AccountOverview
brunobar79 fda73fa
Accounts => AccountList
brunobar79 05cfb39
added comments for doc purposes
brunobar79 125e6db
more clean up
brunobar79 1cb530e
more cleaning
brunobar79 dd602df
more comments
brunobar79 09ef484
let xcode cleanup stuff
brunobar79 7b46886
fix tests
brunobar79 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ ios | |
node_modules | ||
package-lock.json | ||
package.json | ||
app/util/blockies.js | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
154 changes: 154 additions & 0 deletions
154
app/components/AccountList/__snapshots__/index.test.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Accounts should render correctly 1`] = ` | ||
<SafeAreaView | ||
style={ | ||
Object { | ||
"backgroundColor": "#f1f2f6", | ||
"flex": 1, | ||
} | ||
} | ||
> | ||
<Component | ||
style={ | ||
Object { | ||
"color": "#333333", | ||
"fontFamily": "Roboto", | ||
"fontSize": 25, | ||
"fontWeight": "500", | ||
"marginHorizontal": 20, | ||
"marginVertical": 30, | ||
} | ||
} | ||
> | ||
My Accounts | ||
</Component> | ||
<Component> | ||
<TouchableOpacity | ||
activeOpacity={0.2} | ||
key="account-0xe7E125654064EEa56229f273dA586F10DF96B0a1" | ||
onPress={[Function]} | ||
style={ | ||
Object { | ||
"flexDirection": "row", | ||
"marginBottom": 20, | ||
"marginLeft": 20, | ||
} | ||
} | ||
> | ||
<Component | ||
style={ | ||
Object { | ||
"marginRight": 15, | ||
"width": 30, | ||
} | ||
} | ||
> | ||
<Icon | ||
allowFontScaling={false} | ||
color="#007aff" | ||
name="check" | ||
size={30} | ||
/> | ||
</Component> | ||
<IdenticonComponent | ||
address="0xe7E125654064EEa56229f273dA586F10DF96B0a1" | ||
diameter={38} | ||
/> | ||
<Component | ||
style={ | ||
Object { | ||
"marginLeft": 15, | ||
} | ||
} | ||
> | ||
<Component | ||
style={ | ||
Object { | ||
"color": "#333333", | ||
"fontFamily": "Roboto", | ||
"fontSize": 18, | ||
"fontWeight": "400", | ||
} | ||
} | ||
> | ||
Account 1 | ||
</Component> | ||
<Component | ||
style={ | ||
Object { | ||
"color": "#999999", | ||
"fontFamily": "Roboto", | ||
"fontSize": 12, | ||
"fontWeight": "400", | ||
"paddingTop": 5, | ||
} | ||
} | ||
> | ||
0.017700 | ||
ETH | ||
</Component> | ||
</Component> | ||
</TouchableOpacity> | ||
<TouchableOpacity | ||
activeOpacity={0.2} | ||
key="account-0xf4F6A83117a9D0a9cA3b9684DEDaBc69d56721D8" | ||
onPress={[Function]} | ||
style={ | ||
Object { | ||
"flexDirection": "row", | ||
"marginBottom": 20, | ||
"marginLeft": 20, | ||
} | ||
} | ||
> | ||
<Component | ||
style={ | ||
Object { | ||
"marginRight": 15, | ||
"width": 30, | ||
} | ||
} | ||
/> | ||
<IdenticonComponent | ||
address="0xf4F6A83117a9D0a9cA3b9684DEDaBc69d56721D8" | ||
diameter={38} | ||
/> | ||
<Component | ||
style={ | ||
Object { | ||
"marginLeft": 15, | ||
} | ||
} | ||
> | ||
<Component | ||
style={ | ||
Object { | ||
"color": "#333333", | ||
"fontFamily": "Roboto", | ||
"fontSize": 18, | ||
"fontWeight": "400", | ||
} | ||
} | ||
> | ||
Account 2 | ||
</Component> | ||
<Component | ||
style={ | ||
Object { | ||
"color": "#999999", | ||
"fontFamily": "Roboto", | ||
"fontSize": 12, | ||
"fontWeight": "400", | ||
"paddingTop": 5, | ||
} | ||
} | ||
> | ||
0.4 | ||
ETH | ||
</Component> | ||
</Component> | ||
</TouchableOpacity> | ||
</Component> | ||
</SafeAreaView> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
import React, { Component } from 'react'; | ||
import { TouchableOpacity, StyleSheet, Text, View, SafeAreaView } from 'react-native'; | ||
import Icon from 'react-native-vector-icons/Feather'; | ||
import { colors, fontStyles } from '../../styles/common'; | ||
import Identicon from '../Identicon'; | ||
|
||
const styles = StyleSheet.create({ | ||
wrapper: { | ||
backgroundColor: colors.concrete, | ||
flex: 1 | ||
}, | ||
title: { | ||
fontSize: 25, | ||
marginVertical: 30, | ||
marginHorizontal: 20, | ||
color: colors.fontPrimary, | ||
...fontStyles.bold | ||
}, | ||
account: { | ||
flexDirection: 'row', | ||
marginLeft: 20, | ||
marginBottom: 20 | ||
}, | ||
accountInfo: { | ||
marginLeft: 15 | ||
}, | ||
accountLabel: { | ||
fontSize: 18, | ||
color: colors.fontPrimary, | ||
...fontStyles.normal | ||
}, | ||
accountBalance: { | ||
paddingTop: 5, | ||
fontSize: 12, | ||
color: colors.fontSecondary, | ||
...fontStyles.normal | ||
}, | ||
selected: { | ||
width: 30, | ||
marginRight: 15 | ||
} | ||
}); | ||
|
||
/** | ||
* View contains the list of all the available accounts | ||
*/ | ||
|
||
export default class AccountList extends Component { | ||
state = { | ||
selectedAccountIndex: 0 | ||
}; | ||
|
||
onAccountPress = newIndex => { | ||
this.setState({ selectedAccountIndex: newIndex }); | ||
}; | ||
|
||
renderAccounts() { | ||
const accounts = [ | ||
{ | ||
label: 'Account 1', | ||
address: '0xe7E125654064EEa56229f273dA586F10DF96B0a1', | ||
balance: '0.017700' | ||
}, | ||
{ | ||
label: 'Account 2', | ||
address: '0xf4F6A83117a9D0a9cA3b9684DEDaBc69d56721D8', | ||
balance: '0.4' | ||
} | ||
]; | ||
|
||
return accounts.map((account, i) => { | ||
const selected = | ||
this.state.selectedAccountIndex === i ? <Icon name="check" size={30} color={colors.primary} /> : null; | ||
|
||
const { address, label, balance } = account; | ||
|
||
return ( | ||
<TouchableOpacity | ||
style={styles.account} | ||
key={`account-${address}`} | ||
onPress={() => this.onAccountPress(i)} // eslint-disable-line | ||
> | ||
<View style={styles.selected}>{selected}</View> | ||
<Identicon address={address} diameter={38} /> | ||
<View style={styles.accountInfo}> | ||
<Text style={styles.accountLabel}>{label}</Text> | ||
<Text style={styles.accountBalance}>{balance} ETH</Text> | ||
</View> | ||
</TouchableOpacity> | ||
); | ||
}); | ||
} | ||
|
||
render() { | ||
return ( | ||
<SafeAreaView style={styles.wrapper}> | ||
<Text style={styles.title}>My Accounts</Text> | ||
<View style={styles.accountsWrapper}>{this.renderAccounts()}</View> | ||
</SafeAreaView> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
import Accounts from './'; | ||
|
||
describe('Accounts', () => { | ||
it('should render correctly', () => { | ||
const wrapper = shallow(<Accounts />); | ||
expect(wrapper).toMatchSnapshot(); | ||
}); | ||
}); |
92 changes: 92 additions & 0 deletions
92
app/components/AccountOverview/__snapshots__/index.test.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`AccountOverview should render correctly 1`] = ` | ||
<Component | ||
style={ | ||
Object { | ||
"backgroundColor": "#FFFFFF", | ||
"height": 130, | ||
"paddingBottom": 0, | ||
"paddingHorizontal": 20, | ||
"paddingTop": 20, | ||
} | ||
} | ||
> | ||
<Component | ||
style={ | ||
Object { | ||
"flex": 1, | ||
"flexDirection": "row", | ||
} | ||
} | ||
> | ||
<Component | ||
style={ | ||
Object { | ||
"flex": 1, | ||
} | ||
} | ||
> | ||
<Component | ||
style={ | ||
Object { | ||
"fontFamily": "Roboto", | ||
"fontSize": 20, | ||
"fontWeight": "400", | ||
"paddingTop": 7, | ||
} | ||
} | ||
> | ||
Account 1 | ||
</Component> | ||
<Component | ||
style={ | ||
Object { | ||
"color": "#333333", | ||
"flex": 1, | ||
"fontFamily": "Roboto", | ||
"fontSize": 43, | ||
"fontWeight": "400", | ||
"lineHeight": 43, | ||
"paddingTop": 15, | ||
} | ||
} | ||
> | ||
$ | ||
1604.2 | ||
</Component> | ||
</Component> | ||
<Component | ||
style={ | ||
Object { | ||
"alignItems": "flex-end", | ||
"flex": 1, | ||
"paddingTop": 5, | ||
} | ||
} | ||
> | ||
<QRCode | ||
bgColor="#333333" | ||
fgColor="#FFFFFF" | ||
onLoad={[Function]} | ||
onLoadEnd={[Function]} | ||
size={60} | ||
value="0xe7E125654064EEa56229f273dA586F10DF96B0a1" | ||
/> | ||
<Component | ||
style={ | ||
Object { | ||
"flex": 1, | ||
"fontFamily": "Roboto", | ||
"fontSize": 12, | ||
"fontWeight": "400", | ||
"marginTop": 10, | ||
} | ||
} | ||
> | ||
0xe7...B0a1 | ||
</Component> | ||
</Component> | ||
</Component> | ||
</Component> | ||
`; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use https://www.npmjs.com/package/blockies or a git ref NPM module instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tried using a couple of packages and none of them worked correctly. The extension is doing the same thing here and I think the reason for that is this commit: MetaMask/metamask-extension@1b89ceb