providers: complete?

This commit is contained in:
muerwre 2018-11-29 13:36:31 +07:00
parent 552e3effb8
commit b6bd300e1b
14 changed files with 150 additions and 29 deletions

View file

@ -0,0 +1,63 @@
import React from 'react';
import { Icon } from '$components/panels/Icon';
type Props = {
routerCancel: Function,
routerSubmit: Function,
routerPoints: Number,
}
const noPoints = ({ routerCancel }: Props) => (
<div className="helper router-helper">
<div className="helper__text">
<Icon icon="icon-pin-1" />
<div className="big white upper">
Укажите первую точку на карте
</div>
</div>
<div className="helper__buttons">
<div className="button router-helper__button" onClick={routerCancel}>
Отмена
</div>
</div>
</div>
);
const firstPoint = ({ routerCancel }: Props) => (
<div className="helper router-helper">
<div className="helper__text">
<Icon icon="icon-pin-1" />
<div className="big white upper">УКАЖИТЕ СЛЕДУЮЩУЮ ТОЧКУ</div>
</div>
<div className="helper__buttons">
<div className="button router-helper__button" onClick={routerCancel}>
Отмена
</div>
</div>
</div>
);
const draggablePoints = ({ routerCancel, routerSubmit }: Props) => (
<div className="helper router-helper">
<div className="helper__text success">
<Icon icon="icon-check-1" />
<div className="big upper">Продолжайте маршрут</div>
</div>
<div className="helper__buttons button-group">
<div className="button button_red router-helper__button" onClick={routerCancel}>
Отмена
</div>
<div className="button primary router-helper__button" onClick={routerSubmit}>
Применить
</div>
</div>
</div>
);
export const RouterDialog = ({ routerPoints, routerCancel, routerSubmit }: Props) => (
<div>
{!routerPoints && noPoints({ routerCancel })}
{routerPoints === 1 && firstPoint({ routerCancel })}
{routerPoints >= 2 && draggablePoints({ routerCancel, routerSubmit })}
</div>
);