From 49063de679fd6477156af578aa73b397a5e48868 Mon Sep 17 00:00:00 2001 From: u-e Date: Sun, 7 Jul 2019 13:49:55 +0300 Subject: [PATCH 01/12] created launch screen --- src/screens/launch/screen/launchScreen.js | 58 ++++++----------------- src/screens/launch/screen/launchStyles.js | 25 ---------- 2 files changed, 14 insertions(+), 69 deletions(-) delete mode 100644 src/screens/launch/screen/launchStyles.js diff --git a/src/screens/launch/screen/launchScreen.js b/src/screens/launch/screen/launchScreen.js index 8c0a64c01..d05d7f77d 100644 --- a/src/screens/launch/screen/launchScreen.js +++ b/src/screens/launch/screen/launchScreen.js @@ -1,48 +1,18 @@ -import React, { PureComponent, Fragment } from 'react'; -import { View, Text } from 'react-native'; - -// Constants - -// Components - +import React from 'react'; +import { View } from 'react-native'; import { Logo } from '../../../components'; -// import styles from './launchStyles'; - -class LaunchScreen extends PureComponent { - /* Props - * ------------------------------------------------ - * @prop { type } name - Description.... - */ - - constructor(props) { - super(props); - this.state = {}; - } - - // Component Life Cycles - - // Component Functions - - render() { - return ; - - // Temporarily removed - // return ( - // - // - // {/* eSteem - // mobile */} - // - // ); - } -} +const LaunchScreen = () => ( + + + +); export default LaunchScreen; diff --git a/src/screens/launch/screen/launchStyles.js b/src/screens/launch/screen/launchStyles.js deleted file mode 100644 index 146037955..000000000 --- a/src/screens/launch/screen/launchStyles.js +++ /dev/null @@ -1,25 +0,0 @@ -import EStyleSheet from 'react-native-extended-stylesheet'; - -export default EStyleSheet.create({ - container: { - flex: 1, - justifyContent: 'center', - alignItems: 'center', - backgroundColor: 'red', - }, - title: { - fontFamily: 'Sansation_Bold', - color: '$primaryDarkBlue', - fontSize: 30, - paddingBottom: 0, - }, - subTitle: { - fontFamily: 'Sansation_Regular', - color: '#00519c', - fontSize: 24, - }, - logo: { - width: '$deviceWidth / 4', - height: '$deviceWidth / 4', - }, -}); From f4d5ea9475afc7881a71d8dc3deac592e04915fa Mon Sep 17 00:00:00 2001 From: Feruz M Date: Mon, 8 Jul 2019 09:14:31 +0300 Subject: [PATCH 02/12] New translations en-US.json (Korean) --- src/config/locales/ko-KR.json | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/config/locales/ko-KR.json b/src/config/locales/ko-KR.json index 1ca7e38c2..1be747612 100644 --- a/src/config/locales/ko-KR.json +++ b/src/config/locales/ko-KR.json @@ -203,7 +203,7 @@ "no_internet": "인터넷 연결을 확인하세요!", "confirm": "확인", "removed": "삭제되었습니다", - "same_user": "This user already added to list" + "same_user": "이 사용자는 목록에 이미 추가되었습니다" }, "post": { "reblog_alert": "정말 리블로그 하시겠습니까?", @@ -290,19 +290,19 @@ "withdraw_to_saving": "안전 금고로 출금", "steemconnect_title": "Steemconnect 송금", "next": "다음", - "withdraw_steem": "Withdraw Steem", - "withdraw_sbd": "Withdraw Steem Dollar", - "delegate": "Delegate", - "power_down": "Power Down", - "account": "Account", - "destination_accounts": "Destination Account(s)", - "amount_information": "Drag the sliderto adjust to amount", - "save": "Save", - "percent": "Percentage", - "percent_information": "Percentage of power down to this account", - "auto_vests": "Automatically power up to the target account", - "stop": "Stop", - "stop_information": "Are you sure to stop?", - "incoming_funds": "Incoming Funds" + "withdraw_steem": "스팀 출금", + "withdraw_sbd": "스팀 달러 출금", + "delegate": "임대", + "power_down": "파워 다운", + "account": "계정", + "destination_accounts": "대상 계정", + "amount_information": "슬라이드를 드래그해서 수량을 설정할 수 있습니다", + "save": "저장", + "percent": "비율", + "percent_information": "이 계정에 대한 파워 다운 비율", + "auto_vests": "대상 계정에 자동으로 파워 업 하기", + "stop": "중지", + "stop_information": "중지하시겠습니까?", + "incoming_funds": "입금 예정 스팀" } } From 5bdc9c78c9379d901d173605ff1f18d4fa3bbd15 Mon Sep 17 00:00:00 2001 From: Feruz M Date: Mon, 8 Jul 2019 09:34:41 +0300 Subject: [PATCH 03/12] New translations en-US.json (Russian) --- src/config/locales/ru-RU.json | 38 +++++++++++++++++------------------ 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/config/locales/ru-RU.json b/src/config/locales/ru-RU.json index b58833d58..90d615197 100644 --- a/src/config/locales/ru-RU.json +++ b/src/config/locales/ru-RU.json @@ -208,7 +208,7 @@ "post": { "reblog_alert": "Вы уверены, что хотите сделать репост?", "removed_hint": "Сообщение удалено", - "copy_link": "Copy Link" + "copy_link": "Копировать ссылку" }, "drafts": { "title": "Черновики", @@ -283,26 +283,26 @@ "memo_desc": "Эта заметка публична", "to_placeholder": "Пользователь", "memo_placeholder": "Введите свою заметку", - "transfer_token": "Transfer", - "points": "Points Transfer", - "transfer_to_saving": "Transfer To Saving", + "transfer_token": "Перевод", + "points": "Передача баллов", + "transfer_to_saving": "Перевести в сейф", "powerUp": "Увеличение силы", - "withdraw_to_saving": "Withdraw To Saving", + "withdraw_to_saving": "Снять в сейф", "steemconnect_title": "Перевод Steemconnect", "next": "ДАЛЕЕ", - "withdraw_steem": "Withdraw Steem", - "withdraw_sbd": "Withdraw Steem Dollar", - "delegate": "Delegate", - "power_down": "Power Down", - "account": "Account", - "destination_accounts": "Destination Account(s)", - "amount_information": "Drag the sliderto adjust to amount", - "save": "Save", - "percent": "Percentage", - "percent_information": "Percentage of power down to this account", - "auto_vests": "Automatically power up to the target account", - "stop": "Stop", - "stop_information": "Are you sure to stop?", - "incoming_funds": "Incoming Funds" + "withdraw_steem": "Вывести Steem", + "withdraw_sbd": "Вывести Steem Dollar", + "delegate": "Делегировать", + "power_down": "Понижение Силы", + "account": "Aккаунт", + "destination_accounts": "Аккаунт(ы) получателя", + "amount_information": "Потяните ползунок для регулировки количества", + "save": "Сохранить", + "percent": "Проценты", + "percent_information": "Процент понижения Силы в этот аккаунт", + "auto_vests": "Автоматически переводить в Силу на целевой аккаунт", + "stop": "Остановить", + "stop_information": "Вы уверены, что хотите остановить?", + "incoming_funds": "Входящие средства" } } From fe5e8fe863d25bfc944b26749c0c8085496bb35d Mon Sep 17 00:00:00 2001 From: Feruz M Date: Mon, 8 Jul 2019 09:45:33 +0300 Subject: [PATCH 04/12] New translations en-US.json (Russian) --- src/config/locales/ru-RU.json | 40 +++++++++++++++++------------------ 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/config/locales/ru-RU.json b/src/config/locales/ru-RU.json index 90d615197..ecd9d4b30 100644 --- a/src/config/locales/ru-RU.json +++ b/src/config/locales/ru-RU.json @@ -23,7 +23,7 @@ "comingsoon": "Доска Лидерства будет здесь!", "notification": "Уведомления", "leaderboard": "Лидеры", - "epoint": "Очки", + "epoint": "Баллы", "leaderboard_title": "Доска Лидерства", "recent": "Недавно", "yesterday": "Вчера", @@ -38,29 +38,29 @@ "vote": "Голос", "reblog": "Репост", "login": "Логин", - "incoming_transfer_title": "Incoming transfer", - "outgoing_transfer_title": "Outgoing transfer", + "incoming_transfer_title": "Входящий перевод", + "outgoing_transfer_title": "Исходящий перевод", "checkin_extra": "Бонус", - "delegation": "Delegation", - "delegation_title": "Delegation reward", - "delegation_desc": "You can earn 1 point per day for each 100sp delegation", - "post_title": "Очки за пост", - "comment_title": "Очки за комментарий", - "vote_title": "Очки за голос", - "reblog_title": "Очки за репост", - "login_title": "Очки за логин", - "checkin_title": "Очки за пользование", + "delegation": "Делегирование", + "delegation_title": "Награда за делегирование", + "delegation_desc": "За каждые делегированные 100SP вы будете получать 1 балл в день", + "post_title": "Баллы за пост", + "comment_title": "Баллы за комментарий", + "vote_title": "Баллы за голос", + "reblog_title": "Баллы за репост", + "login_title": "Баллы за логин", + "checkin_title": "Баллы за пользование", "checkin_extra_title": "Бонус за использование", "no_activity": "Здесь пусто!", "outgoing_transfer_description": "", "incoming_transfer_description": "", - "post_desc": "Зарабатывай очки за посты. По 15 очков за каждый.", - "comment_desc": "Каждый коммент помогает набирать аудиторию, завязывает дружбу и приносит 5 очков.", - "checkin_desc": "Чекин в приложении eSteem даёт 0.25 очков и помогает оставаться на связи с друзьями.", - "vote_desc": "Голосуя вы награждаете других и высказываете своё уважение, а также получаете процент очков в зависимости от силы голоса.", - "reblog_desc": "Делитесь постами с друзьями и получайте по 1 очку.", - "login_desc": "Когда вы логинитесь в приложения eSteem, вы автоматически получаете 100 очков.", - "checkin_extra_desc": "Постоянное использование приложения даёт вам дополнительный шанс получить 10 очков. Чем больше активности, тем больше очков." + "post_desc": "Зарабатывай баллы за посты. По 15 баллов за каждый.", + "comment_desc": "Каждый коммент помогает набирать аудиторию, завязывает дружбу и приносит 5 баллов.", + "checkin_desc": "Чекин в приложении eSteem даёт 0.25 баллов и помогает оставаться на связи с друзьями.", + "vote_desc": "Голосуя вы награждаете других и высказываете своё уважение, а также получаете процент баллов в зависимости от силы голоса.", + "reblog_desc": "Делитесь постами с друзьями и получайте по 1 баллу.", + "login_desc": "Когда вы логинитесь в приложения eSteem, вы автоматически получаете 100 баллов.", + "checkin_extra_desc": "Постоянное использование приложения даёт вам дополнительный шанс получить 10 баллов. Чем больше активности, тем больше награда." }, "messages": { "comingsoon": "Здесь будут сообщения!" @@ -203,7 +203,7 @@ "no_internet": "No internet connection", "confirm": "Подтвердить", "removed": "Удалено", - "same_user": "This user already added to list" + "same_user": "Этот пользователь уже добавлен в список" }, "post": { "reblog_alert": "Вы уверены, что хотите сделать репост?", From affd5a91daa451f3aa2310bdc6707ce536cb76fd Mon Sep 17 00:00:00 2001 From: Feruz M Date: Mon, 8 Jul 2019 11:38:56 +0300 Subject: [PATCH 05/12] New translations en-US.json (Romanian) --- src/config/locales/ro-RO.json | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/config/locales/ro-RO.json b/src/config/locales/ro-RO.json index fa06ac176..ea11e0f4f 100644 --- a/src/config/locales/ro-RO.json +++ b/src/config/locales/ro-RO.json @@ -203,7 +203,7 @@ "no_internet": "Nu există conexiune!", "confirm": "Confirmă", "removed": "Şters", - "same_user": "This user already added to list" + "same_user": "Utilizator adăugat deja la listă" }, "post": { "reblog_alert": "Ești sigur că vrei să redistribui?", @@ -284,25 +284,25 @@ "to_placeholder": "Nume de utilizator", "memo_placeholder": "Introdu comentariul tău aici", "transfer_token": "Transfer", - "points": "Points Transfer", + "points": "Transfer Puncte", "transfer_to_saving": "Tranferă la economii", "powerUp": "Power Up", "withdraw_to_saving": "Retrage la economii", "steemconnect_title": "Transfer Steemconnect", "next": "URMĂTORUL", - "withdraw_steem": "Withdraw Steem", - "withdraw_sbd": "Withdraw Steem Dollar", - "delegate": "Delegate", + "withdraw_steem": "Retrage Steem", + "withdraw_sbd": "Retrage Steem Dolar", + "delegate": "Delegare", "power_down": "Power Down", - "account": "Account", - "destination_accounts": "Destination Account(s)", - "amount_information": "Drag the sliderto adjust to amount", - "save": "Save", - "percent": "Percentage", - "percent_information": "Percentage of power down to this account", - "auto_vests": "Automatically power up to the target account", - "stop": "Stop", + "account": "Cont", + "destination_accounts": "Cont(uri) de Destinație", + "amount_information": "Trage glisorul pentru a ajusta cantitatea", + "save": "Salvează", + "percent": "Procentaj", + "percent_information": "Procentul de power down la acest cont", + "auto_vests": "Power up automat contul ţintă", + "stop": "Oprește", "stop_information": "Are you sure to stop?", - "incoming_funds": "Incoming Funds" + "incoming_funds": "Fondurile Primite" } } From 5bd256b0129581fc189cf8c172fc48ebf3ff32ca Mon Sep 17 00:00:00 2001 From: Feruz M Date: Mon, 8 Jul 2019 12:08:21 +0300 Subject: [PATCH 06/12] New translations en-US.json (Hungarian) --- src/config/locales/hu-HU.json | 48 +++++++++++++++++------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/config/locales/hu-HU.json b/src/config/locales/hu-HU.json index 58fa9f4bb..ff2d40af0 100644 --- a/src/config/locales/hu-HU.json +++ b/src/config/locales/hu-HU.json @@ -38,12 +38,12 @@ "vote": "Szavazás", "reblog": "Megosztás", "login": "Bejelentkezés", - "incoming_transfer_title": "Incoming transfer", - "outgoing_transfer_title": "Outgoing transfer", + "incoming_transfer_title": "Bejövő átutalás", + "outgoing_transfer_title": "Kimenő átutalás", "checkin_extra": "Bónusz", - "delegation": "Delegation", - "delegation_title": "Delegation reward", - "delegation_desc": "You can earn 1 point per day for each 100sp delegation", + "delegation": "Delegálás", + "delegation_title": "Delegálási jutalom", + "delegation_desc": "Minen 100sp delegálásért napi 1 pontot kaphatsz", "post_title": "Bejegyzés pontok", "comment_title": "Hozzászólás pontok", "vote_title": "Szavazási pontok", @@ -203,12 +203,12 @@ "no_internet": "Nincs kapcsolat!", "confirm": "Megerősítés", "removed": "Eltávolítva", - "same_user": "This user already added to list" + "same_user": "Ez a felhasználó már szerepel a listán" }, "post": { "reblog_alert": "Biztos, hogy megosztod?", "removed_hint": "A bejegyzést eltávolította", - "copy_link": "Copy Link" + "copy_link": "Link másolása" }, "drafts": { "title": "Piszkozatok", @@ -283,26 +283,26 @@ "memo_desc": "Ez az üzenet nyilvános", "to_placeholder": "Felhasználónév", "memo_placeholder": "Megjegyzés ide", - "transfer_token": "Transfer", - "points": "Points Transfer", - "transfer_to_saving": "Transfer To Saving", + "transfer_token": "Átutalás", + "points": "Pontok Átutalása", + "transfer_to_saving": "Átutalás a megtakarításokhoz", "powerUp": "Power Up", - "withdraw_to_saving": "Withdraw To Saving", + "withdraw_to_saving": "Átutalás A Megtakarításokhoz", "steemconnect_title": "Steemconnect átutalás", "next": "KÖVETKEZŐ", - "withdraw_steem": "Withdraw Steem", - "withdraw_sbd": "Withdraw Steem Dollar", - "delegate": "Delegate", + "withdraw_steem": "Steem Visszavonás", + "withdraw_sbd": "Steem Dollár Visszavonás", + "delegate": "Delegálás", "power_down": "Power Down", - "account": "Account", - "destination_accounts": "Destination Account(s)", - "amount_information": "Drag the sliderto adjust to amount", - "save": "Save", - "percent": "Percentage", - "percent_information": "Percentage of power down to this account", - "auto_vests": "Automatically power up to the target account", - "stop": "Stop", - "stop_information": "Are you sure to stop?", - "incoming_funds": "Incoming Funds" + "account": "Fiók", + "destination_accounts": "Cél Fiók(ok)", + "amount_information": "A csúszka húzásával állítsd be a mennyiséget", + "save": "Mentés", + "percent": "Százalék", + "percent_information": "Power Down százaléka ennek a fióknak", + "auto_vests": "Automatikus power up a megadott fióknak", + "stop": "Megállítás", + "stop_information": "Bistos megállítod?", + "incoming_funds": "Bejövő tőke" } } From fac46380853bfea785706ef4d280481a27fff512 Mon Sep 17 00:00:00 2001 From: Feruz M Date: Mon, 8 Jul 2019 12:08:23 +0300 Subject: [PATCH 07/12] New translations en-US.json (Romanian) --- src/config/locales/ro-RO.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config/locales/ro-RO.json b/src/config/locales/ro-RO.json index ea11e0f4f..7b5bc3356 100644 --- a/src/config/locales/ro-RO.json +++ b/src/config/locales/ro-RO.json @@ -302,7 +302,7 @@ "percent_information": "Procentul de power down la acest cont", "auto_vests": "Power up automat contul ţintă", "stop": "Oprește", - "stop_information": "Are you sure to stop?", + "stop_information": "Ești sigur că vrei să te oprești?", "incoming_funds": "Fondurile Primite" } } From 0dfa467d51038f38f96341e5a3e4218cc5511588 Mon Sep 17 00:00:00 2001 From: Mustafa Buyukcelebi Date: Mon, 8 Jul 2019 14:35:29 +0300 Subject: [PATCH 08/12] Added delegate feature --- src/providers/steem/dsteem.js | 2 +- .../transfer/container/transferContainer.js | 2 + src/screens/transfer/index.js | 14 +- src/screens/transfer/screen/delegateScreen.js | 216 ++++++++++++++++++ src/screens/transfer/screen/transferStyles.js | 1 - 5 files changed, 232 insertions(+), 3 deletions(-) create mode 100644 src/screens/transfer/screen/delegateScreen.js diff --git a/src/providers/steem/dsteem.js b/src/providers/steem/dsteem.js index 2742b7b40..2f6c797ba 100644 --- a/src/providers/steem/dsteem.js +++ b/src/providers/steem/dsteem.js @@ -692,7 +692,7 @@ export const delegateVestingShares = (currentAccount, pin, data) => { 'delegate_vesting_shares', { delegator: data.from, - delegatee: data.to, + delegatee: data.destination, vesting_shares: data.amount, }, ], diff --git a/src/screens/transfer/container/transferContainer.js b/src/screens/transfer/container/transferContainer.js index 181458951..57e6c3ee5 100644 --- a/src/screens/transfer/container/transferContainer.js +++ b/src/screens/transfer/container/transferContainer.js @@ -134,6 +134,8 @@ class TransferContainer extends Component { break; case 'delegate': func = delegateVestingShares; + currentAccount = selectedAccount; + data.amount = `${amount.toFixed(6)} VESTS`; break; default: break; diff --git a/src/screens/transfer/index.js b/src/screens/transfer/index.js index e7c0886ea..274000697 100644 --- a/src/screens/transfer/index.js +++ b/src/screens/transfer/index.js @@ -4,6 +4,7 @@ import TransferContainer from './container/transferContainer'; import TransferView from './screen/transferScreen'; import PowerDownView from './screen/powerDownScreen'; +import DelegateView from './screen/delegateScreen'; const Transfer = ({ navigation }) => ( @@ -44,7 +45,18 @@ const Transfer = ({ navigation }) => ( /> ); case 'delegate': - return null; + return ( + + ); case 'power_down': return ( { + const { getAccountsWithUsername, balance } = this.props; + + if (key) { + switch (key) { + case 'destination': + getAccountsWithUsername(value).then(res => { + const isValid = res.includes(value); + + this.setState({ isUsernameValid: isValid }); + }); + this.setState({ [key]: value }); + break; + case 'amount': + if (parseFloat(Number(value)) <= parseFloat(balance)) { + this.setState({ [key]: value }); + } + break; + + default: + this.setState({ [key]: value }); + break; + } + } + }; + + _handleTransferAction = () => { + const { transferToAccount, accountType } = this.props; + const { from, destination, amount } = this.state; + + this.setState({ isTransfering: true }); + + if (accountType === AUTH_TYPE.STEEM_CONNECT) { + this.setState({ steemConnectTransfer: true }); + } else { + transferToAccount(from, destination, amount, ''); + } + }; + + _handleOnAmountChange = (state, amount) => { + let _amount = amount.toString(); + if (_amount.includes(',')) { + _amount = amount.replace(',', '.'); + } + + this._setState(state, _amount); + }; + + _handleOnDropdownChange = value => { + const { fetchBalance } = this.props; + + fetchBalance(value); + this.setState({ from: value, amount: 0 }); + }; + + _renderDropdown = (accounts, currentAccountName) => ( + item.username)} + defaultText={currentAccountName} + selectedOptionIndex={accounts.findIndex(item => item.username === currentAccountName)} + onSelect={(index, value) => this._handleOnDropdownChange(value)} + /> + ); + + _renderInput = (placeholder, state, keyboardType, isTextArea) => ( + this._handleOnAmountChange(state, amount)} + value={this.state[state]} + placeholder={placeholder} + placeholderTextColor="#c1c5c7" + autoCapitalize="none" + multiline={isTextArea} + numberOfLines={isTextArea ? 4 : 1} + keyboardType={keyboardType} + /> + ); + + _renderInformationText = text => {text}; + + render() { + const { intl, accounts, currentAccountName, selectedAccount } = this.props; + const { amount, isTransfering, from, destination } = this.state; + let availableVestingShares = 0; + + if (!isEmptyDate(get(selectedAccount, 'next_vesting_withdrawal'))) { + // powering down + availableVestingShares = + parseToken(get(selectedAccount, 'vesting_shares')) - + (Number(get(selectedAccount, 'to_withdraw')) - Number(get(selectedAccount, 'withdrawn'))) / + 1e6 - + parseToken(get(selectedAccount, 'delegated_vesting_shares')); + } else { + // not powering down + availableVestingShares = + parseToken(get(selectedAccount, 'vesting_shares')) - + parseToken(get(selectedAccount, 'delegated_vesting_shares')); + } + + return ( + + + + + + + + + + this._renderDropdown(accounts, currentAccountName)} + /> + + this._renderInput( + intl.formatMessage({ id: 'transfer.to_placeholder' }), + 'destination', + 'default', + ) + } + /> + this._renderInformationText(`${amount.toFixed(6)} VESTS`)} + /> + { + this.setState({ amount: value }); + }} + /> + + {intl.formatMessage({ id: 'transfer.amount_information' })} + + + + this.startActionSheet.current.show()} + isLoading={isTransfering} + > + {intl.formatMessage({ id: 'transfer.next' })} + + + + (index === 0 ? this._handleTransferAction() : null)} + /> + + ); + } +} + +export default injectIntl(DelegateScreen); diff --git a/src/screens/transfer/screen/transferStyles.js b/src/screens/transfer/screen/transferStyles.js index 46ffe1458..a44fbb4b0 100644 --- a/src/screens/transfer/screen/transferStyles.js +++ b/src/screens/transfer/screen/transferStyles.js @@ -107,7 +107,6 @@ export default EStyleSheet.create({ elevation: 3, }, slider: { - flex: 1, marginHorizontal: 30, }, formButton: { From 2843b5d8f41733392daf04c1dbc45957a4530e69 Mon Sep 17 00:00:00 2001 From: Mustafa Buyukcelebi Date: Mon, 8 Jul 2019 14:57:12 +0300 Subject: [PATCH 09/12] Added information alert for sc users doing power down --- src/config/locales/en-US.json | 3 ++- .../transfer/screen/powerDownScreen.js | 23 ++++++------------- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/src/config/locales/en-US.json b/src/config/locales/en-US.json index ec5b38c1b..f9ede1dfa 100644 --- a/src/config/locales/en-US.json +++ b/src/config/locales/en-US.json @@ -303,6 +303,7 @@ "auto_vests": "Automatically power up to the target account", "stop": "Stop", "stop_information": "Are you sure to stop?", - "incoming_funds": "Incoming Funds" + "incoming_funds": "Incoming Funds", + "sc_power_down_error": "Steem connect setWithdrawVestingRoute not implemented yet." } } diff --git a/src/screens/transfer/screen/powerDownScreen.js b/src/screens/transfer/screen/powerDownScreen.js index 9ff26d54b..e9aa807e2 100644 --- a/src/screens/transfer/screen/powerDownScreen.js +++ b/src/screens/transfer/screen/powerDownScreen.js @@ -1,12 +1,11 @@ import React, { Fragment, Component } from 'react'; -import { Text, View, WebView, ScrollView, Alert } from 'react-native'; +import { Text, View, ScrollView, Alert } from 'react-native'; import ActionSheet from 'react-native-actionsheet'; import { injectIntl } from 'react-intl'; import Slider from 'react-native-slider'; import get from 'lodash/get'; import { getWithdrawRoutes } from '../../../providers/steem/dsteem'; -import { steemConnectOptions } from '../../../constants/steemConnectOptions'; import AUTH_TYPE from '../../../constants/authType'; import { BasicHeader } from '../../../components/basicHeader'; @@ -75,13 +74,16 @@ class PowerDownView extends Component { }; _handleTransferAction = () => { - const { transferToAccount, accountType } = this.props; + const { transferToAccount, accountType, intl } = this.props; const { from, destinationAccounts, amount } = this.state; this.setState({ isTransfering: true }); if (accountType === AUTH_TYPE.STEEM_CONNECT) { - this.setState({ steemConnectTransfer: true }); + Alert.alert( + intl.formatMessage({ id: 'alert.warning' }), + intl.formatMessage({ id: 'transfer.sc_power_down_error' }), + ); } else { transferToAccount(from, destinationAccounts, amount, ''); } @@ -190,14 +192,12 @@ class PowerDownView extends Component { accounts, selectedAccount, intl, - handleOnModalClose, getAccountsWithUsername, transferType, currentAccountName, steemPerMVests, } = this.props; - const { amount, steemConnectTransfer, isTransfering, isOpenWithdrawAccount } = this.state; - let path; + const { amount, isTransfering, isOpenWithdrawAccount } = this.state; let poweringDownVests = 0; let availableVestingShares = 0; @@ -355,15 +355,6 @@ class PowerDownView extends Component { handleOnSubmit={this._handleOnSubmit} /> - - - ); } From ae7a107c158314fa59176ec2f446e83e7949d38a Mon Sep 17 00:00:00 2001 From: Mustafa Buyukcelebi Date: Mon, 8 Jul 2019 15:11:05 +0300 Subject: [PATCH 10/12] Added steemconnect functionality for delegate screen --- src/screens/transfer/index.js | 1 + src/screens/transfer/screen/delegateScreen.js | 22 ++++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/screens/transfer/index.js b/src/screens/transfer/index.js index 274000697..35d66c478 100644 --- a/src/screens/transfer/index.js +++ b/src/screens/transfer/index.js @@ -55,6 +55,7 @@ const Transfer = ({ navigation }) => ( fetchBalance={fetchBalance} transferToAccount={transferToAccount} accountType={accountType} + handleOnModalClose={handleOnModalClose} /> ); case 'power_down': diff --git a/src/screens/transfer/screen/delegateScreen.js b/src/screens/transfer/screen/delegateScreen.js index 866580014..4bafaa499 100644 --- a/src/screens/transfer/screen/delegateScreen.js +++ b/src/screens/transfer/screen/delegateScreen.js @@ -1,5 +1,5 @@ import React, { Component, Fragment } from 'react'; -import { View, Text } from 'react-native'; +import { View, Text, WebView } from 'react-native'; import { injectIntl } from 'react-intl'; import Slider from 'react-native-slider'; import get from 'lodash/get'; @@ -7,6 +7,7 @@ import ActionSheet from 'react-native-actionsheet'; // Constants import AUTH_TYPE from '../../../constants/authType'; +import { steemConnectOptions } from '../../../constants/steemConnectOptions'; // Components import { BasicHeader } from '../../../components/basicHeader'; @@ -16,6 +17,7 @@ import { TextInput } from '../../../components/textInput'; import { MainButton } from '../../../components/mainButton'; import { UserAvatar } from '../../../components/userAvatar'; import { Icon } from '../../../components/icon'; +import { Modal } from '../../../components/modal'; import parseToken from '../../../utils/parseToken'; import { isEmptyDate } from '../../../utils/time'; @@ -31,6 +33,7 @@ class DelegateScreen extends Component { isTransfering: false, from: props.currentAccountName, destination: '', + steemConnectTransfer: false, }; this.startActionSheet = React.createRef(); @@ -125,8 +128,8 @@ class DelegateScreen extends Component { _renderInformationText = text => {text}; render() { - const { intl, accounts, currentAccountName, selectedAccount } = this.props; - const { amount, isTransfering, from, destination } = this.state; + const { intl, accounts, currentAccountName, selectedAccount, handleOnModalClose } = this.props; + const { amount, isTransfering, from, destination, steemConnectTransfer } = this.state; let availableVestingShares = 0; if (!isEmptyDate(get(selectedAccount, 'next_vesting_withdrawal'))) { @@ -142,6 +145,10 @@ class DelegateScreen extends Component { parseToken(get(selectedAccount, 'vesting_shares')) - parseToken(get(selectedAccount, 'delegated_vesting_shares')); } + const fixedAmount = `${amount.toFixed(6)} VESTS`; + const path = `sign/delegate-vesting-shares?delegator=${from}&delegatee=${destination}&vesting_shares=${encodeURIComponent( + fixedAmount, + )}`; return ( @@ -208,6 +215,15 @@ class DelegateScreen extends Component { destructiveButtonIndex={0} onPress={index => (index === 0 ? this._handleTransferAction() : null)} /> + + + ); } From cf565ac7aafffe38d390b355d39711068e97754e Mon Sep 17 00:00:00 2001 From: Mustafa Buyukcelebi Date: Mon, 8 Jul 2019 15:34:46 +0300 Subject: [PATCH 11/12] Fixed power down screen bugs --- src/config/locales/en-US.json | 6 ++++-- src/screens/transfer/screen/powerDownScreen.js | 3 +++ src/screens/transfer/screen/transferStyles.js | 6 ++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/config/locales/en-US.json b/src/config/locales/en-US.json index ec5b38c1b..fdf18ce18 100644 --- a/src/config/locales/en-US.json +++ b/src/config/locales/en-US.json @@ -296,13 +296,15 @@ "power_down": "Power Down", "account": "Account", "destination_accounts": "Destination Account(s)", - "amount_information": "Drag the sliderto adjust to amount", + "amount_information": "Drag the slider to adjust to amount", "save": "Save", "percent": "Percentage", "percent_information": "Percentage of power down to this account", "auto_vests": "Automatically power up to the target account", "stop": "Stop", "stop_information": "Are you sure to stop?", - "incoming_funds": "Incoming Funds" + "incoming_funds": "Incoming Funds", + "sc_power_down_error": "Steem connect setWithdrawVestingRoute not implemented yet.", + "estimated_weekly": "Estimated Weekly" } } diff --git a/src/screens/transfer/screen/powerDownScreen.js b/src/screens/transfer/screen/powerDownScreen.js index 9ff26d54b..2781874db 100644 --- a/src/screens/transfer/screen/powerDownScreen.js +++ b/src/screens/transfer/screen/powerDownScreen.js @@ -293,6 +293,9 @@ class PowerDownView extends Component { style={styles.steemInformation} text={`+ ${fundPerWeek.toFixed(3)} STEEM`} /> + + {intl.formatMessage({ id: 'transfer.estimated_weekly' })} + Date: Mon, 8 Jul 2019 18:10:58 +0300 Subject: [PATCH 12/12] New translations en-US.json (Portuguese) --- src/config/locales/pt-PT.json | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/config/locales/pt-PT.json b/src/config/locales/pt-PT.json index 4b5768b0e..9097e10a4 100644 --- a/src/config/locales/pt-PT.json +++ b/src/config/locales/pt-PT.json @@ -203,7 +203,7 @@ "no_internet": "Sem ligação!", "confirm": "Confirmar", "removed": "Removido", - "same_user": "This user already added to list" + "same_user": "Este usuário já foi adicionado à lista" }, "post": { "reblog_alert": "Tem certeza de que deseja reblogar?", @@ -290,19 +290,19 @@ "withdraw_to_saving": "Levantar das poupanças", "steemconnect_title": "Transferência por Steemconnect", "next": "SEGUINTE", - "withdraw_steem": "Withdraw Steem", - "withdraw_sbd": "Withdraw Steem Dollar", - "delegate": "Delegate", - "power_down": "Power Down", - "account": "Account", - "destination_accounts": "Destination Account(s)", - "amount_information": "Drag the sliderto adjust to amount", - "save": "Save", - "percent": "Percentage", - "percent_information": "Percentage of power down to this account", - "auto_vests": "Automatically power up to the target account", - "stop": "Stop", - "stop_information": "Are you sure to stop?", - "incoming_funds": "Incoming Funds" + "withdraw_steem": "Levantar Steem", + "withdraw_sbd": "Levantar Steem Dólar", + "delegate": "Delegar", + "power_down": "Decarregar Poder", + "account": "Conta", + "destination_accounts": "Conta(s) de destino", + "amount_information": "Arraste o controle deslizante para ajustar a quantidade", + "save": "Guardar", + "percent": "Percentagem", + "percent_information": "Percentagem de Descarga de Poder para esta conta", + "auto_vests": "Carregar Poder automaticamente para a conta alvo", + "stop": "Parar", + "stop_information": "Tem certeza que deseja parar?", + "incoming_funds": "Fundos recebidos" } }