-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* problem: User should be able to store contacts in addressbook * solution: Tx sending refactoring * problem: action types for Addressbook store should be refactored * problem: Sign tx form shows wrong currency symbol in case tokens send solution: Pass tx and nativeTx to Sign form * problem: addressbook UI impovements
- Loading branch information
Showing
61 changed files
with
839 additions
and
559 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[*.js] | ||
indent_style = space | ||
indent_size = 2 |
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
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
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 |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
.listItem { | ||
margin-bottom: 6px; | ||
} | ||
|
||
.hiddenListItem { | ||
opacity: 0.4; | ||
} |
11 changes: 6 additions & 5 deletions
11
src/components/addressbook/add.js → src/components/addressbook/AddContact/add.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
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 @@ | ||
export {default} from './add'; |
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,48 @@ | ||
import React from 'react'; | ||
import { connect } from 'react-redux'; | ||
import muiThemeable from 'material-ui/styles/muiThemeable'; | ||
import { Account } from 'emerald-js-ui'; | ||
import { Trash as DeleteIcon } from 'emerald-js-ui/lib/icons3'; | ||
import { IconButton } from 'material-ui'; | ||
import { gotoScreen } from '../../../store/wallet/screen/screenActions'; | ||
import Addressbook from '../../../store/vault/addressbook'; | ||
|
||
import styles from './Contact.scss'; | ||
|
||
const Render = ({ address, onDeleteAddress, muiTheme }) => ( | ||
<div className={styles.container}> | ||
<div> | ||
<Account | ||
identity | ||
addr={address.get('address')} | ||
name={address.get('name')} | ||
/> | ||
</div> | ||
<div> | ||
<IconButton onClick={onDeleteAddress}> | ||
<DeleteIcon style={{color: muiTheme.palette.secondaryTextColor}}/> | ||
</IconButton> | ||
</div> | ||
</div> | ||
); | ||
|
||
const Address = connect( | ||
(state, ownProps) => ({ | ||
}), | ||
(dispatch, ownProps) => ({ | ||
openAddress: () => { | ||
// const address = ownProps.address; | ||
// dispatch(gotoScreen('address', address.get('address'))); | ||
}, | ||
onDeleteAddress: () => new Promise((resolve, reject) => { | ||
const address = ownProps.address; | ||
dispatch(Addressbook.actions.deleteAddress(address.get('address'))) | ||
.then((response) => { | ||
dispatch(gotoScreen('address-book')); | ||
resolve(response); | ||
}); | ||
}), | ||
}) | ||
)(Render); | ||
|
||
export default muiThemeable()(Address); |
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,7 @@ | ||
.container { | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
background-color: white; | ||
padding: 10px | ||
} |
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,47 @@ | ||
import React from 'react'; | ||
import { connect } from 'react-redux'; | ||
import muiThemeable from 'material-ui/styles/muiThemeable'; | ||
import FlatButton from 'material-ui/FlatButton'; | ||
import { Add as AddIcon, Book as BookIcon } from 'emerald-js-ui/lib/icons3'; | ||
import Avatar from 'material-ui/Avatar'; | ||
import { cardSpace, tables } from 'lib/styles'; | ||
import Immutable from 'immutable'; | ||
import { gotoScreen } from '../../../store/wallet/screen/screenActions'; | ||
import Address from './Contact'; | ||
import TopBar from '../../layout/TopBar'; | ||
|
||
import styles from './ContactList.scss'; | ||
|
||
const ContactList = ({ addressBook, muiTheme }) => { | ||
let list; | ||
if (addressBook.size > 0) { | ||
list = addressBook.map((addr) => ( | ||
<div key={addr.get('address')} style={{ border: `1px solid ${muiTheme.palette.borderColor}` }} className={styles.listItem}> | ||
<Address address={addr} /> | ||
</div>)); | ||
} else { | ||
list = ( | ||
<div style={{ border: `1px solid ${muiTheme.palette.borderColor}` }} className={styles.noItems}> | ||
There are no contacts. Add one. | ||
</div>); | ||
} | ||
|
||
return ( | ||
<div> | ||
<TopBar /> | ||
<div className={styles.container}> | ||
{list} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
const AddressBook = connect( | ||
(state, ownProps) => ({ | ||
addressBook: state.addressBook.get('addressBook', Immutable.List()), | ||
}), | ||
(dispatch, ownProps) => ({ | ||
}) | ||
)(muiThemeable()(ContactList)); | ||
|
||
export default AddressBook; |
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,15 @@ | ||
.container { | ||
margin-bottom: 10px; | ||
margin-top: 5px; | ||
} | ||
|
||
.listItem { | ||
margin-top: 10px; | ||
} | ||
|
||
.noItems { | ||
background-color: white; | ||
padding: 10px; | ||
margin-top: 10px; | ||
text-align: center; | ||
} |
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 @@ | ||
export {default} from './ContactList'; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.