Minor modifications

This commit is contained in:
Eric van der Vlist 2022-12-12 21:35:00 +01:00
parent daed8e5dc1
commit 56c9eb37bb
5 changed files with 24 additions and 9 deletions

View File

@ -11,7 +11,7 @@ import CloseIcon from '@suid/icons-material/Close';
const Dialog: Component<{ const Dialog: Component<{
open: boolean; open: boolean;
title: JSXElement; title: JSXElement;
closeHandler: () => void; closeHandler: (event: any, reason?: string) => void;
children: JSXElement; children: JSXElement;
}> = (props) => { }> = (props) => {
return ( return (

View File

@ -53,8 +53,15 @@ const GpxDialog: Component<{}> = (props) => {
gpx: gpx(), gpx: gpx(),
}); });
}; };
const handleClose = () => { const handleClose = (event: any, reason?: string) => {
console.log({
caller: 'GpxDialog / handleClose',
event,
reason,
});
if (reason === undefined) {
setOpen(false); setOpen(false);
}
}; };
const gpxChangeHandler = async (event: any) => { const gpxChangeHandler = async (event: any) => {
setSelectedGpxId(event.target.value); setSelectedGpxId(event.target.value);
@ -178,10 +185,9 @@ const GpxDialog: Component<{}> = (props) => {
> >
<For each={allGpxes()}> <For each={allGpxes()}>
{(gpx) => ( {(gpx) => (
<option <option value={gpx.id} selected={gpx.id === selectedGpxId()}>
value={gpx.id} {gpx.name || `${t('gpxNoName')} (${gpx.creator})`}
selected={gpx.id === selectedGpxId()} </option>
>{`${gpx.name || gpx.id} (${gpx.creator})`}</option>
)} )}
</For> </For>
</NativeSelect> </NativeSelect>

View File

@ -71,8 +71,15 @@ const GpxImport: Component = () => {
// } // }
}; };
const handleClose = () => { const handleClose = (event: any, reason?: string) => {
console.log({
caller: 'GpxImport / handleClose',
event,
reason,
});
if (reason === undefined) {
setFilesToImport(undefined); setFilesToImport(undefined);
}
}; };
return ( return (

View File

@ -37,6 +37,7 @@ const dict = {
gpxDialog: 'Current journey', gpxDialog: 'Current journey',
gpxChooser: 'Journey', gpxChooser: 'Journey',
gpxName: 'Name', gpxName: 'Name',
gpxNoName:'No name',
gpxDesc: 'Description', gpxDesc: 'Description',
gpxTime: 'Start date', gpxTime: 'Start date',
gpxSave: 'Save', gpxSave: 'Save',

View File

@ -41,6 +41,7 @@ const dict = {
gpxDialog: 'Voyage en cours', gpxDialog: 'Voyage en cours',
gpxChooser: 'Voyage', gpxChooser: 'Voyage',
gpxName: 'Nom', gpxName: 'Nom',
gpxNoName:'Pas de nom',
gpxDesc: 'Description', gpxDesc: 'Description',
gpxTime: 'Date de début', gpxTime: 'Date de début',
gpxSave: 'Sauvegarder', gpxSave: 'Sauvegarder',