Skip to content

Commit

Permalink
Merge pull request #1447 from KyberNetwork/release_3.0.9
Browse files Browse the repository at this point in the history
Release 3.0.9
  • Loading branch information
andrewsource147 authored Feb 24, 2020
2 parents d5d1a5b + 8c421a6 commit 831c6a6
Show file tree
Hide file tree
Showing 44 changed files with 262 additions and 253 deletions.
3 changes: 2 additions & 1 deletion lang/cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,8 @@
"kyber_homepage": "Kyber主页",
"get_free_kovan": "获取免费的",
"warning": "请不要发送以太或代币到以上的任何地址.<br></br>他们都是测试网络的地址!",
"here": "这里"
"here": "这里",
"please_give_feedback": "Please give us <a target='_blank' href='${link}'>feedback</a> on our new features so that we can serve you better"
},
"footer": {
"info": "信息",
Expand Down
3 changes: 2 additions & 1 deletion lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,8 @@
"kyber_homepage": "Kyber homepage",
"get_free_kovan": "Get free",
"warning": "DO NOT send real ethers or tokens to any of the addresses above.<br></br>They\nare testnet addresses only!",
"here": "here"
"here": "here",
"please_give_feedback": "Please give us <a target='_blank' href='${link}'>feedback</a> on our new features so that we can serve you better"
},
"footer": {
"info": "Info",
Expand Down
3 changes: 2 additions & 1 deletion lang/kr.json
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,8 @@
"kyber_homepage": "카이버 홈페이지",
"get_free_kovan": "무료 다운로드",
"warning": "위의 주소 있는 주소들에게 실제 이더나 토큰을 보내지 마십시오. <br> </ br> 그들은 testnet 주소입니다!",
"here": "여기"
"here": "여기",
"please_give_feedback": "새로운 기능에 대한 <a target='_blank' href='${link}'>피드백</a>을 주시면, 서비스 개선에 도움이 됩니다. 감사합니다."
},
"footer": {
"info": "정보",
Expand Down
3 changes: 2 additions & 1 deletion lang/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,8 @@
"kyber_homepage": "Домашняя страница Kyber",
"get_free_kovan": "Получить бесплатно",
"warning": "НЕ отправляйте реальный ETH на любой из адресов выше.<br></br>Они\nявляются исключительно тестовыми!",
"here": "здесь"
"here": "здесь",
"please_give_feedback": "Please give us <a target='_blank' href='${link}'>feedback</a> on our new features so that we can serve you better"
},
"footer": {
"info": "Информация",
Expand Down
3 changes: 2 additions & 1 deletion lang/vi.json
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,8 @@
"kyber_homepage": "Trang chủ Kyber",
"get_free_kovan": "Lấy",
"warning": "Không nên chuyển bất kỳ ether nào cho các địa chỉ phía trên.</br>Các địa\nchỉ trên chỉ sử dụng trong môi trường thử nghiệm và chúng tôi có khả năng không\nsử dụng trong phiên bản chính thức.",
"here": "tại đây"
"here": "tại đây",
"please_give_feedback": "Hãy cho chúng tôi <a target='_blank' href='${link}'>ý kiến phản hồi</a> về những tính năng mới để chúng tôi có thể cải thiện chất lượng dịch vụ tốt hơn. Cảm ơn."
},
"footer": {
"info": "Thông tin",
Expand Down
19 changes: 19 additions & 0 deletions src/assets/css/portfolio.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@
max-width: 1200px;
margin: 0 auto;

&__feedback {
&-icon {
display: block;
margin: 4px 8px;
width: 20px;
height: 20px;
float: left;
background: url($image-path + "icons/face.svg") no-repeat center;
}
p {
padding: 5px;
margin: 0px 0px 12px 0px;
a{
color: #ff9008;
text-decoration: none;
}
}
}

&--not-imported {
justify-content: center;
margin: 100px auto;
Expand Down
6 changes: 6 additions & 0 deletions src/assets/img/icons/face.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/js/actions/accountActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,10 @@ export function closePromoCodeModal() {
}
}

export function openOtherConnectModal() {
export function openOtherConnectModal(tradeType) {
return {
type: "ACCOUNT.OPEN_OTHER_CONNECT_MODAL",
payload: tradeType
}
}

Expand Down
30 changes: 24 additions & 6 deletions src/js/actions/globalActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ export function updateAllRate(ethereum, tokens) {
}
}

export function checkUserEligible(ethereum) {
return {
type: "GLOBAL.CHECK_USER_ELIGIBLE",
payload: { ethereum }
}
}

export function updateAllRateComplete(rates, rateUSD) {
return {
type: 'GLOBAL.ALL_RATE_UPDATED_FULFILLED',
Expand Down Expand Up @@ -72,10 +79,9 @@ export function clearAcceptConnectWallet() {
}
}

export function clearSession(gasPrice) {
export function clearSession() {
return {
type: "GLOBAL.CLEAR_SESSION",
payload: gasPrice
type: "GLOBAL.CLEAR_SESSION"
}
}

Expand All @@ -93,10 +99,9 @@ export function changeLanguage(ethereum, lang, locale) {
}
}

export function clearSessionComplete(gasPrice) {
export function clearSessionComplete() {
return {
type: "GLOBAL.CLEAR_SESSION_FULFILLED",
payload: gasPrice
type: "GLOBAL.CLEAR_SESSION_FULFILLED"
}
}

Expand Down Expand Up @@ -182,6 +187,19 @@ export function throwErrorMematamask(err) {
}
}

export function throwErrorEligible(err) {
return {
type: "GLOBAL.THROW_ERROR_ELIGIBLE",
payload: { err }
}
}

export function clearErrorEligible(){
return {
type: "GLOBAL.CLEAR_ERROR_ELIGIBLE"
}
}

export function updateMetamaskAccount(address, balance) {
return {
type: "GLOBAL.UPDATE_METAMASK_ACCOUNT",
Expand Down
17 changes: 12 additions & 5 deletions src/js/components/CommonElement/TokenSelectorView.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react"
import { toT, roundingNumber } from "../../utils/converter"
import { caculateEthBalance, toT, roundingNumber } from "../../utils/converter"
import Dropdown, { DropdownTrigger, DropdownContent } from 'react-simple-dropdown';
import { getAssetUrl, getTokenBySymbol } from "../../utils/common";
import BLOCKCHAIN_INFO from "../../../../env"
Expand All @@ -9,9 +9,16 @@ const TokenSelectorView = (props) => {
var focusItem = getTokenBySymbol(props.tokens, props.focusItem)

var getListToken = () => {
const tokens = props.isLoadAllTokens ? props.tokens : props.tokens.slice(0, props.tokenNumberLimit)
const searchWord = props.searchWord;

// sort token by balance
const allTokens = props.tokens.sort((a,b) => {
var aEthBalance = caculateEthBalance(a)
var bEthBalance = caculateEthBalance(b)
return bEthBalance - aEthBalance
});

const tokens = props.isLoadAllTokens ? allTokens : allTokens.slice(0, props.tokenNumberLimit)
const searchWord = props.searchWord;

return tokens.map((item, i) => {
if (item.symbol === props.banToken) return

Expand Down Expand Up @@ -40,7 +47,7 @@ const TokenSelectorView = (props) => {
)
}
})
}
};

const getWethTitle = () => {
const wethAddress = props.tokens.filter(item => item.symbol === "WETH")[0].address;
Expand Down
2 changes: 0 additions & 2 deletions src/js/components/Exchange/AccountBalanceLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ const AccountBalanceLayout = (props) => {
classBalance += " disabled unclickable"
} else if (noBalance) {
classBalance += " disabled"
} else if (props.hideZeroBalance) {
classBalance += " unclickable"
}

if ((props.isFixedSourceToken && props.screen === "swap") || (token.symbol === "PT" && props.screen === "transfer")) {
Expand Down
5 changes: 5 additions & 0 deletions src/js/components/Exchange/ExchangeBodyLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ const ExchangeBodyLayout = (props) => {
errorSource.push(value)
});

if(props.global.eligibleError) {
errorExchange = true
errorSource.push(props.global.eligibleError)
}

const errorShow = errorSource.map((value, index) => {
return <div className={"exchange__error-item"} key={index}>{value}</div>
});
Expand Down
14 changes: 7 additions & 7 deletions src/js/components/ImportAccount/ImportAccountView.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,43 +50,43 @@ const ImportAccountView = (props) => {
<div className={`import-account__content ${props.isAcceptConnectWallet ? "import-account__content--animation" : ""} ${isOnMobile ? ' import-account__content--mobile' : ''}`}>
{!isOnMobile &&
<div className={`import-account__item`}>
<ImportByMetamask />
<ImportByMetamask tradeType={props.tradeType} />
</div>
}

{!isOnMobile &&
<div className={`import-account__item import-account__item-ledger`}>
<ImportByDeviceWithLedger />
<ImportByDeviceWithLedger tradeType={props.tradeType}/>
</div>
}

{!isOnMobile &&
<div className={`import-account__item import-account__item-trezor`}>
<ImportByDeviceWithTrezor />
<ImportByDeviceWithTrezor tradeType={props.tradeType}/>
</div>
}

{!isOnMobile &&
<div className={`import-account__item`}>
<ImportKeystore />
<ImportKeystore tradeType={props.tradeType}/>
</div>
}

{isOnMobile && (
<div className={`import-account__item`}>
<ImportByPrivateKey isOnMobile={isOnMobile} closeParentModal={props.closeModal}/>
<ImportByPrivateKey isOnMobile={isOnMobile} closeParentModal={props.closeModal} tradeType={props.tradeType}/>
</div>
)}

{(!isLimitOrder || !isOnMobile) &&
<div className={`import-account__item ${isLimitOrder ? 'import-account__item--disabled' : ''}`}>
<ImportByPromoCode isOnMobile={isOnMobile} />
<ImportByPromoCode isOnMobile={isOnMobile} tradeType={props.tradeType}/>
</div>
}

{!isOnMobile &&
<div className={`import-account__item`}>
<ImportByOther isOnMobile={isOnMobile} />
<ImportByOther isOnMobile={isOnMobile} tradeType={props.tradeType}/>
</div>
}

Expand Down
4 changes: 4 additions & 0 deletions src/js/components/Transaction/TransferForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ const TransferForm = (props) => {
isErrorSource = true
errorSource.push(value)
})
if(props.global.eligibleError) {
isErrorSource = true
errorSource.push(props.global.eligibleError)
}

var errorDestAddr = []
var isErrorDestAddr = false
Expand Down
2 changes: 1 addition & 1 deletion src/js/containers/Exchange/ExchangeAccount.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default class ExchangeAccount extends React.Component {
}

clearSession = () => {
this.props.dispatch(globalActions.clearSession(this.props.exchange.gasPrice))
this.props.dispatch(globalActions.clearSession())
this.props.global.analytics.callTrack("trackClickChangeWallet")
}

Expand Down
4 changes: 4 additions & 0 deletions src/js/containers/Exchange/PostExchange.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ export default class PostExchange extends React.Component {
return
}

if (this.props.global.eligibleError) {
return
}

if (Object.keys(this.props.exchange.errors.sourceAmount).length !== 0) {
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default class ImportByDeviceWithLedger extends React.Component {

showLoading = (walletType) => {
this.refs.child.showLoading(walletType)
this.props.analytics.callTrack("trackClickImportAccount", walletType);
this.props.analytics.callTrack("trackClickImportAccount", walletType, this.props.tradeType);
}

render = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default class ImportByDeviceWithTrezor extends React.Component {

showLoading = (walletType) => {
this.refs.child.showLoading(walletType)
this.props.analytics.callTrack("trackClickImportAccount", walletType);
this.props.analytics.callTrack("trackClickImportAccount", walletType, this.props.tradeType);
}

render = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/js/containers/ImportAccount/ImportByMetamask.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { getTranslate } from 'react-localize-redux'
export default class ImportByMetamask extends React.Component {

connect = (e) => {
this.props.analytics.callTrack("trackClickImportAccount", "metamask");
this.props.analytics.callTrack("trackClickImportAccount", "metamask", this.props.tradeType);

var web3Service = web3Package.newWeb3Instance()

Expand Down
2 changes: 1 addition & 1 deletion src/js/containers/ImportAccount/ImportByOther.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { getTranslate } from 'react-localize-redux'
})
export default class ImportByOther extends React.Component {
openModal() {
this.props.dispatch(openOtherConnectModal());
this.props.dispatch(openOtherConnectModal(this.props.tradeType));
}

render() {
Expand Down
6 changes: 3 additions & 3 deletions src/js/containers/ImportAccount/ImportByOtherConnectModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ export default class ImportByOtherConnectModal extends React.Component {
</div>
<div className={`import-account__content ${isOnMobile ? ' import-account__content--mobile' : ''}`}>
<div className={`import-account__item large`}>
<ImportByPrivateKey isOnMobile={isOnMobile} closeParentModal={this.closeModal.bind(this)} />
<ImportByPrivateKey isOnMobile={isOnMobile} closeParentModal={this.closeModal.bind(this)} tradeType={this.props.account.otherConnect.tradeType}/>
</div>

<div className={`import-account__item large import-account__item-walletlink`}>
<ImportByWalletLink closeParentModal={this.closeModal.bind(this)} />
<ImportByWalletLink closeParentModal={this.closeModal.bind(this)} tradeType={this.props.account.otherConnect.tradeType}/>
</div>

<div className={`import-account__item large import-account__item-walletconnect`}>
<ImportByWalletConnect closeParentModal={this.closeModal.bind(this)} />
<ImportByWalletConnect closeParentModal={this.closeModal.bind(this)} tradeType={this.props.account.otherConnect.tradeType}/>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/js/containers/ImportAccount/ImportByPrivateKey.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { getTranslate } from 'react-localize-redux'
export default class ImportByPrivateKey extends React.Component {
openModal() {
this.props.dispatch(openPkeyModal());
this.props.analytics.callTrack("trackClickImportAccount", "private_key");
this.props.analytics.callTrack("trackClickImportAccount", "private_key", this.props.tradeType);
}

closeModal() {
Expand Down
4 changes: 2 additions & 2 deletions src/js/containers/ImportAccount/ImportByPromoCode.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import { getTranslate } from 'react-localize-redux'
@connect((store) => {
return {
translate: getTranslate(store.locale),
analytics: store.global.analytics,
analytics: store.global.analytics
}
})
export default class ImportByPromoCode extends React.Component {
openModal() {
this.props.dispatch(openPromoCodeModal());
this.props.analytics.callTrack("trackClickImportAccount", "promo code");
this.props.analytics.callTrack("trackClickImportAccount", "promo code", this.props.tradeType);
}

render() {
Expand Down
2 changes: 1 addition & 1 deletion src/js/containers/ImportAccount/ImportKeystore.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export default class ImportKeystore extends React.Component {
}

onDrop = (files) => {
this.props.analytics.callTrack("trackClickImportAccount", "keystore");
this.props.analytics.callTrack("trackClickImportAccount", "keystore", this.props.tradeType);
try {
var _this = this
var file = files[0]
Expand Down
Loading

0 comments on commit 831c6a6

Please sign in to comment.