1 import React from 'react'
2 import styles from './Index.scss'
3 import { Link } from 'react-router'
4 import {withNamespaces} from 'react-i18next'
5 import {connect} from 'react-redux'
7 class Index extends React.Component {
18 value:event.target.value
23 const coreData = this.props.coreData
24 const t = this.props.t
29 const networkID = coreData.networkId
30 const createButton = <Link className={`btn btn-primary ${styles.submit}`} to='/initialization/register'>{t('init.create')}</Link>
31 const restoreKeystore = <Link className={`btn btn-primary ${styles.submit}`}to='/initialization/restoreKeystore'>{t('init.restoreWallet')}</Link>
32 const restoreMnemonic = <Link className={`btn btn-primary ${styles.submit}`} to='/initialization/restoreMnemonic'>{t('init.restoreWallet')}</Link>
35 <div onChange={e => this.setValue(e)}>
36 <h2 className={styles.title}>{t('init.welcome',{network:networkID})}</h2>
38 <div className={styles.choices}>
39 <div className={styles.choice_wrapper}>
41 <input className={styles.choice_radio_button}
45 <div className={`${styles.choice} ${styles.backup} `}>
46 <span className={styles.choice_title}>{t('init.create')}</span>
48 {t('init.createDescription')}
54 <div className={styles.choice_wrapper}>
56 <input className={styles.choice_radio_button}
59 value='restoreKeystore' />
60 <div className={`${styles.choice} ${styles.restore}`}>
61 <span className={styles.choice_title}>{t('backup.restoreKeystore')}</span>
63 {t('backup.restoreKeystoreDescription')}
69 <div className={styles.choice_wrapper}>
71 <input className={styles.choice_radio_button}
74 value='restoreMnemonic' />
75 <div className={`${styles.choice} ${styles.restore}`}>
76 <span className={styles.choice_title}>{t('backup.restoreMnemonic')}</span>
78 {t('backup.restoreMnemonicDescription')}
85 <div className={styles.choices}>
88 this.state.value === 'backup'
89 &&<span className={styles.submitWrapper}>{createButton}</span>
95 this.state.value === 'restoreKeystore'
97 <span className={styles.submitWrapper}>{restoreKeystore}</span>
103 this.state.value === 'restoreMnemonic'
104 && <span className={styles.submitWrapper}>{restoreMnemonic}</span>
113 export default withNamespaces('translations') (connect(
115 coreData:state.core.coreData