NoPrivacyModal.js
2.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
import React, { Component } from 'react'
import ReactModal from 'react-modal';
import * as SelectActionCreators from '../actions/profilationSelect'
import { connect } from 'react-redux';
import wayoutIcon from '../../img/wayOut.svg'
/*
<div className="Modal Modal-mask modal_repower Modal--save isOpen">
<div className="Modal-wrapper">
<div className="Modal-container" >
*/
class WayoutModal extends Component {
redirect(){
window.location.href='http://www.repower.com'
}
render(){
console.log('modalprops',this.props)
return(
<ReactModal
isOpen={true}
onRequestClose={() => this.props.hideModal()}
portalClassName='modal modal-mask modal_repower quit-modal isOpen'
overlayClassName='modal-wrapper'
className='modal-container'
>
<div className="close_modal" onClick={() => this.props.hideModal()}><img src="https://d33wubrfki0l68.cloudfront.net/c0553300c767c895ee4900759828af6476c3e9e9/55953/img/closed_modal.svg" alt="" /></div>
<div className=" modal-header">
<img src={wayoutIcon} alt="" />
<h3> Sei sicuro di voler uscire e abbandonare l'attivazione?</h3>
</div>
<div className="modal-body">
<p>
E’ necessario accettare la nostra normativa sulla privacy per procedere con l’attivazione.
</p>
<div className='modal-flex'>
<a className='button-link' onClick={()=>this.redirect()} ><button onClick={() => this.props.updateStoreValue('modalOpen','')} className="btn__outline">
Abbandona attivazione
</button></a>
<a className='button-link'><button className="btn__red" onClick={() => this.props.hideModal()}>
Prosegui
</button></a>
</div>
</div>
</ReactModal>
)
}
}
const mapStateToProps = state => {
return {
steps:state.ProfilationSelectReducer.steps,
solutions:state.ProfilationSelectReducer.solutions,
modalOpen:state.ProfilationSelectReducer.modalOpen,
activationCode:state.ProfilationSelectReducer.activationCode,
}};
const mapDispatchToProps = dispatch => ({
updatePropValue: (prop,value,index,complete) =>
dispatch(SelectActionCreators.changeValue(prop,value,index,complete)),
updateStoreValue: (prop,value) =>
dispatch(SelectActionCreators.changeProp(prop,value)),
hideModal: () =>
dispatch(SelectActionCreators.hideModal()),
});
export default connect(mapStateToProps, mapDispatchToProps)(WayoutModal);