Skip to content

Commit e17f1c9

Browse files
committed
Adjust map transition timing when switching tasks.
1 parent 0eb72a2 commit e17f1c9

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/components/HOCs/WithMapBounds/WithMapBounds.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ const mapDispatchToProps = dispatch => {
8686
}
8787
},
8888

89-
setTaskMapBounds: (bounds, zoom, fromUserAction=false) => {
89+
setTaskMapBounds: (task, bounds, zoom, fromUserAction=false) => {
9090
dispatch(setTaskMapBounds(bounds, zoom, fromUserAction))
9191
},
9292
}

src/components/TaskPane/TaskMap/TaskMap.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ export default class TaskMap extends Component {
4747
return false
4848
}
4949

50+
updateTaskBounds = (bounds, zoom) => {
51+
this.props.setTaskMapBounds(this.props.task, bounds, zoom, false)
52+
}
53+
5054
render() {
5155
if (!this.props.task || !_isObject(this.props.task.parent)) {
5256
return null
@@ -67,7 +71,7 @@ export default class TaskMap extends Component {
6771
center={this.props.centerPoint} zoom={zoom} zoomControl={false}
6872
minZoom={minZoom} maxZoom={maxZoom}
6973
features={_get(this.props.task, 'geometries.features')}
70-
onBoundsChange={this.props.setTaskMapBounds}
74+
onBoundsChange={this.updateTaskBounds}
7175
>
7276
<ZoomControl position='topright' />
7377
<VisibleTileLayer maxZoom={maxZoom} />

src/components/TaskPane/TaskPane.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export default class TaskPane extends Component {
6565
<MapPane>
6666
<TransitionGroup>
6767
{this.state.completingTask !== this.props.task.id &&
68-
<CSSTransition key={this.props.task.id} timeout={1500}
68+
<CSSTransition key={this.props.task.id} timeout={{enter: 1500, exit: 500}}
6969
classNames="animate-slide">
7070
<DetailMap task={this.props.task} {...this.props} />
7171
</CSSTransition>

0 commit comments

Comments
 (0)