Adding a GPX icon

This commit is contained in:
Eric van der Vlist 2023-01-03 12:07:23 +01:00
parent d9c4837f82
commit 6b0b394d33
6 changed files with 59 additions and 31 deletions

View File

@ -5,6 +5,7 @@ import { Component, createSignal, Show } from 'solid-js';
import dispatch from '../../workers/dispatcher-main'; import dispatch from '../../workers/dispatcher-main';
import Dialog from '../dialog'; import Dialog from '../dialog';
import GpxChooser from '../gpx-chooser'; import GpxChooser from '../gpx-chooser';
import GpxIcon from '../gpx/GpxIcon';
//import GpxesIcon from '../../icons/adventure-journey-location-svgrepo-com.svg'; //import GpxesIcon from '../../icons/adventure-journey-location-svgrepo-com.svg';
import style from './GpxDialog.module.css'; import style from './GpxDialog.module.css';
@ -119,29 +120,7 @@ const GpxDialog: Component<{}> = (props) => {
<> <>
<div class={style.control}> <div class={style.control}>
<IconButton onClick={handleClickOpen}> <IconButton onClick={handleClickOpen}>
<SvgIcon> <GpxIcon />
<svg
viewBox='0 0 170 170'
width='64px'
height='64px'
version='1.1'
style='stroke-width: 1%; stroke:black'
xml:space='preserve'
xmlns='http://www.w3.org/2000/svg'
xmlns:xlink='http://www.w3.org/1999/xlink'
>
<g>
<path d='M63.5,16c-0.3-0.2-0.7-0.3-1-0.1l-20.4,7.3l-14.3-5.2c0.8-2,1.2-3.8,1.2-5.3c0-2.7-1-5.1-2.9-7c-1.9-1.9-4.4-2.9-7-2.9 c-5.5,0-9.9,4.4-9.9,9.9c0,1.9,0.7,4.2,1.9,7L0.7,23.2c-0.4,0.2-0.7,0.6-0.7,1v36c0,0.4,0.2,0.7,0.5,0.9c0.2,0.1,0.4,0.2,0.6,0.2 c0.1,0,0.3,0,0.4-0.1L21.9,54l19.8,7.3c0.2,0.1,0.5,0.1,0.7,0l20.8-7.4c0.4-0.2,0.7-0.6,0.7-1v-36C64,16.5,63.8,16.2,63.5,16z M19.1,4.8c2.1,0,4,0.8,5.4,2.3c0,0,0,0,0,0c1.5,1.4,2.3,3.4,2.3,5.4c0,1.4-0.5,3.3-1.5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32.3,41.6,32.8z' />
<path d='M19.1,15.2c1.9,0,3.4-1.5,3.4-3.4S21,8.4,19.1,8.4c-1.9,0-3.4,1.5-3.4,3.4S17.3,15.2,19.1,15.2z M19.1,10.6 c0.6,0,1.2,0.5,1.2,1.2c0,0.6-0.5,1.2-1.2,1.2c-0.6,0-1.2-0.5-1.2-1.2C18,11.2,18.5,10.6,19.1,10.6z' />
</g>
</svg>
</SvgIcon>
</IconButton> </IconButton>
</div> </div>
<Dialog <Dialog

View File

@ -0,0 +1,32 @@
import { SvgIcon } from '@suid/material';
import { Component } from 'solid-js';
const GpxIcon: Component<{}> = (props) => {
return (
<SvgIcon>
<svg
viewBox='0 0 170 170'
width='64px'
height='64px'
version='1.1'
style='stroke-width: 1%; stroke:black'
xml:space='preserve'
xmlns='http://www.w3.org/2000/svg'
xmlns:xlink='http://www.w3.org/1999/xlink'
>
<g>
<path d='M63.5,16c-0.3-0.2-0.7-0.3-1-0.1l-20.4,7.3l-14.3-5.2c0.8-2,1.2-3.8,1.2-5.3c0-2.7-1-5.1-2.9-7c-1.9-1.9-4.4-2.9-7-2.9 c-5.5,0-9.9,4.4-9.9,9.9c0,1.9,0.7,4.2,1.9,7L0.7,23.2c-0.4,0.2-0.7,0.6-0.7,1v36c0,0.4,0.2,0.7,0.5,0.9c0.2,0.1,0.4,0.2,0.6,0.2 c0.1,0,0.3,0,0.4-0.1L21.9,54l19.8,7.3c0.2,0.1,0.5,0.1,0.7,0l20.8-7.4c0.4-0.2,0.7-0.6,0.7-1v-36C64,16.5,63.8,16.2,63.5,16z M19.1,4.8c2.1,0,4,0.8,5.4,2.3c0,0,0,0,0,0c1.5,1.4,2.3,3.4,2.3,5.4c0,1.4-0.5,3.3-1.5,5.5c-1.8,4-4.8,8.2-6.2,10.1 c-0.2-0.2-0.3-0.4-0.5-0.7c-1.3-1.8-3.4-4.8-4.9-7.9c-1.5-2.9-2.2-5.3-2.2-7.1C11.4,8.3,14.9,4.8,19.1,4.8z M61.8,52.1l-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.6-0.5,1.2-1.2,1.2c-0.6,0-1.2-0.5-1.2-1.2C18,11.2,18.5,10.6,19.1,10.6z' />
</g>
</svg>
</SvgIcon>
);
};
export default GpxIcon;

View File

@ -1,17 +1,32 @@
import { Component } from 'solid-js'; import { Component } from 'solid-js';
import cache from '../../lib/cache';
import { peekCachedSignal } from '../../workers/cached-signals'; import { peekCachedSignal } from '../../workers/cached-signals';
import Tree from '../tree'; import Tree from '../tree';
import GpxIcon from './GpxIcon';
interface Props { interface Props {
gpxId: string; gpxId: string;
restrictToHierarchy?: any;
} }
const GpxViewer: Component<Props> = ({ gpxId }) => { const GpxViewer: Component<Props> = ({ gpxId, restrictToHierarchy }) => {
const gpx = peekCachedSignal({ id: gpxId, method: 'getGpx' }); const gpx = peekCachedSignal({ id: gpxId, method: 'getGpx' });
console.log({ caller: 'GpxViewer', gpx: gpx() }); console.log({ caller: 'GpxViewer', gpxId, restrictToHierarchy, gpx: gpx() });
const title = () => {}; const title = () => {
return <Tree title={'gpx'} content={undefined} subTree={undefined} />; return gpx().metadata.name;
};
return (
<Tree
title={
<>
<GpxIcon />
{' '}
{title()}
</>
}
content={undefined}
subTree={undefined}
/>
);
}; };
export default GpxViewer; export default GpxViewer;

View File

@ -1,3 +1,5 @@
export { default } from './Gpx'; export { default } from './Gpx';
export { default as GpxViewer } from './GpxViewer'; export { default as GpxViewer } from './GpxViewer';
export { default as GpxIcon } from './GpxIcon';

View File

@ -118,7 +118,7 @@ const FeaturesTree: Component<{ featuresHierarchy: any }> = ({
subTree={Object.keys(featuresHierarchy) subTree={Object.keys(featuresHierarchy)
.filter((key: string) => key.startsWith('gpx/')) .filter((key: string) => key.startsWith('gpx/'))
.map((key: string) => ( .map((key: string) => (
<GpxViewer gpxId={key} /> <GpxViewer gpxId={key} restrictToHierarchy={featuresHierarchy[key]} />
))} ))}
/> />
); );

View File

@ -3,7 +3,7 @@ import styled from '@suid/material/styles/styled';
import { Component, JSXElement, Show } from 'solid-js'; import { Component, JSXElement, Show } from 'solid-js';
interface Props { interface Props {
title: string; title: string | JSXElement;
content: JSXElement | undefined; content: JSXElement | undefined;
subTree: JSXElement | undefined; subTree: JSXElement | undefined;
} }
@ -11,7 +11,7 @@ interface Props {
const Item = styled(Paper)(({ theme }) => ({ const Item = styled(Paper)(({ theme }) => ({
...theme.typography.body2, ...theme.typography.body2,
padding: theme.spacing(1), padding: theme.spacing(1),
textAlign: 'center', textAlign: 'left',
color: theme.palette.text.secondary, color: theme.palette.text.secondary,
})); }));