mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-26 03:26:41 +07:00
map_list: initial
urls: editing now handled through urls
This commit is contained in:
parent
3771e5d338
commit
0d9bad9095
23 changed files with 386 additions and 68 deletions
38
src/components/maps/RouteRow.jsx
Normal file
38
src/components/maps/RouteRow.jsx
Normal file
|
@ -0,0 +1,38 @@
|
|||
// @flow
|
||||
import React from 'react';
|
||||
import { Icon } from '$components/panels/Icon';
|
||||
import { pushPath } from '$utils/history';
|
||||
|
||||
type Props = {
|
||||
title: String,
|
||||
distance: Number,
|
||||
created_at: String,
|
||||
_id: String,
|
||||
editing: Boolean,
|
||||
};
|
||||
|
||||
export const RouteRow = ({
|
||||
title, distance, created_at, _id, editing
|
||||
}: Props) => (
|
||||
<div
|
||||
className="route-row"
|
||||
onClick={() => pushPath(`/${_id}/${editing ? 'edit' : ''}`)}
|
||||
>
|
||||
<div className="route-title">
|
||||
{title || _id}
|
||||
</div>
|
||||
<div className="route-description">
|
||||
<span>
|
||||
<Icon icon="icon-link-1" />
|
||||
{_id}
|
||||
</span>
|
||||
</div>
|
||||
<div className="route-description">
|
||||
<span>
|
||||
<Icon icon="icon-cycle-1" />
|
||||
{(distance && `${distance} km`) || 'N/A'}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue