diff --git a/packages/blockchain-wallet-v4-frontend/src/data/modules/profile/sagas.js b/packages/blockchain-wallet-v4-frontend/src/data/modules/profile/sagas.js index 940f238cb73..5cfb1df18a0 100644 --- a/packages/blockchain-wallet-v4-frontend/src/data/modules/profile/sagas.js +++ b/packages/blockchain-wallet-v4-frontend/src/data/modules/profile/sagas.js @@ -51,9 +51,9 @@ export default ({ api, coreSagas, networks }) => { } } if (campaign.name === 'BLOCKSTACK') { - let password = yield call(promptForSecondPassword) + let password = yield call(promptForSecondPassword, ['BLOCKSTACK']) yield put(actions.core.data.stx.generateAddress(password)) - const { payload } = yield take(actions.core.data.stx.setAddress) + const { payload } = yield take(actionTypes.core.data.stx.SET_ADDRESS) const { address } = payload return { 'x-campaign-address': address diff --git a/packages/blockchain-wallet-v4-frontend/src/modals/Settings/SecondPassword/template.js b/packages/blockchain-wallet-v4-frontend/src/modals/Settings/SecondPassword/template.js index ecd9ac19e76..2675d886e2a 100644 --- a/packages/blockchain-wallet-v4-frontend/src/modals/Settings/SecondPassword/template.js +++ b/packages/blockchain-wallet-v4-frontend/src/modals/Settings/SecondPassword/template.js @@ -2,6 +2,7 @@ import React from 'react' import PropTypes from 'prop-types' import { reduxForm } from 'redux-form' import { FormattedMessage } from 'react-intl' +import styled from 'styled-components' import { Button, @@ -13,28 +14,55 @@ import { PasswordInput, Text } from 'blockchain-info-components' -import { Form } from 'components/Form' +import { Form, FormLabel } from 'components/Form' + +const SecPasswordHeader = styled(ModalHeader)` + border-bottom: 0; + padding-bottom: 12px; +` + +const PurposeContainer = styled.div` + padding: 6px 30px 0px 30px; +` + +const PURPOSES = { + BLOCKSTACK: ( + + + + ) +} const SecondPassword = props => { const { position, total, close, ...rest } = props - const { handleSubmit, handleChange, value } = rest + const { handleSubmit, handleChange, purposes = [], value } = rest return (
- - - - - + + + + {purposes && purposes.length ? ( + + {purposes.map(purpose => PURPOSES[purpose])} + + ) : null} + + + + return yield call(coreSaga, enhancedArgs) } -export const promptForSecondPassword = function * () { +export const promptForSecondPassword = function * (purposes) { const wallet = yield select(selectors.core.wallet.getWallet) if (Types.Wallet.isDoubleEncrypted(wallet)) { - yield put(actions.modals.showModal('SecondPassword')) + yield put(actions.modals.showModal('SecondPassword', { purposes })) let { response, canceled } = yield race({ response: take(actionTypes.wallet.SUBMIT_SECOND_PASSWORD), canceled: take(actionTypes.modals.CLOSE_MODAL)