Commit 64db01e3 authored by Marek Kotewicz's avatar Marek Kotewicz
Browse files

display addresses on accounts list, fix back button display

parent 22a30164
......@@ -38,13 +38,13 @@ pub unsafe extern fn ethkey_keypair_brainwallet(seed: *mut StringPtr) -> *mut Ke
#[no_mangle]
pub unsafe extern fn ethkey_keypair_secret(keypair: *mut KeyPair) -> *mut String {
let secret = (*keypair).secret().to_string();
let secret = format!("{:?}", (*keypair).secret());
Box::into_raw(Box::new(secret))
}
#[no_mangle]
pub unsafe extern fn ethkey_keypair_address(keypair: *mut KeyPair) -> *mut String {
let address = (*keypair).address().to_string();
let address = format!("{:?}", (*keypair).address());
Box::into_raw(Box::new(address))
}
......@@ -33,10 +33,14 @@ export default class AccountsList extends Component {
dataSource={this.state.dataSource}
renderRow={(rowData, sectionID: number, rowID: number, highlightRow) => {
return (
<AccountsListRow text={rowData.name ? rowData.name : '0x' + rowData.address} onPress={() => {
highlightRow(sectionID, rowID)
this.props.onAccountSelected(this.props.accounts[rowID])
}}/>
<AccountsListRow
upperText={rowData.name ? rowData.name : 'no name'}
lowerText={'0x' + rowData.address}
onPress={() => {
highlightRow(sectionID, rowID)
this.props.onAccountSelected(this.props.accounts[rowID])
}}
/>
)
}}
enableEmptySections={true}
......
......@@ -3,7 +3,8 @@ import { TouchableHighlight, StyleSheet, View, Text } from 'react-native'
export default class AccountsListRow extends Component {
static propTypes = {
text: PropTypes.string.isRequired,
upperText: PropTypes.string.isRequired,
lowerText: PropTypes.string.isRequired,
onPress: PropTypes.func.isRequired,
}
......@@ -12,7 +13,10 @@ export default class AccountsListRow extends Component {
<TouchableHighlight style={styles.row} onPress={this.props.onPress} underlayColor='#0004'>
<View style={{flexDirection: 'row'}}>
<View style={styles.square}/>
<Text style={styles.text} fontSize={16} ellipsizeMode="middle" numberOfLines={1}>{this.props.text}</Text>
<View style={{flexDirection: 'column'}}>
<Text style={styles.upperText} ellipsizeMode="middle" numberOfLines={1}>{this.props.upperText}</Text>
<Text style={styles.lowerText} ellipsizeMode="middle" numberOfLines={1}>{this.props.lowerText}</Text>
</View>
</View>
</TouchableHighlight>
)
......@@ -32,9 +36,14 @@ const styles = StyleSheet.create({
backgroundColor: '#D8D8D8',
marginRight: 10,
},
text: {
upperText: {
marginTop: 20,
width: 200,
//flex: 1,
fontSize: 16,
},
lowerText: {
marginTop: 5,
color: '#ddd',
fontSize: 10,
}
})
......@@ -34,22 +34,64 @@ const scenes = Actions.create(
<Scene key='root'>
<Scene key='tabs' tabs style={styles.tabbar}>
<Scene key='left' title='Scan QR' initial icon={TabIcon} navigationBarStyle={styles.navibar} titleStyle={styles.navibarTitle}>
<Scene key='scan' component={QrScanner} title='Scan QR' rightTitle="skip :)"
onRight={() => Actions.confirm()} rightButtonTextStyle={styles.navibarTitle}/>
<Scene key='confirm' component={ConfirmTransaction} title='Sign Tx'/>
<Scene key='select' title='Select Account' component={SelectAccount}/>
<Scene key='enterPin' title='Enter Pin' component={EnterPin}/>
<Scene key='scan'
component={QrScanner}
title='Scan QR'
rightTitle="Skip*"
onRight={() => Actions.confirm()}
rightButtonTextStyle={styles.navibarTitle}
/>
<Scene key='confirm' component={ConfirmTransaction} title='Sign Tx'
backTitle='Back'
backButtonTextStyle={styles.navibarTitle}
hideBackImage={true}
/>
<Scene key='select' title='Select Account' component={SelectAccount}
backTitle='Back'
backButtonTextStyle={styles.navibarTitle}
hideBackImage={true}
/>
<Scene key='enterPin' title='Enter Pin' component={EnterPin}
backTitle='Back'
backButtonTextStyle={styles.navibarTitle}
hideBackImage={true}
/>
<Scene key='display' title='QR Code' component={QrDisplay} rightTitle='Done'
onRight={() => Actions.popTo('left')} rightButtonTextStyle={styles.navibarTitle}/>
onRight={() => Actions.popTo('left')}
rightButtonTextStyle={styles.navibarTitle}
backTitle='Back'
backButtonTextStyle={styles.navibarTitle}
hideBackImage={true}
/>
</Scene>
<Scene key='right' title='Accounts' icon={TabIcon} navigationBarStyle={styles.navibar} titleStyle={styles.navibarTitle}>
<Scene key='accounts' title='Accounts' component={Accounts}
rightTitle="Add" onRight={() => Actions.add()} rightButtonTextStyle={styles.navibarTitle}/>
<Scene key='add' component={NewAccount} title='Add Account'/>
<Scene key='setPin' title='Set Pin' component={SetPin}/>
<Scene key='confirmPin' title='Confirm Pin' component={ConfirmPin}/>
<Scene key='details' component={Account} title='Account Details'/>
<Scene key='send' component={Send} title='Send TX'/>
<Scene key='add' component={NewAccount} title='Add Account'
backTitle='Back'
backButtonTextStyle={styles.navibarTitle}
hideBackImage={true}
/>
<Scene key='setPin' title='Set Pin' component={SetPin}
backTitle='Back'
backButtonTextStyle={styles.navibarTitle}
hideBackImage={true}
/>
<Scene key='confirmPin' title='Confirm Pin' component={ConfirmPin}
backTitle='Back'
backButtonTextStyle={styles.navibarTitle}
hideBackImage={true}
/>
<Scene key='details' component={Account} title='Account Details'
backTitle='Back'
backButtonTextStyle={styles.navibarTitle}
hideBackImage={true}
/>
<Scene key='send' component={Send} title='Send TX'
backTitle='Back'
backButtonTextStyle={styles.navibarTitle}
hideBackImage={true}
/>
</Scene>
</Scene>
</Scene>
......
......@@ -96,6 +96,7 @@ const styles = StyleSheet.create({
},
address: {
marginBottom: 20,
fontSize: 12,
},
input: {
height: 20,
......
......@@ -2,12 +2,12 @@ import { ADD_ACCOUNT, SELECT_ACCOUNT, DELETE_ACCOUNT, SET_PIN } from '../constan
const initialAccounts = {
all: [{
address: 'mock',
name: 'dupa',
address: 'bF35fAA9C265bAf50C9CFF8c389C363B05753275',
name: 'Test: Wallet',
pin: '',
}, {
address: 'mock',
name: 'Katar',
address: '4EECf99D543B278106ac0c0e8ffe616F2137f10a',
name: 'Test: LockMyEther',
pin: '',
}],
selected: {},
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment