aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJamie Guthrie <jamie.guthrie@gmail.com>2023-08-17 03:05:50 +0200
committerJamie Guthrie <jamie.guthrie@gmail.com>2023-08-17 03:05:50 +0200
commitbf4a9e5c499c9eee9f8b63dbb6733e09e3090fd0 (patch)
treef621e824e482b9e3b8217bbb1afb988a4420d47a
parentc4d214632676a05d3e1cb33efb3bb6d99c7e0488 (diff)
downloadtrackermap-web-bf4a9e5c499c9eee9f8b63dbb6733e09e3090fd0.tar.gz
trackermap-web-bf4a9e5c499c9eee9f8b63dbb6733e09e3090fd0.tar.bz2
trackermap-web-bf4a9e5c499c9eee9f8b63dbb6733e09e3090fd0.zip
Refactor & set tooltip delay in global env
-rw-r--r--modern/.env1
-rw-r--r--modern/src/other/GeofencesPage.js2
-rw-r--r--modern/src/resources/l10n/en.json1
-rw-r--r--modern/src/settings/GroupsPage.js1
-rw-r--r--modern/src/settings/components/CollectionActions.js8
5 files changed, 6 insertions, 7 deletions
diff --git a/modern/.env b/modern/.env
index c8702185..30d7591a 100644
--- a/modern/.env
+++ b/modern/.env
@@ -1,3 +1,4 @@
ESLINT_NO_DEV_ERRORS=false
REACT_APP_URL_NAME='localhost:8082'
REACT_APP_VERSION=$npm_package_version
+REACT_APP_TOOLTIP_DELAY=750 \ No newline at end of file
diff --git a/modern/src/other/GeofencesPage.js b/modern/src/other/GeofencesPage.js
index cbbf3d40..37875a67 100644
--- a/modern/src/other/GeofencesPage.js
+++ b/modern/src/other/GeofencesPage.js
@@ -118,7 +118,7 @@ const GeofencesPage = () => {
<label htmlFor="upload-gpx">
<input accept=".gpx" id="upload-gpx" type="file" className={classes.fileInput} onChange={handleFile} />
<IconButton edge="end" component="span" onClick={() => {}}>
- <Tooltip title={t('sharedUploadGeofence')} enterDelay={500} enterNextDelay={500}>
+ <Tooltip title={t('sharedUploadGeofence')} enterDelay={process.env.REACT_APP_TOOLTIP_DELAY} enterNextDelay={process.env.REACT_APP_TOOLTIP_DELAY}>
<UploadFileIcon />
</Tooltip>
</IconButton>
diff --git a/modern/src/resources/l10n/en.json b/modern/src/resources/l10n/en.json
index 057c1655..4e0b72b1 100644
--- a/modern/src/resources/l10n/en.json
+++ b/modern/src/resources/l10n/en.json
@@ -379,7 +379,6 @@
"stateValue": "Value",
"commandTitle": "Command",
"commandSend": "Send",
- "commandSendTitle": "Send Command",
"commandSent": "Command sent",
"commandQueued": "Command queued",
"commandUnit": "Unit",
diff --git a/modern/src/settings/GroupsPage.js b/modern/src/settings/GroupsPage.js
index 7148184b..baba7f72 100644
--- a/modern/src/settings/GroupsPage.js
+++ b/modern/src/settings/GroupsPage.js
@@ -45,7 +45,6 @@ const GroupsPage = () => {
const actionCommand = {
key: 'command',
title: t('deviceCommand'),
- tooltip: t('commandSendTitle'),
icon: <PublishIcon fontSize="small" />,
handler: (groupId) => navigate(`/settings/group/${groupId}/command`),
};
diff --git a/modern/src/settings/components/CollectionActions.js b/modern/src/settings/components/CollectionActions.js
index 87ffe7af..287be964 100644
--- a/modern/src/settings/components/CollectionActions.js
+++ b/modern/src/settings/components/CollectionActions.js
@@ -74,20 +74,20 @@ const CollectionActions = ({
) : (
<div className={classes.row}>
{customActions && customActions.map((action) => (
- <Tooltip title={action.tooltip || action.title} enterDelay={500} enterNextDelay={500}>
- <IconButton size="small" onClick={() => handleCustom(action)} key={action.key}>
+ <Tooltip title={action.title} enterDelay={process.env.REACT_APP_TOOLTIP_DELAY} enterNextDelay={process.env.REACT_APP_TOOLTIP_DELAY} key={action.key}>
+ <IconButton size="small" onClick={() => handleCustom(action)}>
{action.icon}
</IconButton>
</Tooltip>
))}
{!readonly && (
<>
- <Tooltip title={t('sharedEdit')} enterDelay={500} enterNextDelay={500}>
+ <Tooltip title={t('sharedEdit')} enterDelay={process.env.REACT_APP_TOOLTIP_DELAY} enterNextDelay={process.env.REACT_APP_TOOLTIP_DELAY}>
<IconButton size="small" onClick={handleEdit}>
<EditIcon fontSize="small" />
</IconButton>
</Tooltip>
- <Tooltip title={t('sharedRemove')} enterDelay={500} enterNextDelay={500}>
+ <Tooltip title={t('sharedRemove')} enterDelay={process.env.REACT_APP_TOOLTIP_DELAY} enterNextDelay={process.env.REACT_APP_TOOLTIP_DELAY}>
<IconButton size="small" onClick={handleRemove}>
<DeleteIcon fontSize="small" />
</IconButton>