init commit,
This commit is contained in:
45
03_source/mobile_notworking.del/src/pages/MapView.tsx
Normal file
45
03_source/mobile_notworking.del/src/pages/MapView.tsx
Normal file
@@ -0,0 +1,45 @@
|
||||
import { IonButtons, IonContent, IonHeader, IonMenuButton, IonPage, IonTitle, IonToolbar } from '@ionic/react';
|
||||
import React from 'react';
|
||||
import Map from '../components/Map';
|
||||
import { connect } from '../data/connect';
|
||||
import * as selectors from '../data/selectors';
|
||||
import { Location } from '../models/Location';
|
||||
import './MapView.scss';
|
||||
|
||||
interface OwnProps {}
|
||||
|
||||
interface StateProps {
|
||||
locations: Location[];
|
||||
mapCenter: Location;
|
||||
}
|
||||
|
||||
interface DispatchProps {}
|
||||
|
||||
interface MapViewProps extends OwnProps, StateProps, DispatchProps {}
|
||||
|
||||
const MapView: React.FC<MapViewProps> = ({ locations, mapCenter }) => {
|
||||
return (
|
||||
<IonPage id="map-view">
|
||||
<IonHeader>
|
||||
<IonToolbar>
|
||||
<IonButtons slot="start">
|
||||
<IonMenuButton></IonMenuButton>
|
||||
</IonButtons>
|
||||
<IonTitle>Map</IonTitle>
|
||||
</IonToolbar>
|
||||
</IonHeader>
|
||||
|
||||
<IonContent class="map-page">
|
||||
<Map locations={locations} mapCenter={mapCenter} />
|
||||
</IonContent>
|
||||
</IonPage>
|
||||
);
|
||||
};
|
||||
|
||||
export default connect<OwnProps, StateProps, DispatchProps>({
|
||||
mapStateToProps: state => ({
|
||||
locations: state.data.locations,
|
||||
mapCenter: selectors.mapCenter(state),
|
||||
}),
|
||||
component: MapView,
|
||||
});
|
Reference in New Issue
Block a user