added gpx dialog

This commit is contained in:
Fedor Katurov 2020-01-24 16:53:47 +07:00
parent 947ec69e60
commit e995b46641
33 changed files with 11687 additions and 131 deletions

View file

@ -0,0 +1,34 @@
import React, { FC } from 'react';
import { IGpxRoute } from '~/redux/editor';
import { Switch } from '../Switch';
import { Icon } from '../panels/Icon';
import classnames from 'classnames';
interface IProps {
item: IGpxRoute;
index: number
enabled: boolean;
onFocusRoute: (i: number) => void
onRouteDrop: (i: number) => void
onRouteToggle: (i: number) => void
}
const GpxDialogRow: FC<IProps> = ({ item, index, enabled, onRouteToggle, onFocusRoute, onRouteDrop }) => {
return (
<div className={classnames("gpx-row", { 'gpx-row_disabled': !enabled || !item.enabled })}>
<div className="gpx-row__color" style={{ backgroundColor: item.color }}/>
<div className="gpx-row__title" onClick={() => onFocusRoute(index)}>
{item.name}
</div>
<div className="gpx-row__buttons">
<div onClick={() => onRouteDrop(index)}><Icon icon="icon-trash-6" size={24} /></div>
<div><Switch active={item.enabled} onPress={() => onRouteToggle(index)}/></div>
</div>
</div>
);
};
export { GpxDialogRow };