"mnemonic":"mnemonic",
"mnemonicRequire":"Mnemonic is Required",
"create": "Create Wallet",
- "createDescription":"This option will create a default account, key password and give you a option to keep you mnemonic. Warning: key seed words will display only once, it's important to remember your password.",
- "welcome":"Welcome to Bytom __network__"
+ "createDescription":"This option will create a default account, key password. Warning: it's important to remember your password.",
+ "welcome":"Welcome to Vapor __network__"
},
+ "welcome":{
+ "connect":"Connecting to Bytom Core...",
+ "join":"Joining network",
+ "joining":"Joining network...",
+ "title":"Configure Bytom Core",
+ "mainnetTitle":"Join the Bytom Mainnet",
+ "mainnetMsg":"For common users to enter. Mainnet is the production network, that carry real Bytom transactions.",
+ "testnetTitle":"Join the Bytom Testnet",
+ "testnetMsg":"For developers or bytom testers to enter. Testnet is an alternative Bytom blockchain, and to be used for testing.",
+ "solonetTitle":"Create the Bytom Soloent",
+ "solonetMsg":"For users/developers to run and test wallet's new function. Solonet is a private sandbox blockchain network."
+ },
"backup":{
"title":"Backup and Restore",
"backup":"Back Up",
class Container extends React.Component {
constructor(props) {
super(props)
- this.state = {
- noAccountItem: false
- }
+ if(props.location.pathname.includes('index.html')) {
+ this.redirectRoot(props)
+ }
this.redirectRoot = this.redirectRoot.bind(this)
}
return
}
- if (accountInit) {
- if (location.pathname === '/'|| location.pathname.indexOf('initialization') >= 0) {
+ if(!configured){
+ this.props.showConfiguration()
- }else if(!accountInit && this.state.noAccountItem){
++ }else if(!accountInit){
+ this.props.showInitialization()
+ }else {
+ if (location.pathname === '/' ||
+ location.pathname.indexOf('configuration') >= 0 ||
+ location.pathname.includes('index.html') ||
+ location.pathname.indexOf('initialization') >= 0) {
this.props.showRoot()
}
- } else {
- this.props.showInitialization()
}
}
componentDidMount() {
- this.props.fetchKeyItem().then(resp => {
- if (resp.data.length == 0) {
- this.setState({noAccountItem: true})
- this.redirectRoot(this.props)
- }
- })
+ if(window.ipcRenderer){
+ window.ipcRenderer.on('redirect', (event, arg) => {
+ this.props.history.push(arg)
+ })
+ window.ipcRenderer.on('btmAmountUnitState', (event, arg) => {
+ this.props.uptdateBtmAmountUnit(arg)
+ })
+ window.ipcRenderer.on('lang', (event, arg) => {
+ this.props.i18n.changeLanguage(arg)
+ })
+ window.ipcRenderer.on('ConfiguredNetwork', (event, arg) => {
+ if(arg === 'startNode'){
+ this.props.fetchInfo().then(() => {
+ this.props.fetchKeyItem().then(resp => {
+ if (resp.data.length == 0) {
+ this.setState({noAccountItem: true})
+ this.props.showInitialization()
+ }
+ })
+ this.props.showRoot()
+ })
+ setInterval(() => this.props.fetchInfo(), CORE_POLLING_TIME)
+ }
+ if(arg === 'init'){
+ this.props.updateConfiguredStatus()
+ }
+ })
+ window.ipcRenderer.on('mining', (event, arg) => {
+ let isMining = (arg == 'true')
+ this.props.updateMiningState(isMining)
+ })
+ }
if(this.props.lng === 'zh'){
moment.locale('zh-cn')
}else{
render() {
let layout
- const { t, i18n } = this.props
-
+ const { i18n, t } = this.props
i18n.on('languageChanged', function(lng) {
if(lng === 'zh'){
moment.locale('zh-cn')
if (!this.props.authOk) {
layout = <Login/>
- } else if (!this.props.configKnown) {
- return <Loading>{t('main.loading')}</Loading>
} else if (!this.props.configured) {
layout = <Config>{this.props.children}</Config>
- } else if (!this.props.accountInit && this.state.noAccountItem){
+ } else if (!this.props.configKnown) {
+ return <Loading>{t('welcome.connect')}</Loading>
+ } else if (!this.props.accountInit){
layout = <Config>{this.props.children}</Config>
} else{
layout = <Main>{this.props.children}</Main>
(state) => ({
authOk: !state.core.requireClientToken || state.core.validToken,
configKnown: state.core.configKnown,
- configured: true,
+ configured: state.core.configured,
- onTestnet: state.core.onTestnet,
+ flashMessages: state.app.flashMessages,
accountInit: state.core.accountInit,
+ currentAccount: state.account.currentAccount
}),
(dispatch) => ({
fetchInfo: options => dispatch(actions.core.fetchCoreInfo(options)),
+ updateMiningState: param => dispatch(actions.core.updateMiningState(param)),
showRoot: () => dispatch(actions.app.showRoot),
+ showConfiguration: () => dispatch(actions.app.showConfiguration()),
+ uptdateBtmAmountUnit: (param) => dispatch(actions.core.updateBTMAmountUnit(param)),
+ updateConfiguredStatus: () => dispatch(actions.core.updateConfiguredStatus),
showInitialization: () => dispatch(actions.app.showInitialization()),
- fetchKeyItem: () => dispatch(actions.key.fetchItems())
+ updateAccountInit: (param) => dispatch(actions.app.updateAccountInit(param)),
+ fetchKeyItem: () => dispatch(actions.key.fetchItems()),
+ fetchAccountItem: () => dispatch(actions.account.fetchItems()),
+ setDefaultAccount:() => dispatch(actions.account.setDefaultAccount()),
+ switchAccount:(alias) => dispatch(actions.account.switchAccount(alias))
})
)( withI18n() (Container) )
class Navigation extends React.Component {
constructor(props) {
super(props)
-
this.openTutorial = this.openTutorial.bind(this)
+ this.state = {
+ showFed: false
+ }
}
+ componentDidMount() {
+ if(window.ipcRenderer){
+ window.ipcRenderer.on('toggleNavState', (event, arg) => {
+ arg === 'advance'? this.props.showNavAdvanced() : this.props.hideNavAdvanced()
+ })
+ }
+ }
+
openTutorial(event) {
event.preventDefault()
this.props.openTutorial()
</li>
</ul>
- <ul className={styles.navigation}>
- <li className={styles.navigationTitle}>{ t('crumbName.developer') }</li>
- <li>
- <a href='http://localhost:9888/equity' target='_blank'>
- {navIcon('transaction', styles)}
- { t('crumbName.equity')}
- </a>
- </li>
- </ul>
- {/*<ul className={styles.navigation}>*/}
- {/*<li className={styles.navigationTitle}>{ t('crumbName.developer') }</li>*/}
- {/*<li>*/}
- {/*<a href='/equity' target='_blank'>*/}
- {/*{navIcon('transaction', styles)}*/}
- {/*{ t('crumbName.equity')}*/}
- {/*</a>*/}
- {/*</li>*/}
- {/*</ul>*/}
-
<Sync/>
}
},
(dispatch) => ({
- hideNavAdvanced: () => dispatch(appAction.hideNavAdvanced)
+ showNavAdvanced: () => dispatch(appAction.showNavAdvanced),
++ hideNavAdvanced: () => dispatch(appAction.hideNavAdvanced),
+ fetchFederationItem: () => dispatch(actions.federation.fetchItems()),
})
)( withNamespaces('translations')(Navigation))