From bf6d852a3d9b608f2570ea070eb6c8fcaa93ebdb Mon Sep 17 00:00:00 2001 From: Young Leo Date: Mon, 17 Dec 2018 19:12:06 +0800 Subject: [PATCH] transactions --- .../components/ActionModal/WhiteListTips.jsx | 13 +++++++----- shared/components/WalletCard/index.jsx | 7 ++++--- shared/resources/messages/en/messages.json | 20 ++++++++++++++++++ shared/resources/messages/ko/messages.json | 21 +++++++++++++++++++ shared/resources/messages/zh/messages.json | 20 ++++++++++++++++++ shared/sagas/whiteList.ts | 5 +++-- .../Account/AccountSelection/index.jsx | 1 + .../screens/Account/AccountSwitch/index.jsx | 4 ++-- .../screens/Profile/AccountDetails/index.jsx | 10 ++++----- .../screens/Profile/AccountManager/index.jsx | 3 ++- shared/screens/Profile/Settings/index.jsx | 2 +- .../screens/Profile/WhiteListDetails/index.js | 8 +++---- 12 files changed, 91 insertions(+), 23 deletions(-) diff --git a/shared/components/ActionModal/WhiteListTips.jsx b/shared/components/ActionModal/WhiteListTips.jsx index f457aaf14..d9c20c5f1 100644 --- a/shared/components/ActionModal/WhiteListTips.jsx +++ b/shared/components/ActionModal/WhiteListTips.jsx @@ -8,6 +8,7 @@ import * as whiteListActions from 'actions/whiteList' import { whiteListAuthorizedSelector } from 'selectors/whiteList' import BPImage from 'components/BPNativeComponents/BPImage' import Images from 'resources/images' +import messges from 'resources/messages' import styles from './styles' @connect( @@ -49,7 +50,7 @@ export default class WhiteListTips extends PureComponent { } render() { - const { value, selectedDapp, authorized } = this.props + const { value, selectedDapp, authorized, locale } = this.props const accept = selectedDapp.get('accept') const settingDisplay = selectedDapp.get('settingDisplay') const settingEnabled = selectedDapp.get('settingEnabled') @@ -63,11 +64,11 @@ export default class WhiteListTips extends PureComponent { - {(authorized && accept) ? ' ' : '开启白名单'} + {(authorized && accept) ? ' ' : messges[locale].transaction_detail_label_enable_whitelist} - 高级设置 + {messges[locale].transaction_detail_button_advanced_settings} @@ -78,7 +79,9 @@ export default class WhiteListTips extends PureComponent { - 打开高级设置,下次进行该操作时,无需进行弹框确认直接执行,开启后可前往钱包管理中关闭 + + {messges[locale].transaction_detail_text_agree_whitelist} + - 您可以将此操作列入白名单,下次就不必在此授权。 + {messges[locale].transaction_detail_text_agree_whitelist} diff --git a/shared/components/WalletCard/index.jsx b/shared/components/WalletCard/index.jsx index 17e194b52..794590428 100644 --- a/shared/components/WalletCard/index.jsx +++ b/shared/components/WalletCard/index.jsx @@ -3,10 +3,11 @@ import CurrencyText from 'components/CurrencyText' import LinearGradientContainer from 'components/LinearGradientContainer' import { View, Text, TouchableWithoutFeedback } from 'react-native' import Ionicons from 'react-native-vector-icons/Ionicons' +import messages from 'resources/messages' import Colors from 'resources/colors' import styles from './styles' -export default ({ accountType, accountName, balanceTitle, eosValue, eosAmount, active, colors, imported, onPress }) => ( +export default ({ locale, accountType, accountName, balanceTitle, eosValue, eosAmount, active, colors, imported, onPress }) => ( @@ -22,7 +23,7 @@ export default ({ accountType, accountName, balanceTitle, eosValue, eosAmount, a imported && - 已导入 + {messages[locale].add_import_success_label_imported} } @@ -30,7 +31,7 @@ export default ({ accountType, accountName, balanceTitle, eosValue, eosAmount, a active && - 当前钱包 + {messages[locale].add_import_success_label_current} } diff --git a/shared/resources/messages/en/messages.json b/shared/resources/messages/en/messages.json index d50828070..736de10f0 100644 --- a/shared/resources/messages/en/messages.json +++ b/shared/resources/messages/en/messages.json @@ -178,6 +178,25 @@ "transaction_label_status_failed": "Failed", "transaction_label_status_completed": "Completed", + "transaction_detail_label_enable_whitelist": "Enable whitelist", + "transaction_detail_button_advanced_settings": "Advanced", + "transaction_detail_text_agree_whitelist": "You can whitelist this action and don't have to authorize it next time.", + "transaction_detail_text_enable_advanced_settings": "You don't need to confirm transaction popup by enabling advanced. You can turn it off in wallet management.", + + "wallet_mgmt_button_whitelist_detail": "Whitelist Details", + "wallet_mgmt_whitelist_title_whitelist": "Whitelist List", + "wallet_mgmt_whitelist_label_enabled_dapps": "Enabled DApps", + "wallet_mgmt_whitelist_label_advance_settings": "Advanced", + "wallet_mgmt_whitelist_text_no_enabled_dapps": "You have not authorized any whitelist DApps.", + + "account_change_title_change": "Change Account", + "account_change_button_add_account": "Add", + "add_import_success_label_imported": "Imported", + "add_import_success_label_current": "Current", + + "whitelist_title_tips": "Tips", + "whitelist_title_content": "DApp’s whitelist has moved to App Setting, meanwhile, we added an advanced mode to improve the experience. Do you wanna turn it on?", + "resource_label_available": "Available", "resource_label_total": "Total", "resource_label_used": "Used", @@ -351,6 +370,7 @@ "settings_button_language": "Language", "settings_button_currency": "Default Currency", "settings_button_node": "Node Settings", + "settings_label_whitelist": "Whitelist", "settings_node_label_default_node": "Default Node", "settings_node_label_customized_node": "Custom Node", "settings_node_button_add_node": "Add Node", diff --git a/shared/resources/messages/ko/messages.json b/shared/resources/messages/ko/messages.json index bedc067dd..1cc5f8441 100644 --- a/shared/resources/messages/ko/messages.json +++ b/shared/resources/messages/ko/messages.json @@ -168,6 +168,26 @@ "transaction_detail_button_confirm": "확인", "transaction_label_status_failed": "실패", "transaction_label_status_completed": "완료", + + "transaction_detail_label_enable_whitelist": "Enable whitelist", + "transaction_detail_button_advanced_settings": "Advanced", + "transaction_detail_text_agree_whitelist": "You can whitelist this action and don't have to authorize it next time.", + "transaction_detail_text_enable_advanced_settings": "You don't need to confirm transaction popup by enabling advanced. You can turn it off in wallet management.", + + "wallet_mgmt_button_whitelist_detail": "Whitelist Details", + "wallet_mgmt_whitelist_title_whitelist": "Whitelist List", + "wallet_mgmt_whitelist_label_enabled_dapps": "Enabled DApps", + "wallet_mgmt_whitelist_label_advance_settings": "Advanced", + "wallet_mgmt_whitelist_text_no_enabled_dapps": "You have not authorized any whitelist DApps.", + + "account_change_title_change": "Change Account", + "account_change_button_add_account": "Add", + "add_import_success_label_imported": "Imported", + "add_import_success_label_current": "Current", + + "whitelist_title_tips": "Tips", + "whitelist_title_content": "DApp’s whitelist has moved to App Setting, meanwhile, we added an advanced mode to improve the experience. Do you wanna turn it on?", + "resource_label_available": "Available", "resource_label_total": "Total", "resource_label_used": "사용됨", @@ -329,6 +349,7 @@ "settings_button_language": "언어", "settings_button_currency": "시스템 언어", "settings_button_node": "노드 설정", + "settings_label_whitelist": "Whitelist", "settings_node_label_default_node": "시스템 노드", "settings_node_label_customized_node": "커스텀 노드", "settings_node_button_add_node": "노드 추가", diff --git a/shared/resources/messages/zh/messages.json b/shared/resources/messages/zh/messages.json index 2e958101c..ca3fb9afd 100644 --- a/shared/resources/messages/zh/messages.json +++ b/shared/resources/messages/zh/messages.json @@ -177,6 +177,25 @@ "transaction_label_status_failed": "已失败", "transaction_label_status_completed": "已确认", + "transaction_detail_label_enable_whitelist": "开启白名单", + "transaction_detail_button_advanced_settings": "高级设置", + "transaction_detail_text_agree_whitelist": "您可以将此操作列入白名单,下次就不必再次授权。", + "transaction_detail_text_enable_advanced_settings": "打开高级设置,下次进行该操作时,无需进行弹窗确认直接执行,开启后可前往钱包管理中关闭", + + "wallet_mgmt_button_whitelist_detail": "白名单详情", + "wallet_mgmt_whitelist_title_whitelist": "白名单列表", + "wallet_mgmt_whitelist_label_enabled_dapps": "已开启应用", + "wallet_mgmt_whitelist_label_advance_settings": "高级设置", + "wallet_mgmt_whitelist_text_no_enabled_dapps": "暂无任何授权白名单的应用", + + "account_change_title_change": "切换账户", + "account_change_button_add_account": "添加账户", + "add_import_success_label_imported": "已导入", + "add_import_success_label_current": "当前钱包", + + "whitelist_title_tips": "提示", + "whitelist_title_content": "DApp白名单开关已经移置设置,新增了体验更流畅的高级模式,是否前往开启白名单功能?", + "resource_label_available": "可用", "resource_label_total": "总量", "resource_label_used": "已用", @@ -350,6 +369,7 @@ "settings_button_language": "语言", "settings_button_currency": "默认货币", "settings_button_node": "节点设置", + "settings_label_whitelist": "白名单功能", "settings_node_label_default_node": "默认节点", "settings_node_label_customized_node": "自定义节点", "settings_node_button_add_node": "添加节点", diff --git a/shared/sagas/whiteList.ts b/shared/sagas/whiteList.ts index 599b2fb54..966964dfc 100644 --- a/shared/sagas/whiteList.ts +++ b/shared/sagas/whiteList.ts @@ -3,6 +3,7 @@ import * as actions from 'actions/whiteList' import storage from 'utils/storage' import Dialog from 'components/Dialog' import Immutable from 'immutable' +import messages from 'resources/messages' function* noticeWhiteList(action: any) { try { @@ -21,8 +22,8 @@ function* noticeWhiteList(action: any) { const storeInfo = { dappLuanched: true } yield call(storage.mergeItem, 'bitportal_white_list', storeInfo, true) Dialog.whiteListAlert( - '提示', - 'DApp白名单开关已经移置设置,新增了体验更流畅的高级模式,是否前往开启白名单功能?', + messages[locale].whitelist_title_tips, + messages[locale].whitelist_title_content, locale, action.payload.componentId ) diff --git a/shared/screens/Account/AccountSelection/index.jsx b/shared/screens/Account/AccountSelection/index.jsx index b19efc866..edbbf4b86 100644 --- a/shared/screens/Account/AccountSelection/index.jsx +++ b/shared/screens/Account/AccountSelection/index.jsx @@ -95,6 +95,7 @@ export default class AccountSelection extends Component { eosValue={+eosPrice * +keyPermission.balance} eosAmount={keyPermission.balance} balanceTitle="Balance" + locale={locale} imported={hasEOSAccountImported( { eosAccountName: keyPermission.accountName, diff --git a/shared/screens/Account/AccountSwitch/index.jsx b/shared/screens/Account/AccountSwitch/index.jsx index 7d3642040..3df9a5e9d 100644 --- a/shared/screens/Account/AccountSwitch/index.jsx +++ b/shared/screens/Account/AccountSwitch/index.jsx @@ -59,11 +59,11 @@ export default class AccountSwitchModal extends Component { - 账户切换 + {messages[locale].account_change_title_change} - 添加新钱包 + {messages[locale].account_change_button_add_account} diff --git a/shared/screens/Profile/AccountDetails/index.jsx b/shared/screens/Profile/AccountDetails/index.jsx index 9f313775f..34c0bde22 100644 --- a/shared/screens/Profile/AccountDetails/index.jsx +++ b/shared/screens/Profile/AccountDetails/index.jsx @@ -6,7 +6,7 @@ import SettingItem from 'components/SettingItem' import { Navigation } from 'react-native-navigation' import NavigationBar, { CommonButton } from 'components/NavigationBar' import { connect } from 'react-redux' -import { FormattedMessage, IntlProvider } from 'react-intl' +import { IntlProvider } from 'react-intl' import * as keystoreActions from 'actions/keystore' import { logoutRequested, clearLogoutError } from 'actions/wallet' import { WALLET_MGT_EXPORT, WALLET_MGT_RESET_PW, WALLET_MGT_LOGOUT } from 'constants/analytics' @@ -144,7 +144,7 @@ export default class AccountDetails extends Component { contentContainerStyle={{ alignItems: 'center', paddingBottom: 20 }} > } + leftItemTitle={messages[locale].wallet_mgmt_button_export_private_key} onPress={this.showExportPrompt} extraStyle={{ marginTop: 10, @@ -153,11 +153,11 @@ export default class AccountDetails extends Component { }} /> } + leftItemTitle={messages[locale].wallet_mgmt_button_change_password} onPress={this.resetPassword} /> } + leftItemTitle={messages[locale].wallet_mgmt_button_sign_out} rightItemTitle=" " onPress={this.showLogoutPrompt} extraStyle={{ diff --git a/shared/screens/Profile/AccountManager/index.jsx b/shared/screens/Profile/AccountManager/index.jsx index 17a60176f..9ac16ec02 100644 --- a/shared/screens/Profile/AccountManager/index.jsx +++ b/shared/screens/Profile/AccountManager/index.jsx @@ -81,6 +81,7 @@ export default class AccountManager extends Component { eosValue={+eosPrice * +item.get('balance')} eosAmount={item.get('balance')} balanceTitle="Balance" + locale={locale} active={item.get('active')} onPress={this.checkAccountDetails.bind(this, item)} colors={item.get('permission').toLowerCase() !== 'owner' && Colors.ramColor} @@ -93,7 +94,7 @@ export default class AccountManager extends Component { - 添加新钱包 + {messages[locale].account_change_button_add_account} diff --git a/shared/screens/Profile/Settings/index.jsx b/shared/screens/Profile/Settings/index.jsx index 1e072ebe5..f6bcd1f3f 100644 --- a/shared/screens/Profile/Settings/index.jsx +++ b/shared/screens/Profile/Settings/index.jsx @@ -88,7 +88,7 @@ export default class Setting extends Component { /> } rightItemTitle='switch' value={value} onValueChange={this.onValueChange} diff --git a/shared/screens/Profile/WhiteListDetails/index.js b/shared/screens/Profile/WhiteListDetails/index.js index f8fdcac9d..abfff4568 100644 --- a/shared/screens/Profile/WhiteListDetails/index.js +++ b/shared/screens/Profile/WhiteListDetails/index.js @@ -90,10 +90,10 @@ export default class WhiteListDetails extends Component { renderHeader = () => ( - 白名单列表 + {messages[this.props.locale].wallet_mgmt_whitelist_label_enabled_dapps} - 高级设置 + {messages[this.props.locale].wallet_mgmt_whitelist_label_advance_settings} ) @@ -106,7 +106,7 @@ export default class WhiteListDetails extends Component { } /> @@ -125,7 +125,7 @@ export default class WhiteListDetails extends Component { : - 暂无白名单授权列表 + {messages[locale].wallet_mgmt_whitelist_text_no_enabled_dapps} }