forked from Splyse/NeoLink
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #113 from FredrikOseberg/compress-larger-render-fu…
…nctions Compress larger render functions
- Loading branch information
Showing
22 changed files
with
465 additions
and
433 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
This file was deleted.
Oops, something went wrong.
41 changes: 41 additions & 0 deletions
41
src/app/components/AccountInfo/AccountInfoAmounts/AccountInfoAmounts.css
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,41 @@ | ||
.accountInfoAmounts { | ||
margin-top: 40px; | ||
display: flex; | ||
justify-content: space-around; | ||
color: #585858; | ||
position: relative; | ||
} | ||
|
||
.accountInfoNeoAmount, | ||
.accountInfoGasAmount { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
} | ||
|
||
.accountInfoNeoAmountImg { | ||
width: 25px; | ||
} | ||
|
||
.accountInfoGasAmount svg { | ||
font-size: 1.3rem; | ||
margin-bottom: 3px; | ||
color: #36b049; | ||
} | ||
|
||
.accountInfoAmountParagraph { | ||
font-size: 1rem; | ||
border: 1px solid #36b149; | ||
color: #36b149; | ||
padding: 4px 10px; | ||
border-radius: 50px; | ||
} | ||
|
||
|
||
.accountInfoRefreshButton { | ||
font-size: 1.2rem; | ||
border: none; | ||
color: #585858; | ||
position: absolute; | ||
cursor: pointer; | ||
} |
32 changes: 32 additions & 0 deletions
32
src/app/components/AccountInfo/AccountInfoAmounts/index.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React from 'react' | ||
import PropTypes from 'prop-types' | ||
|
||
import neonPNG from '../../../../img/icon-34.png' | ||
|
||
import style from './AccountInfoAmounts.css' | ||
|
||
const AccountInfoAmounts = ({ neo, getBalance, gas }) => { | ||
return ( | ||
<div className={ style.accountInfoAmounts }> | ||
<div className={ style.accountInfoNeoAmount }> | ||
<img src={ neonPNG } alt='Neo' className={ style.accountInfoNeoAmountImg } /> | ||
<p className={ style.accountInfoAmountParagraph }>{neo} NEO</p> | ||
</div> | ||
<button className={ style.accountInfoRefreshButton } onClick={ getBalance }> | ||
<i className='fas fa-sync' /> | ||
</button> | ||
<div className={ style.accountInfoGasAmount }> | ||
<i className='fas fa-tint' /> | ||
<p className={ style.accountInfoAmountParagraph }>{gas > 0 ? gas : 0} GAS</p> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
AccountInfoAmounts.propTypes = { | ||
neo: PropTypes.number.isRequired, | ||
gas: PropTypes.number.isRequired, | ||
getBalance: PropTypes.func.isRequired, | ||
} | ||
|
||
export default AccountInfoAmounts |
27 changes: 27 additions & 0 deletions
27
src/app/components/AccountInfo/AccountInfoDropDownContent/AccountInfoDropDownContent.css
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,27 @@ | ||
.dropDownLinks, | ||
.dropDownLinksButton { | ||
color: #585858; | ||
text-decoration: none; | ||
border: none; | ||
background-color: transparent; | ||
text-align: left; | ||
padding-left: 0; | ||
font-family: Roboto; | ||
font-size: 0.9rem; | ||
cursor: pointer; | ||
width: 100%; | ||
display: block; | ||
padding: 5px 10px; | ||
} | ||
|
||
.dropDownLinks:hover, | ||
.dropDownLinksButton:hover { | ||
background-color: #ededed; | ||
} | ||
|
||
.dropDownLinks svg, | ||
.dropDownLinksButton svg { | ||
margin-right: 5px; | ||
color: #585858; | ||
font-size: 1rem; | ||
} |
29 changes: 29 additions & 0 deletions
29
src/app/components/AccountInfo/AccountInfoDropDownContent/index.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React, { Fragment } from 'react' | ||
import PropTypes from 'prop-types' | ||
import { Link } from 'react-router-dom' | ||
|
||
import style from './AccountInfoDropDownContent.css' | ||
|
||
const AccountInfoDropDownContent = ({ onClickHandler, address }) => { | ||
return ( | ||
<Fragment> | ||
<Link to='/send' className={ style.dropDownLinks }> | ||
<i className='fas fa-paper-plane' />Send | ||
</Link> | ||
|
||
<Link to={ `https://neoscan.io/address/${address}` } target='_blank' className={ style.dropDownLinks }> | ||
<i className='fas fa-eye' />View on Neoscan | ||
</Link> | ||
<button className={ style.dropDownLinksButton } onClick={ onClickHandler }> | ||
<i className='fas fa-edit' />Edit Name | ||
</button> | ||
</Fragment> | ||
) | ||
} | ||
|
||
AccountInfoDropDownContent.propTypes = { | ||
onClickHandler: PropTypes.func.isRequired, | ||
address: PropTypes.string.isRequired, | ||
} | ||
|
||
export default AccountInfoDropDownContent |
10 changes: 10 additions & 0 deletions
10
src/app/components/AccountInfo/AccountInfoError/AccountInfoError.css
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 @@ | ||
.accountInfoErrorButton { | ||
margin: 0 auto; | ||
height: 35px; | ||
font-size: 0.9rem; | ||
box-shadow: none; | ||
background: transparent; | ||
border: 1px solid #36b148; | ||
color: #36b149; | ||
} | ||
|
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,22 @@ | ||
import React, { Fragment } from 'react' | ||
import PropTypes from 'prop-types' | ||
import FlashMessage from '../../FlashMessage' | ||
import PrimaryButton from '../../common/buttons/PrimaryButton' | ||
|
||
import style from './AccountInfoError.css' | ||
|
||
const AccountInfoError = ({ amountsError, getBalance }) => { | ||
return ( | ||
<Fragment> | ||
<FlashMessage flashMessage={ amountsError } /> | ||
<PrimaryButton buttonText='Retry' classNames={ style.accountInfoErrorButton } onClickHandler={ getBalance } /> | ||
</Fragment> | ||
) | ||
} | ||
|
||
AccountInfoError.propTypes = { | ||
amountsError: PropTypes.string.isRequired, | ||
getBalance: PropTypes.func.isRequired, | ||
} | ||
|
||
export default AccountInfoError |
58 changes: 58 additions & 0 deletions
58
src/app/components/AccountInfo/AccountInfoHeader/AccountInfoHeader.css
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,58 @@ | ||
.accountInfo { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
} | ||
|
||
.accountInfoNoOptions { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
} | ||
|
||
.accountInfoDetails { | ||
width: 70%; | ||
} | ||
|
||
.accountInfoImageContainer svg { | ||
height: 30px; | ||
} | ||
|
||
.accountInfoDetailsHeading, | ||
.accountInfoDetailsParagraph { | ||
width: 100%; | ||
overflow-wrap: break-word; | ||
margin: 0; | ||
padding: 0 15px; | ||
} | ||
|
||
.accountInfoDetailsHeading { | ||
font-size: 1rem; | ||
color: #000; | ||
} | ||
|
||
.accountInfoDetailsParagraph { | ||
font-size: 0.8rem; | ||
margin-top: 5px; | ||
color: #585858; | ||
} | ||
|
||
.accountDropDownButton { | ||
background: transparent; | ||
border: none; | ||
width: 100%; | ||
cursor: pointer; | ||
color: #585858; | ||
font-size: 1.1rem; | ||
} | ||
|
||
.accountInfoDropDown { | ||
background-color: #f5f5f5; | ||
top: 24px; | ||
width: 160px; | ||
border-radius: 3px; | ||
left: -127px; | ||
z-index: 999; | ||
padding: 5px 0; | ||
} | ||
|
Oops, something went wrong.