-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* navbar with icons * fix statusbar color * decent progress * clean up * added gradient bg * added roboto font * clean up * fixed icons and navigation flow * updated UI. working on both platforms * fix warning * added tests * added assets * fixed tests * singleton works * engine singleton and redux * fix tests * clean up eslintigore * fix eslint ignore * add shim.js back to .gitignore * fix AccountOverview * Accounts => AccountList * added comments for doc purposes * more clean up * more cleaning * more comments * let xcode cleanup stuff * fix tests
- Loading branch information
Bruno Barbieri
authored
Aug 8, 2018
1 parent
3f52dcd
commit 15aa2f0
Showing
116 changed files
with
3,787 additions
and
320 deletions.
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.