mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 11:06:40 +07:00
added gpx dialog
This commit is contained in:
parent
947ec69e60
commit
e995b46641
33 changed files with 11687 additions and 131 deletions
34
src/components/gpx/GpxDialogRow.tsx
Normal file
34
src/components/gpx/GpxDialogRow.tsx
Normal 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 };
|
Loading…
Add table
Add a link
Reference in a new issue