From 09ff9ca8293e62b3fa1f5f7da2f8721685ac5b96 Mon Sep 17 00:00:00 2001 From: evlist Date: Tue, 3 Jan 2023 15:02:21 +0100 Subject: [PATCH] RteViewer --- src/components/gpx/GpxViewer.tsx | 4 ++++ src/components/rte/RteViewer.tsx | 31 ++++++++++++++++++++++++++ src/components/rte/index.tsx | 2 ++ src/components/wpt/WptViewer.tsx | 2 +- src/icons/directions-svgrepo-com.svg | 8 +++++++ src/icons/location-pin-svgrepo-com.svg | 2 +- 6 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 src/components/rte/RteViewer.tsx create mode 100644 src/icons/directions-svgrepo-com.svg diff --git a/src/components/gpx/GpxViewer.tsx b/src/components/gpx/GpxViewer.tsx index 4e3fb88..fdd71d8 100644 --- a/src/components/gpx/GpxViewer.tsx +++ b/src/components/gpx/GpxViewer.tsx @@ -1,5 +1,6 @@ import { Component, For } from 'solid-js'; import { peekCachedSignal } from '../../workers/cached-signals'; +import { RteViewer } from '../rte'; import Tree from '../tree'; import { WptViewer } from '../wpt'; import GpxIcon from './GpxIcon'; @@ -34,6 +35,9 @@ const GpxViewer: Component = ({ gpxId, restrictToHierarchy }) => { if (child.type === 'wpt') { return ; } + if (child.type === 'rte') { + return ; + } return <>; }} diff --git a/src/components/rte/RteViewer.tsx b/src/components/rte/RteViewer.tsx new file mode 100644 index 0000000..f708d5d --- /dev/null +++ b/src/components/rte/RteViewer.tsx @@ -0,0 +1,31 @@ +import { Component } from 'solid-js'; +import { peekCachedSignal } from '../../workers/cached-signals'; +import RteIcon from '../../icons/directions-svgrepo-com.svg?component-solid'; + +import Tree from '../tree'; + +interface Props { + rteId: string; +} + +const RteViewer: Component = ({ rteId }) => { + const rte = peekCachedSignal({ id: rteId, method: 'getRte' }); + console.log({ caller: 'RteViewer', rteId, rte: rte() }); + const title = () => { + return rte().name; + }; + + return ( + + {title()} + + } + content={undefined} + subTree={undefined} + /> + ); +}; + +export default RteViewer; diff --git a/src/components/rte/index.tsx b/src/components/rte/index.tsx index 6928516..56be957 100644 --- a/src/components/rte/index.tsx +++ b/src/components/rte/index.tsx @@ -1 +1,3 @@ export { default } from './Rte'; + +export { default as RteViewer } from './RteViewer'; diff --git a/src/components/wpt/WptViewer.tsx b/src/components/wpt/WptViewer.tsx index 34e7154..f8a8155 100644 --- a/src/components/wpt/WptViewer.tsx +++ b/src/components/wpt/WptViewer.tsx @@ -18,7 +18,7 @@ const WptViewer: Component = ({ wptId }) => { - {title()} + {title()} } content={undefined} diff --git a/src/icons/directions-svgrepo-com.svg b/src/icons/directions-svgrepo-com.svg new file mode 100644 index 0000000..b553c67 --- /dev/null +++ b/src/icons/directions-svgrepo-com.svg @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/src/icons/location-pin-svgrepo-com.svg b/src/icons/location-pin-svgrepo-com.svg index 1341b55..192973a 100644 --- a/src/icons/location-pin-svgrepo-com.svg +++ b/src/icons/location-pin-svgrepo-com.svg @@ -1,6 +1,6 @@ + width="297" height="297">