mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Fix merge conflicts. Refactor onboarding flow.
This commit is contained in:
parent
6f367a5a6b
commit
58f52b2b8d
@ -1,13 +1,19 @@
|
|||||||
import React, { Component } from 'react'
|
import React, { Component } from 'react'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import {connect} from 'react-redux'
|
import {connect} from 'react-redux'
|
||||||
|
import { withRouter } from 'react-router-dom'
|
||||||
|
import { compose } from 'recompose'
|
||||||
import { createNewVaultAndKeychain } from '../../../../ui/app/actions'
|
import { createNewVaultAndKeychain } from '../../../../ui/app/actions'
|
||||||
import LoadingScreen from './loading-screen'
|
import LoadingScreen from './loading-screen'
|
||||||
import Breadcrumbs from './breadcrumbs'
|
import Breadcrumbs from './breadcrumbs'
|
||||||
import { DEFAULT_ROUTE, IMPORT_ACCOUNT_ROUTE } from '../../../../ui/app/routes'
|
|
||||||
import EventEmitter from 'events'
|
import EventEmitter from 'events'
|
||||||
import Mascot from '../../../../ui/app/components/mascot'
|
import Mascot from '../../../../ui/app/components/mascot'
|
||||||
import classnames from 'classnames'
|
import classnames from 'classnames'
|
||||||
|
import {
|
||||||
|
DEFAULT_ROUTE,
|
||||||
|
INITIALIZE_IMPORT_WITH_SEED_PHRASE_ROUTE,
|
||||||
|
INITIALIZE_IMPORT_ACCOUNT_ROUTE,
|
||||||
|
} from '../../../../ui/app/routes'
|
||||||
|
|
||||||
class CreatePasswordScreen extends Component {
|
class CreatePasswordScreen extends Component {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
@ -63,7 +69,7 @@ class CreatePasswordScreen extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { isLoading, isMascara } = this.props
|
const { isLoading, isMascara, history } = this.props
|
||||||
|
|
||||||
return isLoading
|
return isLoading
|
||||||
? <LoadingScreen loadingMessage="Creating your new account" />
|
? <LoadingScreen loadingMessage="Creating your new account" />
|
||||||
@ -114,7 +120,7 @@ class CreatePasswordScreen extends Component {
|
|||||||
className="first-time-flow__link create-password__import-link"
|
className="first-time-flow__link create-password__import-link"
|
||||||
onClick={e => {
|
onClick={e => {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
history.push(IMPORT_ACCOUNT_ROUTE)
|
history.push(INITIALIZE_IMPORT_WITH_SEED_PHRASE_ROUTE)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Import with seed phrase
|
Import with seed phrase
|
||||||
@ -125,7 +131,7 @@ class CreatePasswordScreen extends Component {
|
|||||||
className="first-time-flow__link create-password__import-link"
|
className="first-time-flow__link create-password__import-link"
|
||||||
onClick={e => {
|
onClick={e => {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
goToImportAccount()
|
history.push(INITIALIZE_IMPORT_ACCOUNT_ROUTE)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Import an account
|
Import an account
|
||||||
@ -140,18 +146,22 @@ class CreatePasswordScreen extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const mapStateToProps = state => {
|
const mapStateToProps = state => {
|
||||||
const { metamask: { isInitialized, isUnlocked }, appState: { isLoading } } = state
|
const { metamask: { isInitialized, isUnlocked, isMascara }, appState: { isLoading } } = state
|
||||||
|
|
||||||
return {
|
return {
|
||||||
isLoading,
|
isLoading,
|
||||||
isInitialized,
|
isInitialized,
|
||||||
isUnlocked,
|
isUnlocked,
|
||||||
|
isMascara,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default connect(
|
export default compose(
|
||||||
mapStateToProps,
|
withRouter,
|
||||||
dispatch => ({
|
connect(
|
||||||
createAccount: password => dispatch(createNewVaultAndKeychain(password)),
|
mapStateToProps,
|
||||||
})
|
dispatch => ({
|
||||||
|
createAccount: password => dispatch(createNewVaultAndKeychain(password)),
|
||||||
|
})
|
||||||
|
)
|
||||||
)(CreatePasswordScreen)
|
)(CreatePasswordScreen)
|
||||||
|
@ -142,6 +142,7 @@ class ImportAccountScreen extends Component {
|
|||||||
render () {
|
render () {
|
||||||
const { OPTIONS } = ImportAccountScreen
|
const { OPTIONS } = ImportAccountScreen
|
||||||
const { selectedOption } = this.state
|
const { selectedOption } = this.state
|
||||||
|
console.log('RENDER IMPORT')
|
||||||
|
|
||||||
return this.props.isLoading
|
return this.props.isLoading
|
||||||
? <LoadingScreen loadingMessage="Creating your new account" />
|
? <LoadingScreen loadingMessage="Creating your new account" />
|
||||||
|
@ -8,16 +8,16 @@ import {
|
|||||||
displayWarning,
|
displayWarning,
|
||||||
unMarkPasswordForgotten,
|
unMarkPasswordForgotten,
|
||||||
} from '../../../../ui/app/actions'
|
} from '../../../../ui/app/actions'
|
||||||
|
import { DEFAULT_ROUTE } from '../../../../ui/app/routes'
|
||||||
|
|
||||||
class ImportSeedPhraseScreen extends Component {
|
class ImportSeedPhraseScreen extends Component {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
warning: PropTypes.string,
|
warning: PropTypes.string,
|
||||||
back: PropTypes.func.isRequired,
|
|
||||||
next: PropTypes.func.isRequired,
|
|
||||||
createNewVaultAndRestore: PropTypes.func.isRequired,
|
createNewVaultAndRestore: PropTypes.func.isRequired,
|
||||||
hideWarning: PropTypes.func.isRequired,
|
hideWarning: PropTypes.func.isRequired,
|
||||||
displayWarning: PropTypes.func,
|
displayWarning: PropTypes.func,
|
||||||
leaveImportSeedScreenState: PropTypes.func,
|
leaveImportSeedScreenState: PropTypes.func,
|
||||||
|
history: PropTypes.object,
|
||||||
};
|
};
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
@ -64,14 +64,14 @@ class ImportSeedPhraseScreen extends Component {
|
|||||||
const { password, seedPhrase } = this.state
|
const { password, seedPhrase } = this.state
|
||||||
const {
|
const {
|
||||||
createNewVaultAndRestore,
|
createNewVaultAndRestore,
|
||||||
next,
|
|
||||||
displayWarning,
|
displayWarning,
|
||||||
leaveImportSeedScreenState,
|
leaveImportSeedScreenState,
|
||||||
|
history,
|
||||||
} = this.props
|
} = this.props
|
||||||
|
|
||||||
leaveImportSeedScreenState()
|
leaveImportSeedScreenState()
|
||||||
createNewVaultAndRestore(password, this.parseSeedPhrase(seedPhrase))
|
createNewVaultAndRestore(password, this.parseSeedPhrase(seedPhrase))
|
||||||
.then(next)
|
.then(() => history.push(DEFAULT_ROUTE))
|
||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
@ -86,7 +86,7 @@ class ImportSeedPhraseScreen extends Component {
|
|||||||
className="import-account__back-button"
|
className="import-account__back-button"
|
||||||
onClick={e => {
|
onClick={e => {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
this.props.back()
|
this.props.history.goBack()
|
||||||
}}
|
}}
|
||||||
href="#"
|
href="#"
|
||||||
>
|
>
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
import React, { Component } from 'react'
|
import React, { Component } from 'react'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import {connect} from 'react-redux'
|
import {connect} from 'react-redux'
|
||||||
|
import { withRouter, Switch, Route, Redirect } from 'react-router-dom'
|
||||||
|
import { compose } from 'recompose'
|
||||||
import CreatePasswordScreen from './create-password-screen'
|
import CreatePasswordScreen from './create-password-screen'
|
||||||
import UniqueImageScreen from './unique-image-screen'
|
import UniqueImageScreen from './unique-image-screen'
|
||||||
import NoticeScreen from './notice-screen'
|
import NoticeScreen from './notice-screen'
|
||||||
@ -12,6 +14,13 @@ import {
|
|||||||
unMarkPasswordForgotten,
|
unMarkPasswordForgotten,
|
||||||
showModal,
|
showModal,
|
||||||
} from '../../../../ui/app/actions'
|
} from '../../../../ui/app/actions'
|
||||||
|
import {
|
||||||
|
DEFAULT_ROUTE,
|
||||||
|
WELCOME_ROUTE,
|
||||||
|
INITIALIZE_ROUTE,
|
||||||
|
INITIALIZE_IMPORT_ACCOUNT_ROUTE,
|
||||||
|
INITIALIZE_IMPORT_WITH_SEED_PHRASE_ROUTE,
|
||||||
|
} from '../../../../ui/app/routes'
|
||||||
|
|
||||||
class FirstTimeFlow extends Component {
|
class FirstTimeFlow extends Component {
|
||||||
|
|
||||||
@ -20,7 +29,10 @@ class FirstTimeFlow extends Component {
|
|||||||
seedWords: PropTypes.string,
|
seedWords: PropTypes.string,
|
||||||
address: PropTypes.string,
|
address: PropTypes.string,
|
||||||
noActiveNotices: PropTypes.bool,
|
noActiveNotices: PropTypes.bool,
|
||||||
goToBuyEtherView: PropTypes.func.isRequired,
|
goToBuyEtherView: PropTypes.func,
|
||||||
|
isUnlocked: PropTypes.bool,
|
||||||
|
history: PropTypes.object,
|
||||||
|
welcomeScreenSeen: PropTypes.bool,
|
||||||
};
|
};
|
||||||
|
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
@ -47,6 +59,14 @@ class FirstTimeFlow extends Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentDidMount () {
|
||||||
|
const { isInitialized, isUnlocked, history } = this.props
|
||||||
|
|
||||||
|
if (isInitialized || isUnlocked) {
|
||||||
|
history.push(DEFAULT_ROUTE)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
setScreenType (screenType) {
|
setScreenType (screenType) {
|
||||||
this.setState({ screenType })
|
this.setState({ screenType })
|
||||||
}
|
}
|
||||||
@ -141,34 +161,54 @@ class FirstTimeFlow extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
return (
|
return this.props.welcomeScreenSeen
|
||||||
<div className="first-time-flow">
|
? (
|
||||||
{this.renderScreen()}
|
<div className="first-time-flow">
|
||||||
</div>
|
<Switch>
|
||||||
)
|
<Route exact path={INITIALIZE_IMPORT_ACCOUNT_ROUTE} component={ImportAccountScreen} />
|
||||||
|
<Route
|
||||||
|
exact
|
||||||
|
path={INITIALIZE_IMPORT_WITH_SEED_PHRASE_ROUTE}
|
||||||
|
component={ImportSeedPhraseScreen}
|
||||||
|
/>
|
||||||
|
<Route exact path={INITIALIZE_ROUTE} component={CreatePasswordScreen} />
|
||||||
|
</Switch>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
: <Redirect to={WELCOME_ROUTE } />
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default connect(
|
const mapStateToProps = ({ metamask }) => {
|
||||||
({
|
const {
|
||||||
metamask: {
|
isInitialized,
|
||||||
isInitialized,
|
seedWords,
|
||||||
seedWords,
|
noActiveNotices,
|
||||||
noActiveNotices,
|
selectedAddress,
|
||||||
selectedAddress,
|
forgottenPassword,
|
||||||
forgottenPassword,
|
isMascara,
|
||||||
}
|
isUnlocked,
|
||||||
}) => ({
|
welcomeScreenSeen,
|
||||||
|
} = metamask
|
||||||
|
|
||||||
|
return {
|
||||||
|
isMascara,
|
||||||
isInitialized,
|
isInitialized,
|
||||||
seedWords,
|
seedWords,
|
||||||
noActiveNotices,
|
noActiveNotices,
|
||||||
address: selectedAddress,
|
address: selectedAddress,
|
||||||
forgottenPassword,
|
forgottenPassword,
|
||||||
}),
|
isUnlocked,
|
||||||
dispatch => ({
|
welcomeScreenSeen,
|
||||||
leaveImportSeedScreenState: () => dispatch(unMarkPasswordForgotten()),
|
}
|
||||||
openBuyEtherModal: () => dispatch(showModal({ name: 'DEPOSIT_ETHER'})),
|
}
|
||||||
})
|
|
||||||
)(FirstTimeFlow)
|
|
||||||
|
|
||||||
|
const mapDispatchToProps = dispatch => ({
|
||||||
|
leaveImportSeedScreenState: () => dispatch(unMarkPasswordForgotten()),
|
||||||
|
openBuyEtherModal: () => dispatch(showModal({ name: 'DEPOSIT_ETHER'})),
|
||||||
|
})
|
||||||
|
|
||||||
|
export default compose(
|
||||||
|
withRouter,
|
||||||
|
connect(mapStateToProps, mapDispatchToProps)
|
||||||
|
)(FirstTimeFlow)
|
||||||
|
@ -70,27 +70,29 @@ class NoticeScreen extends Component {
|
|||||||
isLoading
|
isLoading
|
||||||
? <LoadingScreen />
|
? <LoadingScreen />
|
||||||
: (
|
: (
|
||||||
<div className="first-view-main-wrapper">
|
<div className="first-time-flow">
|
||||||
<div className="first-view-main">
|
<div className="first-view-main-wrapper">
|
||||||
<div
|
<div className="first-view-main">
|
||||||
className="tou"
|
<div
|
||||||
onScroll={this.onScroll}
|
className="tou"
|
||||||
>
|
onScroll={this.onScroll}
|
||||||
<Identicon address={address} diameter={70} />
|
|
||||||
<div className="tou__title">{title}</div>
|
|
||||||
<Markdown
|
|
||||||
className="tou__body markdown"
|
|
||||||
source={body}
|
|
||||||
skipHtml
|
|
||||||
/>
|
|
||||||
<button
|
|
||||||
className="first-time-flow__button"
|
|
||||||
onClick={atBottom && this.acceptTerms}
|
|
||||||
disabled={!atBottom}
|
|
||||||
>
|
>
|
||||||
Accept
|
<Identicon address={address} diameter={70} />
|
||||||
</button>
|
<div className="tou__title">{title}</div>
|
||||||
<Breadcrumbs total={3} currentIndex={2} />
|
<Markdown
|
||||||
|
className="tou__body markdown"
|
||||||
|
source={body}
|
||||||
|
skipHtml
|
||||||
|
/>
|
||||||
|
<button
|
||||||
|
className="first-time-flow__button"
|
||||||
|
onClick={atBottom && this.acceptTerms}
|
||||||
|
disabled={!atBottom}
|
||||||
|
>
|
||||||
|
Accept
|
||||||
|
</button>
|
||||||
|
<Breadcrumbs total={3} currentIndex={2} />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,21 +1,23 @@
|
|||||||
const { Component } = require('react')
|
const { Component } = require('react')
|
||||||
const PropTypes = require('prop-types')
|
const PropTypes = require('prop-types')
|
||||||
const { connect } = require('react-redux')
|
const { connect } = require('react-redux')
|
||||||
const { Switch, Redirect, withRouter } = require('react-router-dom')
|
const { Route, Switch, Redirect, withRouter } = require('react-router-dom')
|
||||||
const { compose } = require('recompose')
|
const { compose } = require('recompose')
|
||||||
const h = require('react-hyperscript')
|
const h = require('react-hyperscript')
|
||||||
const actions = require('./actions')
|
const actions = require('./actions')
|
||||||
const classnames = require('classnames')
|
const classnames = require('classnames')
|
||||||
const t = require('../i18n')
|
const t = require('../i18n')
|
||||||
|
|
||||||
|
// init
|
||||||
|
const InitializeScreen = require('../../mascara/src/app/first-time').default
|
||||||
|
const WelcomeScreen = require('./welcome-screen').default
|
||||||
|
const NewKeyChainScreen = require('./new-keychain')
|
||||||
// mascara
|
// mascara
|
||||||
const MascaraCreatePassword = require('../../mascara/src/app/first-time/create-password-screen').default
|
const MascaraCreatePassword = require('../../mascara/src/app/first-time/create-password-screen').default
|
||||||
const MascaraBuyEtherScreen = require('../../mascara/src/app/first-time/buy-ether-screen').default
|
const MascaraBuyEtherScreen = require('../../mascara/src/app/first-time/buy-ether-screen').default
|
||||||
const MascaraNoticeScreen = require('../../mascara/src/app/first-time/notice-screen').default
|
const MascaraNoticeScreen = require('../../mascara/src/app/first-time/notice-screen').default
|
||||||
const MascaraSeedScreen = require('../../mascara/src/app/first-time/seed-screen').default
|
const MascaraSeedScreen = require('../../mascara/src/app/first-time/seed-screen').default
|
||||||
const MascaraConfirmSeedScreen = require('../../mascara/src/app/first-time/confirm-seed-screen').default
|
const MascaraConfirmSeedScreen = require('../../mascara/src/app/first-time/confirm-seed-screen').default
|
||||||
// init
|
|
||||||
const NewKeyChainScreen = require('./new-keychain')
|
|
||||||
|
|
||||||
// accounts
|
// accounts
|
||||||
const MainContainer = require('./main-container')
|
const MainContainer = require('./main-container')
|
||||||
@ -28,7 +30,6 @@ const WalletView = require('./components/wallet-view')
|
|||||||
// other views
|
// other views
|
||||||
const Authenticated = require('./components/pages/authenticated')
|
const Authenticated = require('./components/pages/authenticated')
|
||||||
const Initialized = require('./components/pages/initialized')
|
const Initialized = require('./components/pages/initialized')
|
||||||
const MetamaskRoute = require('./components/pages/metamask-route')
|
|
||||||
const Settings = require('./components/pages/settings')
|
const Settings = require('./components/pages/settings')
|
||||||
const UnlockPage = require('./components/pages/unlock')
|
const UnlockPage = require('./components/pages/unlock')
|
||||||
const RestoreVaultPage = require('./components/pages/keychains/restore-vault')
|
const RestoreVaultPage = require('./components/pages/keychains/restore-vault')
|
||||||
@ -65,6 +66,7 @@ const {
|
|||||||
INITIALIZE_ROUTE,
|
INITIALIZE_ROUTE,
|
||||||
NOTICE_ROUTE,
|
NOTICE_ROUTE,
|
||||||
SIGNATURE_REQUEST_ROUTE,
|
SIGNATURE_REQUEST_ROUTE,
|
||||||
|
WELCOME_ROUTE,
|
||||||
} = require('./routes')
|
} = require('./routes')
|
||||||
|
|
||||||
class App extends Component {
|
class App extends Component {
|
||||||
@ -87,11 +89,14 @@ class App extends Component {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
h(Switch, [
|
h(Switch, [
|
||||||
h(MetamaskRoute, {
|
h(Route, {
|
||||||
path: INITIALIZE_ROUTE,
|
path: WELCOME_ROUTE,
|
||||||
exact,
|
exact,
|
||||||
component: InitializeMenuScreen,
|
component: WelcomeScreen,
|
||||||
mascaraComponent: MascaraCreatePassword,
|
}),
|
||||||
|
h(Route, {
|
||||||
|
path: INITIALIZE_ROUTE,
|
||||||
|
component: InitializeScreen,
|
||||||
}),
|
}),
|
||||||
h(Initialized, {
|
h(Initialized, {
|
||||||
path: REVEAL_SEED_ROUTE,
|
path: REVEAL_SEED_ROUTE,
|
||||||
@ -110,8 +115,7 @@ class App extends Component {
|
|||||||
h(Initialized, {
|
h(Initialized, {
|
||||||
path: NOTICE_ROUTE,
|
path: NOTICE_ROUTE,
|
||||||
exact,
|
exact,
|
||||||
component: NoticeScreen,
|
component: MascaraNoticeScreen,
|
||||||
mascaraComponent: MascaraNoticeScreen,
|
|
||||||
}),
|
}),
|
||||||
h(Authenticated, { path: CONFIRM_TRANSACTION_ROUTE, exact, component: ConfirmTxScreen }),
|
h(Authenticated, { path: CONFIRM_TRANSACTION_ROUTE, exact, component: ConfirmTxScreen }),
|
||||||
h(Authenticated, { path: SEND_ROUTE, exact, component: SendTransactionScreen2 }),
|
h(Authenticated, { path: SEND_ROUTE, exact, component: SendTransactionScreen2 }),
|
||||||
@ -465,7 +469,7 @@ class App extends Component {
|
|||||||
|
|
||||||
// // default:
|
// // default:
|
||||||
// // log.debug('rendering menu screen')
|
// // log.debug('rendering menu screen')
|
||||||
// // return h(InitializeMenuScreen, {key: 'menuScreenInit'})
|
// // return h(InitializeScreen, {key: 'menuScreenInit'})
|
||||||
// // }
|
// // }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ const fuse = new Fuse(contractList, {
|
|||||||
})
|
})
|
||||||
const actions = require('../../actions')
|
const actions = require('../../actions')
|
||||||
const ethUtil = require('ethereumjs-util')
|
const ethUtil = require('ethereumjs-util')
|
||||||
const t = require('../i18n')
|
const t = require('../../../i18n')
|
||||||
const { tokenInfoGetter } = require('../../token-util')
|
const { tokenInfoGetter } = require('../../token-util')
|
||||||
const { DEFAULT_ROUTE } = require('../../routes')
|
const { DEFAULT_ROUTE } = require('../../routes')
|
||||||
|
|
||||||
@ -409,7 +409,7 @@ AddTokenScreen.prototype.render = function () {
|
|||||||
|
|
||||||
!isShowingConfirmation && h('div.add-token__buttons', [
|
!isShowingConfirmation && h('div.add-token__buttons', [
|
||||||
h('button.btn-secondary--lg.add-token__cancel-button', {
|
h('button.btn-secondary--lg.add-token__cancel-button', {
|
||||||
onClick: history.goBack(),
|
onClick: () => history.goBack(),
|
||||||
}, t('cancel')),
|
}, t('cancel')),
|
||||||
h('button.btn-primary--lg.add-token__confirm-button', {
|
h('button.btn-primary--lg.add-token__confirm-button', {
|
||||||
onClick: this.onNext,
|
onClick: this.onNext,
|
||||||
|
@ -2,7 +2,7 @@ const inherits = require('util').inherits
|
|||||||
const Component = require('react').Component
|
const Component = require('react').Component
|
||||||
const h = require('react-hyperscript')
|
const h = require('react-hyperscript')
|
||||||
const connect = require('react-redux').connect
|
const connect = require('react-redux').connect
|
||||||
const t = require('../../../i18n')
|
const t = require('../../../../../i18n')
|
||||||
import Select from 'react-select'
|
import Select from 'react-select'
|
||||||
|
|
||||||
// Subviews
|
// Subviews
|
||||||
|
@ -6,7 +6,7 @@ const { compose } = require('recompose')
|
|||||||
const { connect } = require('react-redux')
|
const { connect } = require('react-redux')
|
||||||
const actions = require('../../../../actions')
|
const actions = require('../../../../actions')
|
||||||
const FileInput = require('react-simple-file-input').default
|
const FileInput = require('react-simple-file-input').default
|
||||||
const t = require('../../../i18n')
|
const t = require('../../../../../i18n')
|
||||||
const { DEFAULT_ROUTE } = require('../../../../routes')
|
const { DEFAULT_ROUTE } = require('../../../../routes')
|
||||||
const HELP_LINK = 'https://support.metamask.io/kb/article/7-importing-accounts'
|
const HELP_LINK = 'https://support.metamask.io/kb/article/7-importing-accounts'
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ const { compose } = require('recompose')
|
|||||||
const { connect } = require('react-redux')
|
const { connect } = require('react-redux')
|
||||||
const actions = require('../../../../actions')
|
const actions = require('../../../../actions')
|
||||||
const { DEFAULT_ROUTE } = require('../../../../routes')
|
const { DEFAULT_ROUTE } = require('../../../../routes')
|
||||||
const t = require('../../../i18n')
|
const t = require('../../../../../i18n')
|
||||||
|
|
||||||
module.exports = compose(
|
module.exports = compose(
|
||||||
withRouter,
|
withRouter,
|
||||||
|
@ -2,7 +2,7 @@ const inherits = require('util').inherits
|
|||||||
const Component = require('react').Component
|
const Component = require('react').Component
|
||||||
const h = require('react-hyperscript')
|
const h = require('react-hyperscript')
|
||||||
const connect = require('react-redux').connect
|
const connect = require('react-redux').connect
|
||||||
const t = require('../../../i18n')
|
const t = require('../../../../../i18n')
|
||||||
|
|
||||||
module.exports = connect(mapStateToProps)(SeedImportSubview)
|
module.exports = connect(mapStateToProps)(SeedImportSubview)
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ const h = require('react-hyperscript')
|
|||||||
const { connect } = require('react-redux')
|
const { connect } = require('react-redux')
|
||||||
const actions = require('../../../actions')
|
const actions = require('../../../actions')
|
||||||
const { DEFAULT_ROUTE } = require('../../../routes')
|
const { DEFAULT_ROUTE } = require('../../../routes')
|
||||||
const t = require('../../../i18n')
|
const t = require('../../../../i18n')
|
||||||
|
|
||||||
class NewAccountCreateForm extends Component {
|
class NewAccountCreateForm extends Component {
|
||||||
constructor (props) {
|
constructor (props) {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
const { Component } = require('react')
|
const { Component } = require('react')
|
||||||
const PropTypes = require('prop-types')
|
const PropTypes = require('prop-types')
|
||||||
const h = require('react-hyperscript')
|
const h = require('react-hyperscript')
|
||||||
|
const t = require('../../../../i18n')
|
||||||
|
|
||||||
class Info extends Component {
|
class Info extends Component {
|
||||||
renderLogo () {
|
renderLogo () {
|
||||||
@ -14,13 +15,13 @@ class Info extends Component {
|
|||||||
renderInfoLinks () {
|
renderInfoLinks () {
|
||||||
return (
|
return (
|
||||||
h('div.settings__content-item.settings__content-item--without-height', [
|
h('div.settings__content-item.settings__content-item--without-height', [
|
||||||
h('div.settings__info-link-header', 'Links'),
|
h('div.settings__info-link-header', t('links')),
|
||||||
h('div.settings__info-link-item', [
|
h('div.settings__info-link-item', [
|
||||||
h('a', {
|
h('a', {
|
||||||
href: 'https://metamask.io/privacy.html',
|
href: 'https://metamask.io/privacy.html',
|
||||||
target: '_blank',
|
target: '_blank',
|
||||||
}, [
|
}, [
|
||||||
h('span.settings__info-link', 'Privacy Policy'),
|
h('span.settings__info-link', t('privacyMsg')),
|
||||||
]),
|
]),
|
||||||
]),
|
]),
|
||||||
h('div.settings__info-link-item', [
|
h('div.settings__info-link-item', [
|
||||||
@ -28,7 +29,7 @@ class Info extends Component {
|
|||||||
href: 'https://metamask.io/terms.html',
|
href: 'https://metamask.io/terms.html',
|
||||||
target: '_blank',
|
target: '_blank',
|
||||||
}, [
|
}, [
|
||||||
h('span.settings__info-link', 'Terms of Use'),
|
h('span.settings__info-link', t('terms')),
|
||||||
]),
|
]),
|
||||||
]),
|
]),
|
||||||
h('div.settings__info-link-item', [
|
h('div.settings__info-link-item', [
|
||||||
@ -36,7 +37,7 @@ class Info extends Component {
|
|||||||
href: 'https://metamask.io/attributions.html',
|
href: 'https://metamask.io/attributions.html',
|
||||||
target: '_blank',
|
target: '_blank',
|
||||||
}, [
|
}, [
|
||||||
h('span.settings__info-link', 'Attributions'),
|
h('span.settings__info-link', t('attributions')),
|
||||||
]),
|
]),
|
||||||
]),
|
]),
|
||||||
h('hr.settings__info-separator'),
|
h('hr.settings__info-separator'),
|
||||||
@ -45,7 +46,7 @@ class Info extends Component {
|
|||||||
href: 'https://support.metamask.io',
|
href: 'https://support.metamask.io',
|
||||||
target: '_blank',
|
target: '_blank',
|
||||||
}, [
|
}, [
|
||||||
h('span.settings__info-link', 'Visit our Support Center'),
|
h('span.settings__info-link', t('supportCenter')),
|
||||||
]),
|
]),
|
||||||
]),
|
]),
|
||||||
h('div.settings__info-link-item', [
|
h('div.settings__info-link-item', [
|
||||||
@ -53,7 +54,7 @@ class Info extends Component {
|
|||||||
href: 'https://metamask.io/',
|
href: 'https://metamask.io/',
|
||||||
target: '_blank',
|
target: '_blank',
|
||||||
}, [
|
}, [
|
||||||
h('span.settings__info-link', 'Visit our web site'),
|
h('span.settings__info-link', t('visitWebSite')),
|
||||||
]),
|
]),
|
||||||
]),
|
]),
|
||||||
h('div.settings__info-link-item', [
|
h('div.settings__info-link-item', [
|
||||||
@ -61,7 +62,7 @@ class Info extends Component {
|
|||||||
target: '_blank',
|
target: '_blank',
|
||||||
href: 'mailto:help@metamask.io?subject=Feedback',
|
href: 'mailto:help@metamask.io?subject=Feedback',
|
||||||
}, [
|
}, [
|
||||||
h('span.settings__info-link', 'Email us!'),
|
h('span.settings__info-link', t('emailUs')),
|
||||||
]),
|
]),
|
||||||
]),
|
]),
|
||||||
])
|
])
|
||||||
@ -81,7 +82,7 @@ class Info extends Component {
|
|||||||
h('div.settings__info-item', [
|
h('div.settings__info-item', [
|
||||||
h(
|
h(
|
||||||
'div.settings__info-about',
|
'div.settings__info-about',
|
||||||
'MetaMask is designed and built in California.'
|
t('builtInCalifornia')
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
]),
|
]),
|
||||||
|
@ -12,7 +12,7 @@ const SimpleDropdown = require('../../dropdowns/simple-dropdown')
|
|||||||
const ToggleButton = require('react-toggle-button')
|
const ToggleButton = require('react-toggle-button')
|
||||||
const { REVEAL_SEED_ROUTE } = require('../../../routes')
|
const { REVEAL_SEED_ROUTE } = require('../../../routes')
|
||||||
const { OLD_UI_NETWORK_TYPE } = require('../../../../../app/scripts/config').enums
|
const { OLD_UI_NETWORK_TYPE } = require('../../../../../app/scripts/config').enums
|
||||||
const t = require('../i18n')
|
const t = require('../../../../i18n')
|
||||||
|
|
||||||
const getInfuraCurrencyOptions = () => {
|
const getInfuraCurrencyOptions = () => {
|
||||||
const sortedCurrencies = infuraCurrencies.objects.sort((a, b) => {
|
const sortedCurrencies = infuraCurrencies.objects.sort((a, b) => {
|
||||||
@ -237,6 +237,24 @@ class Settings extends Component {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
renderResetAccount () {
|
||||||
|
const { showResetAccountConfirmationModal } = this.props
|
||||||
|
|
||||||
|
return h('div.settings__content-row', [
|
||||||
|
h('div.settings__content-item', t('resetAccount')),
|
||||||
|
h('div.settings__content-item', [
|
||||||
|
h('div.settings__content-item-col', [
|
||||||
|
h('button.btn-primary--lg.settings__button--orange', {
|
||||||
|
onClick (event) {
|
||||||
|
event.preventDefault()
|
||||||
|
showResetAccountConfirmationModal()
|
||||||
|
},
|
||||||
|
}, t('resetAccount')),
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
])
|
||||||
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { warning, isMascara } = this.props
|
const { warning, isMascara } = this.props
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ const classnames = require('classnames')
|
|||||||
|
|
||||||
const AccountDropdownMini = require('../dropdowns/account-dropdown-mini')
|
const AccountDropdownMini = require('../dropdowns/account-dropdown-mini')
|
||||||
|
|
||||||
const t = require('../../i18n')
|
const t = require('../../../i18n')
|
||||||
const { conversionUtil } = require('../../conversion-util')
|
const { conversionUtil } = require('../../conversion-util')
|
||||||
const { DEFAULT_ROUTE } = require('../../routes')
|
const { DEFAULT_ROUTE } = require('../../routes')
|
||||||
|
|
||||||
|
@ -10,9 +10,12 @@ const NEW_ACCOUNT_ROUTE = '/new-account'
|
|||||||
const IMPORT_ACCOUNT_ROUTE = '/new-account/import'
|
const IMPORT_ACCOUNT_ROUTE = '/new-account/import'
|
||||||
const SEND_ROUTE = '/send'
|
const SEND_ROUTE = '/send'
|
||||||
const CONFIRM_TRANSACTION_ROUTE = '/confirm-transaction'
|
const CONFIRM_TRANSACTION_ROUTE = '/confirm-transaction'
|
||||||
const INITIALIZE_ROUTE = '/initialize'
|
|
||||||
const NOTICE_ROUTE = '/notice'
|
const NOTICE_ROUTE = '/notice'
|
||||||
const SIGNATURE_REQUEST_ROUTE = '/signature-request'
|
const SIGNATURE_REQUEST_ROUTE = '/signature-request'
|
||||||
|
const WELCOME_ROUTE = '/welcome'
|
||||||
|
const INITIALIZE_ROUTE = '/initialize'
|
||||||
|
const INITIALIZE_IMPORT_ACCOUNT_ROUTE = '/initialize/import-account'
|
||||||
|
const INITIALIZE_IMPORT_WITH_SEED_PHRASE_ROUTE = '/initialize/import-with-seed-phrase'
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
DEFAULT_ROUTE,
|
DEFAULT_ROUTE,
|
||||||
@ -27,7 +30,10 @@ module.exports = {
|
|||||||
IMPORT_ACCOUNT_ROUTE,
|
IMPORT_ACCOUNT_ROUTE,
|
||||||
SEND_ROUTE,
|
SEND_ROUTE,
|
||||||
CONFIRM_TRANSACTION_ROUTE,
|
CONFIRM_TRANSACTION_ROUTE,
|
||||||
INITIALIZE_ROUTE,
|
|
||||||
NOTICE_ROUTE,
|
NOTICE_ROUTE,
|
||||||
SIGNATURE_REQUEST_ROUTE,
|
SIGNATURE_REQUEST_ROUTE,
|
||||||
|
WELCOME_ROUTE,
|
||||||
|
INITIALIZE_ROUTE,
|
||||||
|
INITIALIZE_IMPORT_ACCOUNT_ROUTE,
|
||||||
|
INITIALIZE_IMPORT_WITH_SEED_PHRASE_ROUTE,
|
||||||
}
|
}
|
||||||
|
@ -186,7 +186,7 @@ SendTransactionScreen.prototype.componentDidUpdate = function (prevProps) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SendTransactionScreen.prototype.renderHeader = function () {
|
SendTransactionScreen.prototype.renderHeader = function () {
|
||||||
const { selectedToken, clearSend, goHome } = this.props
|
const { selectedToken, clearSend, history } = this.props
|
||||||
|
|
||||||
return h('div.page-container__header', [
|
return h('div.page-container__header', [
|
||||||
|
|
||||||
@ -197,7 +197,7 @@ SendTransactionScreen.prototype.renderHeader = function () {
|
|||||||
h('div.page-container__header-close', {
|
h('div.page-container__header-close', {
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
clearSend()
|
clearSend()
|
||||||
goHome()
|
history.goBack()
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
@ -5,19 +5,22 @@ import PropTypes from 'prop-types'
|
|||||||
import {connect} from 'react-redux'
|
import {connect} from 'react-redux'
|
||||||
import {closeWelcomeScreen} from './actions'
|
import {closeWelcomeScreen} from './actions'
|
||||||
import Mascot from './components/mascot'
|
import Mascot from './components/mascot'
|
||||||
|
import { INITIALIZE_ROUTE } from './routes'
|
||||||
|
|
||||||
class WelcomeScreen extends Component {
|
class WelcomeScreen extends Component {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
closeWelcomeScreen: PropTypes.func.isRequired,
|
closeWelcomeScreen: PropTypes.func.isRequired,
|
||||||
|
history: PropTypes.object,
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(props) {
|
constructor (props) {
|
||||||
super(props)
|
super(props)
|
||||||
this.animationEventEmitter = new EventEmitter()
|
this.animationEventEmitter = new EventEmitter()
|
||||||
}
|
}
|
||||||
|
|
||||||
initiateAccountCreation = () => {
|
initiateAccountCreation = () => {
|
||||||
this.props.closeWelcomeScreen()
|
this.props.closeWelcomeScreen()
|
||||||
|
this.props.history.push(INITIALIZE_ROUTE)
|
||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user