Replacing Shared by To...

This commit is contained in:
Eric van der Vlist 2023-03-04 13:09:11 +01:00
parent 2358c7d8fb
commit acb6156ed2
3 changed files with 8 additions and 8 deletions

View File

@ -98,15 +98,15 @@ const GpxDialog: Component<{}> = (props) => {
gpx: gpx(),
});
};
const gpxSharedChangeHandler = (event: any) => {
const gpxToChangeHandler = (event: any) => {
const newGpx: Gpx = cloneDeep(gpx()) as Gpx;
if (!isPlainObject(newGpx.extensions)) {
newGpx.extensions = {};
}
newGpx.extensions.shared = event.target.value;
newGpx.extensions.to = event.target.value;
setGpx(newGpx);
console.log({
caller: 'GpxDialog / gpxSharedChangeHandler',
caller: 'GpxDialog / gpxToChangeHandler',
value: event.target.value,
gpx: gpx(),
newGpx,
@ -190,11 +190,11 @@ const GpxDialog: Component<{}> = (props) => {
InputProps={{ inputComponent: 'textarea' }}
/>
<TextField
label={t('gpxShared')}
label={t('gpxTo')}
multiline={true}
rows={5}
value={gpx()?.extensions?.shared || ''}
onChange={gpxSharedChangeHandler}
value={gpx()?.extensions?.to || ''}
onChange={gpxToChangeHandler}
InputProps={{ inputComponent: 'textarea' }}
/>
<Button variant='contained' onClick={saveHandler}>

View File

@ -44,7 +44,7 @@ const dict = {
gpxNoName: 'No name',
gpxDesc: 'Description',
gpxTime: 'Start date',
gpxShared: 'Shared with',
gpxTo: 'To',
gpxSave: 'Save',
newGpx: '-- new journey --',

View File

@ -49,7 +49,7 @@ const dict = {
gpxNoName: 'Pas de nom',
gpxDesc: 'Description',
gpxTime: 'Date de début',
gpxShared: 'Partagé avec',
gpxTo: 'Destinataires',
gpxSave: 'Sauvegarder',
newGpx: '-- nouveau voyage --',