aboutsummaryrefslogtreecommitdiff
path: root/modern/src/attributes
diff options
context:
space:
mode:
Diffstat (limited to 'modern/src/attributes')
-rw-r--r--modern/src/attributes/deviceAttributes.js6
-rw-r--r--modern/src/attributes/geofenceAttributes.js6
-rw-r--r--modern/src/attributes/positionAttributes.js6
-rw-r--r--modern/src/attributes/userAttributes.js6
4 files changed, 12 insertions, 12 deletions
diff --git a/modern/src/attributes/deviceAttributes.js b/modern/src/attributes/deviceAttributes.js
index 2b874c5..20bb1e0 100644
--- a/modern/src/attributes/deviceAttributes.js
+++ b/modern/src/attributes/deviceAttributes.js
@@ -1,6 +1,6 @@
-import t from '../LocalizationProvider';
+import { useMemo } from 'react';
-export default {
+export const useDeviceAttributes = (t) => useMemo({
speedLimit: {
name: t('attributeSpeedLimit'),
type: 'string',
@@ -9,4 +9,4 @@ export default {
name: t('attributeReportIgnoreOdometer'),
type: 'boolean',
},
-};
+}, [t]);
diff --git a/modern/src/attributes/geofenceAttributes.js b/modern/src/attributes/geofenceAttributes.js
index 5f197de..d9f512f 100644
--- a/modern/src/attributes/geofenceAttributes.js
+++ b/modern/src/attributes/geofenceAttributes.js
@@ -1,8 +1,8 @@
-import t from '../LocalizationProvider';
+import { useMemo } from 'react';
-export default {
+export const useGeofenceAttributes = (t) => useMemo({
speedLimit: {
name: t('attributeSpeedLimit'),
type: 'string',
},
-};
+}, [t]);
diff --git a/modern/src/attributes/positionAttributes.js b/modern/src/attributes/positionAttributes.js
index b44b606..49a64f7 100644
--- a/modern/src/attributes/positionAttributes.js
+++ b/modern/src/attributes/positionAttributes.js
@@ -1,6 +1,6 @@
-import t from '../LocalizationProvider';
+import { useMemo } from 'react';
-export default {
+export const usePositionAttributes = (t) => useMemo({
raw: {
name: t('positionRaw'),
type: 'string',
@@ -18,4 +18,4 @@ export default {
type: 'number',
dataType: 'distance',
},
-};
+}, [t]);
diff --git a/modern/src/attributes/userAttributes.js b/modern/src/attributes/userAttributes.js
index 33a6657..d9a5814 100644
--- a/modern/src/attributes/userAttributes.js
+++ b/modern/src/attributes/userAttributes.js
@@ -1,6 +1,6 @@
-import t from '../LocalizationProvider';
+import { useMemo } from 'react';
-export default {
+export const useUserAttributes = (t) => useMemo({
notificationTokens: {
name: t('attributeNotificationTokens'),
type: 'string',
@@ -65,4 +65,4 @@ export default {
name: t('sharedTimezone'),
type: 'string',
},
-};
+}, [t]);