diff --git a/ios/bitportal/Info.plist b/ios/bitportal/Info.plist index 7d61870e3..57ce8c4f6 100644 --- a/ios/bitportal/Info.plist +++ b/ios/bitportal/Info.plist @@ -30,7 +30,7 @@ CFBundleVersion - 6 + 7 LSRequiresIPhoneOS NSAppTransportSecurity 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/ActionModal/index.native.jsx b/shared/components/ActionModal/index.native.jsx index 0896bd770..1dd2828d4 100644 --- a/shared/components/ActionModal/index.native.jsx +++ b/shared/components/ActionModal/index.native.jsx @@ -200,6 +200,9 @@ export default class ActionModal extends Component { return () } else if (messageType === 'requestSignature') { return () + } else if (messageType === 'requestArbitrarySignature') { + console.log('###-yy eosAuthSign action modal: ', info) + return () } return null diff --git a/shared/components/BPNativeComponents/BPGradientButton/index.jsx b/shared/components/BPNativeComponents/BPGradientButton/index.jsx index cdd7b958e..60b9e1321 100644 --- a/shared/components/BPNativeComponents/BPGradientButton/index.jsx +++ b/shared/components/BPNativeComponents/BPGradientButton/index.jsx @@ -6,12 +6,12 @@ import styles from './styles' export default class BPGradientButton extends Component{ render() { - const { onPress, disabled, children, extraStyle } = this.props + const { onPress, disabled, colors, children, extraStyle } = this.props return ( {children} diff --git a/shared/components/DappWebView/index.native.jsx b/shared/components/DappWebView/index.native.jsx index d7daeaef9..0f78abef5 100644 --- a/shared/components/DappWebView/index.native.jsx +++ b/shared/components/DappWebView/index.native.jsx @@ -149,7 +149,7 @@ export default class DappWebView extends Component { } componentDidUpdate(prevProps) { - // console.log('###--xx sendingMessage: ', this.props.sendingMessage) + console.log('###--yy sendingMessage: ', this.props.sendingMessage) if (this.props.sendingMessage && prevProps.sendingMessage !== this.props.sendingMessage && this.webviewbridge) { this.webviewbridge.sendToBridge(this.props.sendingMessage) } @@ -213,7 +213,7 @@ export default class DappWebView extends Component { } onBridgeMessage = message => { - // console.log('###--xx receiveMessage: ', message) + console.log('###--yy receiveMessage: ', message) if (message.includes('clickedURL')) this.handleHistory(message) this.props.actions.receiveMessage(message) } @@ -239,14 +239,13 @@ export default class DappWebView extends Component { showPrompt = () => { const { whiteList } = this.props const dappName = whiteList.getIn(['selectedDapp', 'dappName']) + const accepted = whiteList.getIn(['selectedDapp', 'accept']) const dappList = whiteList.get('dappList') + let authorized = false - dappList.forEach(v => { - if (v.get('dappName') === dappName) { - authorized = v.get('authorized') - } - }) - if (authorized) { + dappList.forEach(v => { if (v.get('dappName') === dappName) { authorized = v.get('authorized') } }) + + if (accepted && authorized) { const password = whiteList.get('password') this.props.actions.resolveMessage({ password }) } else { diff --git a/shared/components/WalletCard/index.jsx b/shared/components/WalletCard/index.jsx index 5c4078f91..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,11 +31,12 @@ export default ({ accountType, accountName, balanceTitle, eosValue, eosAmount, a active && - 当前钱包 + {messages[locale].add_import_success_label_current} } + {/* */} diff --git a/shared/core/scatter/scatterdapp.js b/shared/core/scatter/scatterdapp.js index 5a77af5bf..af095cf42 100644 --- a/shared/core/scatter/scatterdapp.js +++ b/shared/core/scatter/scatterdapp.js @@ -80,7 +80,6 @@ const throwIfNoIdentity = () => { const setupSigProviders = (context) => { PluginRepository.signatureProviders().map((sigProvider) => { context[sigProvider.name] = sigProvider.signatureProvider(_send, throwIfNoIdentity) - console.log('###--xx sigProvider:', context[sigProvider.name]) return context[sigProvider.name] }) } diff --git a/shared/navigators/index.js b/shared/navigators/index.js index 486b782c7..944c678dd 100644 --- a/shared/navigators/index.js +++ b/shared/navigators/index.js @@ -3,6 +3,7 @@ import screenComponent from 'components/ScreenComponent' import { Platform } from 'react-native' import Market from 'screens/Market' import TokenPage from 'screens/Market/Overview/TokenPage' +import SystemResources from 'screens/SystemResources' import Welcome from 'screens/Welcome' import LightBox from 'screens/LightBox' import QRCodeScanner from 'screens/QRCodeScanner' @@ -75,6 +76,7 @@ export const registerScreens = store => { Navigation.registerComponent('BitPortal.AssetsTransfer', () => screenComponent(AssetsTransfer, store)) Navigation.registerComponent('BitPortal.AvailableAssets', () => screenComponent(AvailableAssets, store)) Navigation.registerComponent('BitPortal.Market', () => screenComponent(Market, store)) + Navigation.registerComponent('BitPortal.SystemResources', () => screenComponent(SystemResources, store)) Navigation.registerComponent('BitPortal.Discovery', () => screenComponent(Discovery, store)) Navigation.registerComponent('BitPortal.DiscoveryArticle', () => screenComponent(ArticleWebView, store)) Navigation.registerComponent('BitPortal.Markdown', () => screenComponent(Markdown, store)) 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/dappBrwoser.ts b/shared/sagas/dappBrwoser.ts index 664a22ad8..68b355ba8 100644 --- a/shared/sagas/dappBrwoser.ts +++ b/shared/sagas/dappBrwoser.ts @@ -140,7 +140,7 @@ function* pendSignEOSData(messageActionType: string, payload: any, messageId: st const account = payload.account const publicKey = payload.publicKey - const signData = payload.signData + const signData = payload.signData || payload.data const isHash = payload.isHash || false const blockchain = 'EOS' @@ -324,7 +324,7 @@ function* resolveSignEOSData(password: string, info: any, messageId: string) { try { const account = info.get('account') const publicKey = info.get('publicKey') - const signData = info.get('signData') + const signData = info.get('signData') const isHash = info.get('isHash') const signedData = yield call(eosAuthSign, { @@ -356,16 +356,47 @@ function* resolveSignEOSData(password: string, info: any, messageId: string) { } } +function* resolveRequestArbitrarySignature(password: string, info: any, messageId: string) { + try { + const account = info.get('account') + const publicKey = info.get('publicKey') + const signData = info.get('signData') + const isHash = info.get('isHash') + console.log('###--yy account: %s, publicKey: %s, signData: %s isHash: %s', account, publicKey, signData, isHash) + const signatures = yield call(eosAuthSign, { + account, + password, + publicKey, + signData, + isHash + }) + yield put(actions.clearMessage()) + yield put(actions.sendMessage({ + messageId, + type: 'actionSucceeded', + payload: { + data: { signatures, returnedFields: [] } + } + })) + } catch (error) { + yield put(actions.clearMessage()) + yield put(actions.sendMessage({ + messageId, + type: 'actionFailed', + payload: { + error: { + message: error.message || error + } + } + })) + } +} + function* resolveRequestSignature(password: string, info: any, messageId: string) { try { const buf = info.get('buf').toJS() const publicKey = yield select((state: RootState) => state.wallet.get('data').get('publicKey')) const account = yield select((state: RootState) => eosAccountNameSelector(state)) - - // 存储dapp信息并绑定account到本地 - const selectedDapp = yield select((state: RootState) => state.whiteList.get('selectedDapp')) - const store = selectedDapp.set('authorized', true).set('accountName', account).set('info', info).delete('password') - yield put(whiteListActions.updateWhiteListStoreInfo({ store })) const signatures = yield call(signature, { account, @@ -374,7 +405,13 @@ function* resolveRequestSignature(password: string, info: any, messageId: string buf }) yield put(actions.clearMessage()) - // delay(350) + yield delay(500) + + // 存储dapp信息并绑定account到本地 + const selectedDapp = yield select((state: RootState) => state.whiteList.get('selectedDapp')) + const store = selectedDapp.set('authorized', true).set('accountName', account).set('info', info).delete('password') + yield put(whiteListActions.updateWhiteListStoreInfo({ store })) + yield put(actions.sendMessage({ messageId, type: 'actionSucceeded', @@ -630,6 +667,17 @@ function* receiveMessage(action: Action) { }, messageId) } break + case 'requestArbitrarySignature': + { + // console.log('###--yy', messageActionType) + const currentWallet = yield select((state: RootState) => currenctWalletSelector(state)) + assert(currentWallet, 'No wallet in BitPortal!') + payload.account = currentWallet.get('account') + const publicKey = payload.publicKey + assert(publicKey === currentWallet.get('publicKey'), 'Public key is not in BitPortal.') + yield pendSignEOSData(messageActionType, payload, messageId) + } + break case 'forgetIdentity': case 'requestAddNetwork': { @@ -729,6 +777,9 @@ function* resolveMessage(action: Action) { case 'requestSignature': yield resolveRequestSignature(password, info, messageId) break + case 'requestArbitrarySignature': + yield resolveRequestArbitrarySignature(password, info, messageId) + break default: break } diff --git a/shared/sagas/eosAccount.ts b/shared/sagas/eosAccount.ts index b7212660d..5609eb741 100644 --- a/shared/sagas/eosAccount.ts +++ b/shared/sagas/eosAccount.ts @@ -240,8 +240,14 @@ function* getEOSKeyAccountsRequested(action: Action) { for (const accountName of keyAccounts) { const accountInfo = yield call(eos.getAccount, accountName) const permissions = getPermissionsByKey(publicKey, accountInfo) - // console.log('###--yy', permissions, accountInfo) - keyPermissions = [...keyPermissions, ...permissions] + if (permissions.length > 1) { + const newPermissions = permissions.filter((v: any) => ( v.permission == 'active')) + // console.log('###--yy', newPermissions) + keyPermissions = [...keyPermissions, ...newPermissions] + } else { + // console.log('###--yy', permissions, accountInfo) + keyPermissions = [...keyPermissions, ...permissions] + } } yield put(actions.getEOSKeyAccountsSucceeded(result)) 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 9412f389c..edbbf4b86 100644 --- a/shared/screens/Account/AccountSelection/index.jsx +++ b/shared/screens/Account/AccountSelection/index.jsx @@ -1,7 +1,7 @@ import React, { Component } from 'react' import { bindActionCreators } from 'redux' import { connect } from 'react-redux' -import { View, ScrollView } from 'react-native' +import { Text, View, ScrollView, TouchableOpacity } from 'react-native' import { Navigation } from 'react-native-navigation' import NavigationBar, { CommonButton, CommonRightButton } from 'components/NavigationBar' import Colors from 'resources/colors' @@ -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, @@ -109,8 +110,16 @@ export default class AccountSelection extends Component { )) } - + {/* + + + 导入账户 + + + */} + + ) diff --git a/shared/screens/Account/AccountSelection/styles.ts b/shared/screens/Account/AccountSelection/styles.ts index 82c8942fb..d9d1beeab 100644 --- a/shared/screens/Account/AccountSelection/styles.ts +++ b/shared/screens/Account/AccountSelection/styles.ts @@ -1,6 +1,6 @@ import { StyleSheet } from 'react-native' import Colors from 'resources/colors' -import { SCREEN_WIDTH, SCREEN_HEIGHT, NAV_BAR_HEIGHT, FontScale } from 'utils/dimens' +import { SCREEN_WIDTH, SCREEN_HEIGHT, NAV_BAR_HEIGHT, TAB_BAR_HEIGHT, ifIphoneX, FontScale } from 'utils/dimens' const styles = StyleSheet.create({ container: { @@ -10,7 +10,7 @@ const styles = StyleSheet.create({ }, scrollContainer: { width: SCREEN_WIDTH, - height: SCREEN_HEIGHT - NAV_BAR_HEIGHT, + height: SCREEN_HEIGHT - NAV_BAR_HEIGHT - TAB_BAR_HEIGHT, alignItems: 'center' }, cardContainer: { @@ -35,6 +35,10 @@ const styles = StyleSheet.create({ justifyContent: 'space-between', flexDirection: 'row' }, + center: { + alignItems: 'center', + justifyContent: 'center' + }, paddingStyle: { paddingHorizontal: 20 }, @@ -43,6 +47,16 @@ const styles = StyleSheet.create({ paddingHorizontal: 10, backgroundColor: Colors.bgColor_FFFFFF }, + btnContainer: { + width: SCREEN_WIDTH, + height: TAB_BAR_HEIGHT, + backgroundColor: Colors.minorThemeColor, + ...ifIphoneX({ + paddingBottom: 34 + }, { + paddingBottom: 0 + }) + }, text12: { fontSize: FontScale(12), color: Colors.textColor_255_255_238 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/Assets/AssetChart/index.jsx b/shared/screens/Assets/AssetChart/index.jsx index 08d613c1a..e16b56a08 100644 --- a/shared/screens/Assets/AssetChart/index.jsx +++ b/shared/screens/Assets/AssetChart/index.jsx @@ -18,8 +18,11 @@ import { RecyclerListView, LayoutProvider } from 'recyclerlistview' import ImmutableDataProvider from 'utils/immutableDataProvider' import { SCREEN_WIDTH } from 'utils/dimens' import messages from 'resources/messages' +import Images from 'resources/images' +import { BPImage, BPGradientButton } from 'components/BPNativeComponents' import RecordItem from './RecordItem' import styles from './styles' +import Colors from 'resources/colors' const dataProvider = new ImmutableDataProvider((r1, r2) => r1.get('account_action_seq') !== r2.get('account_action_seq')) @@ -203,13 +206,27 @@ export default class AssetChart extends Component { /> - - - + + + + + + + + + + - - - + + + + + + + + + + diff --git a/shared/screens/Assets/AssetChart/styles.js b/shared/screens/Assets/AssetChart/styles.js index 94eb27056..10d369e3c 100644 --- a/shared/screens/Assets/AssetChart/styles.js +++ b/shared/screens/Assets/AssetChart/styles.js @@ -58,6 +58,11 @@ const styles = StyleSheet.create({ width: 1, backgroundColor: Colors.bgColor_FFFFFF }, + image: { + width: 16, + height: 16, + marginRight: 10, + }, btn: { width: (SCREEN_WIDTH - 1) / 2, ...ifIphoneX({ diff --git a/shared/screens/Assets/index.jsx b/shared/screens/Assets/index.jsx index 451275d59..f0a9908f2 100644 --- a/shared/screens/Assets/index.jsx +++ b/shared/screens/Assets/index.jsx @@ -255,7 +255,7 @@ export default class Assets extends Component { onEventWithLabel(ASSETS_EOS_RESOURCE, '资产 - EOS资源管理') Navigation.push(this.props.componentId, { component: { - name: 'BitPortal.Resources' + name: 'BitPortal.SystemResources' } }) } diff --git a/shared/screens/DappBrowser/index.jsx b/shared/screens/DappBrowser/index.jsx index f71943d8a..0568dfb68 100644 --- a/shared/screens/DappBrowser/index.jsx +++ b/shared/screens/DappBrowser/index.jsx @@ -92,6 +92,7 @@ export default class DappWebView extends Component { componentDidUpdate(prevProps) { if (this.props.sendingMessage && prevProps.sendingMessage !== this.props.sendingMessage && this.webviewbridge) { + console.log('###--yy sendingMessage: --', this.props.sendingMessage) this.webviewbridge.sendToBridge(this.props.sendingMessage) } } diff --git a/shared/screens/Market/MarketContent/index.jsx b/shared/screens/Market/MarketContent/index.jsx index 21480a6a9..9210f914d 100644 --- a/shared/screens/Market/MarketContent/index.jsx +++ b/shared/screens/Market/MarketContent/index.jsx @@ -8,7 +8,7 @@ class MarketContent extends Component { const { category } = this.props if (category === 'OVERVIEW') return else if (category === 'DEXLIZE') return - else if (category === 'SYSTEM') return + else if (category === 'SYSTEM') return else return null } } diff --git a/shared/screens/Market/SystemResources/index.jsx b/shared/screens/Market/SystemResources/index.jsx index 858ce953b..81ffde788 100644 --- a/shared/screens/Market/SystemResources/index.jsx +++ b/shared/screens/Market/SystemResources/index.jsx @@ -55,12 +55,13 @@ export default class SystemResources extends React.Component { ) render() { + const { componentId } = this.props return ( , third: Net })} onIndexChange={index => { 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 dc4a7fc74..9ac16ec02 100644 --- a/shared/screens/Profile/AccountManager/index.jsx +++ b/shared/screens/Profile/AccountManager/index.jsx @@ -7,6 +7,7 @@ import { connect } from 'react-redux' import { IntlProvider } from 'react-intl' import messages from 'resources/messages' import WalletCard from 'components/WalletCard' +import { BPGradientButton } from 'components/BPNativeComponents' import { walletListSelector } from 'selectors/wallet' import { eosPriceSelector } from 'selectors/ticker' import styles from './styles' @@ -80,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} @@ -89,11 +91,13 @@ 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/Voting/index.jsx b/shared/screens/Profile/Voting/index.jsx index e964f11cd..48961a008 100644 --- a/shared/screens/Profile/Voting/index.jsx +++ b/shared/screens/Profile/Voting/index.jsx @@ -154,7 +154,7 @@ export default class Voting extends Component { } else { Navigation.push(this.props.componentId, { component: { - name: 'BitPortal.Resources' + name: 'BitPortal.SystemResources' } }) } diff --git a/shared/screens/Profile/WhiteListDetails/index.js b/shared/screens/Profile/WhiteListDetails/index.js index 6ce27979a..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} } diff --git a/shared/screens/Profile/index.jsx b/shared/screens/Profile/index.jsx index 474678b07..806acfa6a 100644 --- a/shared/screens/Profile/index.jsx +++ b/shared/screens/Profile/index.jsx @@ -77,7 +77,7 @@ export default class Profile extends Component { break case 'Resources': if (this.props.hasEOSAccount) { - pageName = 'Resources' + pageName = 'SystemResources' } else { return this.dialog() } diff --git a/shared/screens/SystemResources/index.jsx b/shared/screens/SystemResources/index.jsx new file mode 100644 index 000000000..73c3ea465 --- /dev/null +++ b/shared/screens/SystemResources/index.jsx @@ -0,0 +1,45 @@ +import * as React from 'react' +import { View, Text } from 'react-native' +import { connect } from 'react-redux' +import { IntlProvider } from 'react-intl' +import NavigationBar, { CommonButton } from 'components/NavigationBar' +import { Navigation } from 'react-native-navigation' +import SystemResource from 'screens/Market/SystemResources' +import messages from 'resources/messages' +import styles from './styles' + +@connect( + state => ({ + locale: state.intl.get('locale') + }), + null, + null, + { withRef: true } +) + +export default class SystemResources extends React.Component { + static get options() { + return { + bottomTabs: { + visible: false + } + } + } + + render() { + const { locale, componentId } = this.props + return ( + + + Navigation.pop(this.props.componentId)} />} + /> + + + + + + ) + } +} diff --git a/shared/screens/SystemResources/styles.js b/shared/screens/SystemResources/styles.js new file mode 100644 index 000000000..d20b23654 --- /dev/null +++ b/shared/screens/SystemResources/styles.js @@ -0,0 +1,20 @@ +import Colors from 'resources/colors' +import { + SCREEN_WIDTH, + SCREEN_HEIGHT, + NAV_BAR_HEIGHT +} from 'utils/dimens' + +const styles = { + container: { + width: SCREEN_WIDTH, + height: SCREEN_HEIGHT, + backgroundColor: Colors.mainThemeColor + }, + scrollContainer: { + height: SCREEN_HEIGHT - NAV_BAR_HEIGHT, + flexDirection: 'column' + } +} + +export default styles