Skip to content

Commit

Permalink
Merge pull request #733 from hubiinetwork/feature/0.9.6
Browse files Browse the repository at this point in the history
0.9.6
  • Loading branch information
katat committed Feb 28, 2019
2 parents 3d5d107 + 2eb1e5e commit 5b3e1b1
Show file tree
Hide file tree
Showing 25 changed files with 3,075 additions and 68 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hubii-core",
"version": "0.9.4",
"version": "0.9.6",
"author": {
"name": "hubii",
"email": "info@hubii.com",
Expand Down
48 changes: 48 additions & 0 deletions public/images/question.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/components/BreakdownList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { compose } from 'redux';
import { injectIntl } from 'react-intl';
import PropTypes from 'prop-types';
import { getAbsolutePath } from 'utils/electron';
import { getAbsolutePath, assetImageFallback } from 'utils/electron';
import { formatFiat } from 'utils/numberFormats';

import Text from 'components/ui/Text';
Expand Down Expand Up @@ -49,6 +49,7 @@ const generateList = (data, formatMessage, extraInfo = false) => {
<div>
<Logo
src={getAbsolutePath(`public/images/assets/${item.label}.svg`)}
onError={assetImageFallback}
/>
<Text>{item.amount}</Text>
&nbsp;
Expand Down
3 changes: 2 additions & 1 deletion src/components/Transaction/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import moment from 'moment';
import { injectIntl } from 'react-intl';
import { getAbsolutePath } from 'utils/electron';
import { getAbsolutePath, assetImageFallback } from 'utils/electron';
import NahmiiText from 'components/ui/NahmiiText';
import {
Wrapper,
Expand Down Expand Up @@ -52,6 +52,7 @@ const Transaction = (props) => {
<HeaderWrapper>
<Image
src={getAbsolutePath(`public/images/assets/${symbol}.svg`)}
onError={assetImageFallback}
/>
<TypeIcon
type={type === 'received' ? 'download' : 'upload'}
Expand Down
24 changes: 24 additions & 0 deletions src/components/Transaction/tests/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ ShallowWrapper {
header={
<style__HeaderWrapper>
<style__Image
onError={[Function]}
src="/public/images/assets/UKG.svg"
/>
<style__TypeIcon
Expand Down Expand Up @@ -125,6 +126,7 @@ ShallowWrapper {
header={
<style__HeaderWrapper>
<style__Image
onError={[Function]}
src="/public/images/assets/UKG.svg"
/>
<style__TypeIcon
Expand Down Expand Up @@ -240,6 +242,7 @@ ShallowWrapper {
</style__CollapsableContent>,
"header": <style__HeaderWrapper>
<style__Image
onError={[Function]}
src="/public/images/assets/UKG.svg"
/>
<style__TypeIcon
Expand Down Expand Up @@ -476,6 +479,7 @@ ShallowWrapper {
header={
<style__HeaderWrapper>
<style__Image
onError={[Function]}
src="/public/images/assets/UKG.svg"
/>
<style__TypeIcon
Expand Down Expand Up @@ -558,6 +562,7 @@ ShallowWrapper {
header={
<style__HeaderWrapper>
<style__Image
onError={[Function]}
src="/public/images/assets/UKG.svg"
/>
<style__TypeIcon
Expand Down Expand Up @@ -673,6 +678,7 @@ ShallowWrapper {
</style__CollapsableContent>,
"header": <style__HeaderWrapper>
<style__Image
onError={[Function]}
src="/public/images/assets/UKG.svg"
/>
<style__TypeIcon
Expand Down Expand Up @@ -948,6 +954,7 @@ ShallowWrapper {
header={
<style__HeaderWrapper>
<style__Image
onError={[Function]}
src="/public/images/assets/UKG.svg"
/>
<style__TypeIcon
Expand Down Expand Up @@ -1032,6 +1039,7 @@ ShallowWrapper {
header={
<style__HeaderWrapper>
<style__Image
onError={[Function]}
src="/public/images/assets/UKG.svg"
/>
<style__TypeIcon
Expand Down Expand Up @@ -1151,6 +1159,7 @@ ShallowWrapper {
</style__CollapsableContent>,
"header": <style__HeaderWrapper>
<style__Image
onError={[Function]}
src="/public/images/assets/UKG.svg"
/>
<style__TypeIcon
Expand Down Expand Up @@ -1391,6 +1400,7 @@ ShallowWrapper {
header={
<style__HeaderWrapper>
<style__Image
onError={[Function]}
src="/public/images/assets/UKG.svg"
/>
<style__TypeIcon
Expand Down Expand Up @@ -1475,6 +1485,7 @@ ShallowWrapper {
header={
<style__HeaderWrapper>
<style__Image
onError={[Function]}
src="/public/images/assets/UKG.svg"
/>
<style__TypeIcon
Expand Down Expand Up @@ -1594,6 +1605,7 @@ ShallowWrapper {
</style__CollapsableContent>,
"header": <style__HeaderWrapper>
<style__Image
onError={[Function]}
src="/public/images/assets/UKG.svg"
/>
<style__TypeIcon
Expand Down Expand Up @@ -1873,6 +1885,7 @@ ShallowWrapper {
header={
<style__HeaderWrapper>
<style__Image
onError={[Function]}
src="/public/images/assets/UKG.svg"
/>
<style__TypeIcon
Expand Down Expand Up @@ -1957,6 +1970,7 @@ ShallowWrapper {
header={
<style__HeaderWrapper>
<style__Image
onError={[Function]}
src="/public/images/assets/UKG.svg"
/>
<style__TypeIcon
Expand Down Expand Up @@ -2076,6 +2090,7 @@ ShallowWrapper {
</style__CollapsableContent>,
"header": <style__HeaderWrapper>
<style__Image
onError={[Function]}
src="/public/images/assets/UKG.svg"
/>
<style__TypeIcon
Expand Down Expand Up @@ -2316,6 +2331,7 @@ ShallowWrapper {
header={
<style__HeaderWrapper>
<style__Image
onError={[Function]}
src="/public/images/assets/UKG.svg"
/>
<style__TypeIcon
Expand Down Expand Up @@ -2400,6 +2416,7 @@ ShallowWrapper {
header={
<style__HeaderWrapper>
<style__Image
onError={[Function]}
src="/public/images/assets/UKG.svg"
/>
<style__TypeIcon
Expand Down Expand Up @@ -2519,6 +2536,7 @@ ShallowWrapper {
</style__CollapsableContent>,
"header": <style__HeaderWrapper>
<style__Image
onError={[Function]}
src="/public/images/assets/UKG.svg"
/>
<style__TypeIcon
Expand Down Expand Up @@ -2798,6 +2816,7 @@ ShallowWrapper {
header={
<style__HeaderWrapper>
<style__Image
onError={[Function]}
src="/public/images/assets/UKG.svg"
/>
<style__TypeIcon
Expand Down Expand Up @@ -2882,6 +2901,7 @@ ShallowWrapper {
header={
<style__HeaderWrapper>
<style__Image
onError={[Function]}
src="/public/images/assets/UKG.svg"
/>
<style__TypeIcon
Expand Down Expand Up @@ -3001,6 +3021,7 @@ ShallowWrapper {
</style__CollapsableContent>,
"header": <style__HeaderWrapper>
<style__Image
onError={[Function]}
src="/public/images/assets/UKG.svg"
/>
<style__TypeIcon
Expand Down Expand Up @@ -3241,6 +3262,7 @@ ShallowWrapper {
header={
<style__HeaderWrapper>
<style__Image
onError={[Function]}
src="/public/images/assets/UKG.svg"
/>
<style__TypeIcon
Expand Down Expand Up @@ -3325,6 +3347,7 @@ ShallowWrapper {
header={
<style__HeaderWrapper>
<style__Image
onError={[Function]}
src="/public/images/assets/UKG.svg"
/>
<style__TypeIcon
Expand Down Expand Up @@ -3444,6 +3467,7 @@ ShallowWrapper {
</style__CollapsableContent>,
"header": <style__HeaderWrapper>
<style__Image
onError={[Function]}
src="/public/images/assets/UKG.svg"
/>
<style__TypeIcon
Expand Down
53 changes: 46 additions & 7 deletions src/components/TransferDescription/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { shell } from 'electron';
import { Row } from 'antd';
import * as React from 'react';
import PropTypes from 'prop-types';
Expand All @@ -8,6 +9,7 @@ import { isValidAddress } from 'ethereumjs-util';
import { isHardwareWallet } from 'utils/wallet';

import HWPromptContainer from 'containers/HWPromptContainer';
import Text from 'components/ui/Text';

import {
StyledCol,
Expand All @@ -23,6 +25,31 @@ import TransferDescriptionItem from '../TransferDescriptionItem';
* The TransferDescription Component
*/
class TransferDescription extends React.PureComponent {
generateTransferingStatus() {
const { currentWalletWithInfo, layer, currentNetwork, intl, transfering } = this.props;
const { formatMessage } = intl;
if (!transfering || layer === 'nahmii') return null;
const transferingText = `${formatMessage({ id: 'waiting_for_transfer_to_be_mined' })}`;
return (
<div style={{ display: 'flex', flexDirection: 'column' }}>
<span>
<Text large>{transferingText}</Text>
</span>
<a
role="link"
tabIndex={0}
onClick={
currentNetwork.provider._network.name === 'ropsten' ?
() => shell.openExternal(`https://ropsten.etherscan.io/address/${currentWalletWithInfo.get('address')}`) :
() => shell.openExternal(`https://etherscan.io/address/${currentWalletWithInfo.get('address')}`)
}
>
{'Track progress on Etherscan'}
</a>
</div>
);
}

render() {
const {
currentWalletWithInfo,
Expand Down Expand Up @@ -52,6 +79,9 @@ class TransferDescription extends React.PureComponent {
!isValidAddress(recipient) ||
!hwWalletReady ||
(amountToSend.toNumber() === 0 && layer === 'nahmii');

const transferingStatus = this.generateTransferingStatus();

return (
<div>
<Row>
Expand Down Expand Up @@ -151,19 +181,27 @@ class TransferDescription extends React.PureComponent {
<HWPromptContainer />
</HWPromptWrapper>
}
{
this.props.transfering &&
<StyledSpin
delay={0}
size="large"
/>
}
{
!this.props.transfering &&
<StyledButton type="primary" onClick={onSend} disabled={disableSendButton}>
{formatMessage({ id: 'send' })}
</StyledButton>
}
{
this.props.transfering &&
<div>
{
transferingStatus &&
<div style={{ marginTop: '2rem', display: 'flex', flexDirection: 'column' }}>
{transferingStatus}
</div>
}
<StyledSpin
delay={0}
size="large"
/>
</div>
}
</Row>
</div>
);
Expand All @@ -188,6 +226,7 @@ TransferDescription.propTypes = {
hwWalletReady: PropTypes.bool.isRequired,
currentWalletWithInfo: PropTypes.object.isRequired,
intl: PropTypes.object,
currentNetwork: PropTypes.object,
};

export default injectIntl(TransferDescription);
Loading

0 comments on commit 5b3e1b1

Please sign in to comment.