SectionList on home screen with API
This commit is contained in:
@@ -76,6 +76,12 @@ export class WorkItem extends React.Component {
|
||||
this.state = {
|
||||
binder: new FormBinder({}, WorkItem.bindings),
|
||||
messageModal: null,
|
||||
region: {
|
||||
latitude: 43.653908,
|
||||
longitude: -79.384293,
|
||||
latitudeDelta: 0.0922,
|
||||
longitudeDelta: 0.0421,
|
||||
},
|
||||
}
|
||||
|
||||
const { search } = this.props.location
|
||||
@@ -92,6 +98,12 @@ export class WorkItem extends React.Component {
|
||||
workItem.location = formatLatLng(lat, lng)
|
||||
this.setState({
|
||||
binder: new FormBinder(workItem, WorkItem.bindings),
|
||||
region: {
|
||||
latitude: lat,
|
||||
longitude: lng,
|
||||
latitudeDelta: 0.01,
|
||||
longitudeDelta: 0.01,
|
||||
},
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -179,7 +191,7 @@ export class WorkItem extends React.Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
const { binder, messageModal } = this.state
|
||||
const { binder, messageModal, region } = this.state
|
||||
|
||||
return (
|
||||
<View style={{ flex: 1 }}>
|
||||
@@ -223,12 +235,7 @@ export class WorkItem extends React.Component {
|
||||
showsTraffic={false}
|
||||
showsIndoors={false}
|
||||
zoomControlEnabled
|
||||
initialRegion={{
|
||||
latitude: 43.653908,
|
||||
longitude: -79.384293,
|
||||
latitudeDelta: 0.0922,
|
||||
longitudeDelta: 0.0421,
|
||||
}}
|
||||
region={region}
|
||||
onRegionChange={this.handleRegionChange}
|
||||
/>
|
||||
<Icon
|
||||
|
||||
Reference in New Issue
Block a user