Skip to content

Commit e67dfb4

Browse files
committed
Merge branch 'dev' into rydang/jest-timejump
2 parents bffd77e + 76ef00f commit e67dfb4

File tree

4 files changed

+35
-6
lines changed

4 files changed

+35
-6
lines changed

extension/app/components/Slider.jsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ import 'rc-tooltip/assets/bootstrap.css';
77

88
const Handle = Slider.Handle;
99

10+
1011
const handle = (props) => {
1112
const { value, dragging, index, ...restProps } = props;
13+
1214
return (
1315
<Tooltip
1416
prefixCls="rc-slider-tooltip"
@@ -26,9 +28,22 @@ class mainSlider extends Component {
2628
constructor(props){
2729
super(props)
2830
}
31+
32+
2933
render(){
3034
return(
31-
<Slider min={0} max={20} defaultValue={3} handle={handle} />
35+
<div>
36+
<Slider
37+
min={0}
38+
max={this.props.snapshotLength-1}
39+
value = {this.props.snapshotIndex}
40+
onChange={(index) => {
41+
this.props.handleChangeSnapshot(index)
42+
}}
43+
handle={handle}
44+
>
45+
</Slider>
46+
</div>
3247
)
3348
}
3449
}

extension/app/containers/MainContainer.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class MainContainer extends Component {
88
constructor() {
99
super();
1010
this.state = {
11-
snapshots: [{ state: 'snapshot1' }, { state: 'snapshot2' }, { state: 'snapshot3' }],
11+
snapshots: [{ state: 'snapshot1' , state2: 'othercomp snapshot1'}, { state: 'snapshot2' }, { state: 'snapshot3' }],
1212
snapshotIndex: 0,
1313
};
1414

@@ -51,7 +51,11 @@ class MainContainer extends Component {
5151
/>
5252
<StateContainer snapshot={snapshots[snapshotIndex]} />
5353
</div>
54-
<TravelContainer />
54+
<TravelContainer
55+
snapshotsLength = {snapshots.length}
56+
handleChangeSnapshot = {this.handleChangeSnapshot}
57+
snapshotIndex = {snapshotIndex}
58+
/>
5559
</div>
5660
);
5761
}

extension/app/containers/TravelContainer.jsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,21 @@ import Slider from '../components/Slider'
55

66

77
class TravelContainer extends Component {
8-
constructor() {
9-
super();
8+
constructor(props) {
9+
super(props);
1010
}
1111

1212
render() {
1313
return (
1414
<div>
1515
<div className="travel-container">TravelContainer</div>
16-
<Slider/>
16+
<Slider
17+
className="travel-slider"
18+
snapshotLength = {this.props.snapshotsLength}
19+
handleChangeSnapshot = {this.props.handleChangeSnapshot}
20+
snapshotIndex = {this.props.snapshotIndex}
21+
/>
22+
{`snapshot inex in slider ${this.props.snapshotIndex}`}
1723
</div>
1824
)
1925

extension/app/styles/styles.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@
4040
height: 10%;
4141
}
4242

43+
.travel-slider {
44+
width: 50%;
45+
}
46+
4347
.head-container,
4448
.body-container,
4549
.action-container,

0 commit comments

Comments
 (0)