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<{
open: boolean;
title: JSXElement;
closeHandler: () => void;
closeHandler: (event: any, reason?: string) => void;
children: JSXElement;
}> = (props) => {
return (

View File

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

View File

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

View File

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