parent
c52ba96b85
commit
f3a7054f6b
@ -1 +0,0 @@ |
||||
export { default } from './welcome-beta.container' |
@ -1,30 +0,0 @@ |
||||
import React from 'react' |
||||
import PropTypes from 'prop-types' |
||||
import Modal, { ModalContent } from '../../modal' |
||||
|
||||
const TransactionConfirmed = (props, context) => { |
||||
const { t } = context |
||||
const { hideModal } = props |
||||
|
||||
return ( |
||||
<Modal |
||||
onSubmit={() => hideModal()} |
||||
submitText={t('ok')} |
||||
> |
||||
<ModalContent |
||||
title={t('uiWelcome')} |
||||
description={t('uiWelcomeMessage')} |
||||
/> |
||||
</Modal> |
||||
) |
||||
} |
||||
|
||||
TransactionConfirmed.contextTypes = { |
||||
t: PropTypes.func, |
||||
} |
||||
|
||||
TransactionConfirmed.propTypes = { |
||||
hideModal: PropTypes.func, |
||||
} |
||||
|
||||
export default TransactionConfirmed |
@ -1,4 +0,0 @@ |
||||
import WelcomeBeta from './welcome-beta.component' |
||||
import withModalProps from '../../../higher-order-components/with-modal-props' |
||||
|
||||
export default withModalProps(WelcomeBeta) |
@ -0,0 +1 @@ |
||||
export {default} from './ui-migration-announcement.container' |
@ -0,0 +1,22 @@ |
||||
.ui-migration-announcement { |
||||
position: absolute; |
||||
z-index: 9999; |
||||
width: 100vw; |
||||
height: 100vh; |
||||
display: flex; |
||||
flex-direction: column; |
||||
align-items: center; |
||||
background: $white; |
||||
|
||||
p { |
||||
box-sizing: border-box; |
||||
padding: 1em; |
||||
font-size: 12pt; |
||||
} |
||||
|
||||
p:last-of-type { |
||||
cursor: pointer; |
||||
text-decoration: underline; |
||||
font-weight: bold; |
||||
} |
||||
} |
@ -0,0 +1,33 @@ |
||||
import PropTypes from 'prop-types' |
||||
import React, {PureComponent} from 'react' |
||||
|
||||
export default class UiMigrationAnnouncement extends PureComponent { |
||||
static contextTypes = { |
||||
t: PropTypes.func.isRequired, |
||||
} |
||||
|
||||
static defaultProps = { |
||||
shouldShowAnnouncement: true, |
||||
}; |
||||
|
||||
static propTypes = { |
||||
onClose: PropTypes.func.isRequired, |
||||
shouldShowAnnouncement: PropTypes.bool, |
||||
} |
||||
|
||||
render () { |
||||
const { t } = this.context |
||||
const { onClose, shouldShowAnnouncement } = this.props |
||||
|
||||
if (!shouldShowAnnouncement) { |
||||
return null |
||||
} |
||||
|
||||
return ( |
||||
<div className="ui-migration-announcement"> |
||||
<p>{t('uiMigrationAnnouncement')}</p> |
||||
<p onClick={onClose}>{t('close')}</p> |
||||
</div> |
||||
) |
||||
} |
||||
} |
@ -0,0 +1,21 @@ |
||||
import { connect } from 'react-redux' |
||||
import UiMigrationAnnouncement from './ui-migration-annoucement.component' |
||||
import { setCompletedUiMigration } from '../../actions' |
||||
|
||||
const mapStateToProps = (state) => { |
||||
const shouldShowAnnouncement = !state.metamask.completedUiMigration |
||||
|
||||
return { |
||||
shouldShowAnnouncement, |
||||
} |
||||
} |
||||
|
||||
const mapDispatchToProps = dispatch => { |
||||
return { |
||||
onClose () { |
||||
dispatch(setCompletedUiMigration()) |
||||
}, |
||||
} |
||||
} |
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(UiMigrationAnnouncement) |
Loading…
Reference in new issue