-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ [open-formulieren/open-forms#2177] added interaction configuration
- Loading branch information
1 parent
2d64b61
commit a12a954
Showing
2 changed files
with
111 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
import {FormattedMessage, useIntl} from 'react-intl'; | ||
|
||
import {Checkbox, Panel} from '@/components/formio'; | ||
|
||
const CircleInteraction: React.FC = () => { | ||
const intl = useIntl(); | ||
const tooltip = intl.formatMessage({ | ||
description: "Tooltip for 'interactions.circle' builder field", | ||
defaultMessage: 'Allowing users to draw a circle when using the map component', | ||
}); | ||
return ( | ||
<Checkbox | ||
name="interactions.circle" | ||
label={ | ||
<FormattedMessage | ||
description="Label for 'interactions.circle' builder field" | ||
defaultMessage="Circle interactions" | ||
/> | ||
} | ||
tooltip={tooltip} | ||
/> | ||
); | ||
}; | ||
|
||
const PolygonInteraction: React.FC = () => { | ||
const intl = useIntl(); | ||
const tooltip = intl.formatMessage({ | ||
description: "Tooltip for 'interactions.polygon' builder field", | ||
defaultMessage: 'Allowing users to draw a polygon when using the map component', | ||
}); | ||
return ( | ||
<Checkbox | ||
name="interactions.polygon" | ||
label={ | ||
<FormattedMessage | ||
description="Label for 'interactions.polygon' builder field" | ||
defaultMessage="Polygon interactions" | ||
/> | ||
} | ||
tooltip={tooltip} | ||
/> | ||
); | ||
}; | ||
|
||
const PolylineInteraction: React.FC = () => { | ||
const intl = useIntl(); | ||
const tooltip = intl.formatMessage({ | ||
description: "Tooltip for 'interactions.polyline' builder field", | ||
defaultMessage: 'Allowing users to draw a line when using the map component', | ||
}); | ||
return ( | ||
<Checkbox | ||
name="interactions.polyline" | ||
label={ | ||
<FormattedMessage | ||
description="Label for 'interactions.polyline' builder field" | ||
defaultMessage="Line interactions" | ||
/> | ||
} | ||
tooltip={tooltip} | ||
/> | ||
); | ||
}; | ||
|
||
const MarkerInteraction: React.FC = () => { | ||
const intl = useIntl(); | ||
const tooltip = intl.formatMessage({ | ||
description: "Tooltip for 'interactions.marker' builder field", | ||
defaultMessage: 'Allowing users to set a marker when using the map component', | ||
}); | ||
return ( | ||
<Checkbox | ||
name="interactions.marker" | ||
label={ | ||
<FormattedMessage | ||
description="Label for 'interactions.marker' builder field" | ||
defaultMessage="Marker interactions" | ||
/> | ||
} | ||
tooltip={tooltip} | ||
/> | ||
); | ||
}; | ||
|
||
const InteractionConfiguration: React.FC = () => ( | ||
<Panel | ||
title={ | ||
<FormattedMessage | ||
description="Interaction configuration panel title" | ||
defaultMessage="Available map interactions" | ||
/> | ||
} | ||
> | ||
<CircleInteraction /> | ||
<PolygonInteraction /> | ||
<PolylineInteraction /> | ||
<MarkerInteraction /> | ||
</Panel> | ||
); | ||
|
||
export default InteractionConfiguration; |