RteViewer
This commit is contained in:
1 parent
62b2b5552a
commit
09ff9ca829
6 files changed
+47
-2
No files matched your search
@@ -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<Props> = ({ gpxId, restrictToHierarchy }) => {
|
||||
if (child.type === 'wpt') {
|
||||
return <WptViewer wptId={key} />;
|
||||
}
|
||||
if (child.type === 'rte') {
|
||||
return <RteViewer rteId={key} />;
|
||||
}
|
||||
return <></>;
|
||||
}}
|
||||
</For>
|
||||
|
||||
@@ -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<Props> = ({ rteId }) => {
|
||||
const rte = peekCachedSignal({ id: rteId, method: 'getRte' });
|
||||
console.log({ caller: 'RteViewer', rteId, rte: rte() });
|
||||
const title = () => {
|
||||
return rte().name;
|
||||
};
|
||||
|
||||
return (
|
||||
<Tree
|
||||
title={
|
||||
<>
|
||||
<RteIcon fill='black' width='32' height='32' /> {title()}
|
||||
</>
|
||||
}
|
||||
content={undefined}
|
||||
subTree={undefined}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default RteViewer;
|
||||
@@ -1 +1,3 @@
|
||||
export { default } from './Rte';
|
||||
|
||||
export { default as RteViewer } from './RteViewer';
|
||||
@@ -18,7 +18,7 @@ const WptViewer: Component<Props> = ({ wptId }) => {
|
||||
<Tree
|
||||
title={
|
||||
<>
|
||||
<WptIcon /> {title()}
|
||||
<WptIcon fill='black' width="30" height="30" viewBox="0 0 300 300" /> {title()}
|
||||
</>
|
||||
}
|
||||
content={undefined}
|
||||
|
||||
Reference in new issue
Block a user