This repository has been archived by the owner on Apr 15, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'development' into 531-unit-test-coverage
- Loading branch information
Showing
24 changed files
with
296 additions
and
188 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 |
---|---|---|
@@ -1,18 +1,35 @@ | ||
import actionTypes from '../constants/actions'; | ||
|
||
/** | ||
* Trigger this action to update the account object | ||
* while already logged in | ||
* | ||
* | ||
* @param {Object} data - account data | ||
* @returns {Object} - Action object | ||
*/ | ||
export const accountUpdated = data => ({ | ||
data, | ||
type: actionTypes.accountUpdated, | ||
}); | ||
|
||
/** | ||
* Trigger this action to log out of the account | ||
* while already logged in | ||
* | ||
* | ||
* @returns {Object} - Action object | ||
*/ | ||
export const accountLoggedOut = () => ({ | ||
type: actionTypes.accountLoggedOut, | ||
}); | ||
|
||
/** | ||
* Trigger this action to login to an account | ||
* The login middleware triggers this action | ||
* | ||
* @param {Object} data - account data | ||
* @returns {Object} - Action object | ||
*/ | ||
export const accountLoggedIn = data => ({ | ||
type: actionTypes.accountLoggedIn, | ||
data, | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import React from 'react'; | ||
import grid from 'flexboxgrid/dist/flexboxgrid.css'; | ||
import styles from './account.css'; | ||
import Address from './address'; | ||
import LiskAmount from '../liskAmount'; | ||
import ClickToSend from '../send/clickToSend'; | ||
import { toRawLsk } from '../../utils/lsk'; | ||
|
||
/** | ||
* Contains some of the important and basic information about the account | ||
* | ||
* @param {object} props - include properties of component | ||
*/ | ||
const Account = ({ | ||
account, peers, | ||
}) => { | ||
const status = (peers.status && peers.status.online) ? | ||
<i className="material-icons online">check</i> | ||
: <i className="material-icons offline">error</i>; | ||
|
||
return ( | ||
<section className={`${grid.row} ${styles.wrapper}`}> | ||
<article className={grid['col-xs-4']}> | ||
<Address {...account}></Address> | ||
</article> | ||
<article className={grid['col-xs-4']}> | ||
<div className="box"> | ||
<h3 className={styles.title}>Peer</h3> | ||
<div className={styles['value-wrapper']}> | ||
<span id="accountStatus" className="status"> | ||
{status} | ||
</span> | ||
<p className="inner primary"> | ||
{peers.data.options.name} | ||
</p> | ||
<p className="inner secondary peer"> | ||
{peers.data.currentPeer} | ||
<span> : {peers.data.port}</span> | ||
</p> | ||
</div> | ||
</div> | ||
</article> | ||
<article className={`${grid['col-xs-4']} balance`}> | ||
<div className="box"> | ||
<h3 className={styles.title}>Balance</h3> | ||
<ClickToSend | ||
rawAmount={Math.max(0, account.balance - toRawLsk(0.1))} > | ||
<div className={styles['value-wrapper']}> | ||
<p className="inner primary full hasTip balance-value"> | ||
<LiskAmount val={account.balance} /> LSK | ||
</p> | ||
<p className="inner secondary tooltip"> | ||
Click to send all funds | ||
</p> | ||
</div> | ||
</ClickToSend> | ||
</div> | ||
</article> | ||
</section> | ||
); | ||
}; | ||
|
||
export default Account; |
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 was deleted.
Oops, something went wrong.
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
Oops, something went wrong.