mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 11:06:40 +07:00
redux: fixed estimated
This commit is contained in:
parent
185fe80fc5
commit
5d2c534aa9
6 changed files with 30 additions and 38 deletions
|
@ -1,7 +1,8 @@
|
|||
import React from 'react';
|
||||
import L, { marker } from 'leaflet';
|
||||
import { marker } from 'leaflet';
|
||||
import { DomMarker } from '$utils/DomMarker';
|
||||
import { Icon } from '$components/panels/Icon';
|
||||
import { editor } from '$modules/Editor';
|
||||
|
||||
export class UserLocation extends React.Component {
|
||||
constructor(props) {
|
||||
|
@ -15,7 +16,7 @@ export class UserLocation extends React.Component {
|
|||
});
|
||||
|
||||
this.mark = null;
|
||||
this.map = props.editor.map.map;
|
||||
this.map = editor.map.map;
|
||||
this.location = [];
|
||||
}
|
||||
|
||||
|
@ -24,6 +25,7 @@ export class UserLocation extends React.Component {
|
|||
}
|
||||
|
||||
getUserLocation = callback => {
|
||||
// todo: TO SAGAS
|
||||
if (!window.navigator || !window.navigator.geolocation) return;
|
||||
|
||||
window.navigator.geolocation.getCurrentPosition(position => {
|
||||
|
|
|
@ -24,7 +24,7 @@ type Props = {
|
|||
logo: String,
|
||||
routerPoints: Number,
|
||||
activeSticker: String,
|
||||
estimateTime: Number, // todo: implement!
|
||||
estimated: Number, // todo: implement!
|
||||
|
||||
setMode: Function,
|
||||
startEditing: Function,
|
||||
|
@ -61,7 +61,7 @@ class Component extends React.PureComponent<Props, void> {
|
|||
|
||||
render() {
|
||||
const {
|
||||
mode, routerPoints, distance, estimateTime, activeSticker, logo, user, editing, title, address, changed,
|
||||
mode, routerPoints, distance, estimated, activeSticker, logo, user, editing, title, address, changed,
|
||||
} = this.props;
|
||||
|
||||
return (
|
||||
|
@ -87,8 +87,8 @@ class Component extends React.PureComponent<Props, void> {
|
|||
<Icon icon="icon-cycle" size={32} />
|
||||
{
|
||||
<span>{
|
||||
// toHours(estimateTime)
|
||||
}HOURS HERE</span>
|
||||
toHours(estimated)
|
||||
}</span>
|
||||
}
|
||||
</div>
|
||||
|
||||
|
@ -184,7 +184,7 @@ function mapStateToProps(state) {
|
|||
mode,
|
||||
routerPoints,
|
||||
distance,
|
||||
estimateTime,
|
||||
estimated,
|
||||
activeSticker,
|
||||
logo,
|
||||
title,
|
||||
|
@ -199,7 +199,7 @@ function mapStateToProps(state) {
|
|||
mode,
|
||||
routerPoints,
|
||||
distance,
|
||||
estimateTime,
|
||||
estimated,
|
||||
activeSticker,
|
||||
logo,
|
||||
title,
|
||||
|
|
|
@ -91,18 +91,7 @@ export class Component extends React.PureComponent<Props, void> {
|
|||
}
|
||||
|
||||
|
||||
function mapStateToProps(state) {
|
||||
const { user: { user } } = state;
|
||||
const mapStateToProps = ({ user: { user } }) => ({ user });
|
||||
const mapDispatchToProps = dispatch => bindActionCreators({ setUser, userLogout }, dispatch);
|
||||
|
||||
return { user };
|
||||
}
|
||||
|
||||
const mapDispatchToProps = dispatch => bindActionCreators({
|
||||
setUser,
|
||||
userLogout,
|
||||
}, dispatch);
|
||||
|
||||
export const UserPanel = connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(Component);
|
||||
export const UserPanel = connect(mapStateToProps, mapDispatchToProps)(Component);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue