Skip to content

Commit

Permalink
basic locationSearch foeld
Browse files Browse the repository at this point in the history
  • Loading branch information
BenGamma committed Jun 24, 2019
1 parent cef3d7b commit 2b7272c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/pages/Profile/content/ProfileEdit.form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import COM_TYPE_MOCK from 'src/mocks/communicationSelector.mock'
import { Map, TileLayer, Marker, Popup, ZoomControl } from 'react-leaflet'
import L from 'leaflet'
import 'leaflet/dist/leaflet.css'
import { LocationSearchField } from 'src/components/Form/LocationSearch.field'

interface IFormValues extends Partial<IUser> {
// form values are simply subset of user profile fields
Expand Down Expand Up @@ -90,6 +91,10 @@ export class ProfileEditForm extends React.Component<IProps, IState> {
console.log('month change')
}

public onLocationChange() {
console.log('location changed')
}

public getCountryCode(countryName: string | undefined) {
return Object.keys(countries).find(key => countries[key] === countryName)
}
Expand Down Expand Up @@ -195,12 +200,19 @@ export class ProfileEditForm extends React.Component<IProps, IState> {
component={TextAreaField}
placeholder="About"
/>
<Field
name="location"
validateFields={[]}
onChange={this.onLocationChange()}
component={LocationSearchField}
/>
<Map
center={[lat, lng]}
zoom={zoom}
zoomControl={false}
style={{
height: '300px',
zIndex: 1,
}}
>
<ZoomControl position="topright" />
Expand Down

0 comments on commit 2b7272c

Please sign in to comment.