ProfilationStep.js
2.4 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import React, {Component} from 'react';
import PropTypes from 'prop-types'
import ProfilationStep1 from './step1/ProfilationStep1'
import ProfilationStep2 from './step2/ProfilationStep2'
import ProfilationStep2Mobile from './step2/ProfilationStep2Mobile'
import ProfilationStep3 from './step3/ProfilationStep3'
import ProfilationStep4 from './step4/ProfilationStep4'
import ProfilationStep5 from './step5/ProfilationStep5'
class ProfilationStep extends Component{
constructor(props){
super(props)
this.state={
tabIndex:1
}
}
render(){
const props=this.props
return(
<div className='ProfilationStep__container' style={{opacity: props.isActive ? 1 : 0.5, cursor: props.isActive ? 'auto' : 'pointer' }} id={'step'+props.index}>
{props.index===0 &&
<ProfilationStep1
isActive={props.isActive}
step={props.step}
index={props.index}
updatePropValue={props.updatePropValue}
activeStep={props.activeStep}
/>
}
{(props.index===1 && window.screen.width < 768) &&
<ProfilationStep2Mobile
isActive={props.isActive}
step={props.step}
index={props.index}
updatePropValue={props.updatePropValue}
completeSteps={props.completeSteps}
activeStep={props.activeStep}
/>
}
{(props.index===1 && window.screen.width >= 768) &&
<ProfilationStep2
isActive={props.isActive}
step={props.step}
index={props.index}
updatePropValue={props.updatePropValue}
completeSteps={props.completeSteps}
activeStep={props.activeStep}
/>
}
{props.index===2 &&
<ProfilationStep3
isActive={props.isActive}
step={props.step}
index={props.index}
updatePropValue={props.updatePropValue}
activeStep={props.activeStep}
/>
}
{props.index===3 &&
<ProfilationStep4
isActive={props.isActive}
step={props.step}
index={props.index}
updatePropValue={props.updatePropValue}
activeStep={props.activeStep}
/>
}
{props.index===4 &&
<ProfilationStep5
isActive={props.isActive}
step={props.step}
index={props.index}
updatePropValue={props.updatePropValue}
activeStep={props.activeStep}
/>
}
</div>)
}
}
ProfilationStep.propTypes = {
index: PropTypes.number.isRequired,
step:PropTypes.object.isRequired,
updatePropValue: PropTypes.func.isRequired,
activeStep: PropTypes.func.isRequired,
completeSteps: PropTypes.object.isRequired
}
export default ProfilationStep