aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-05-06 14:27:17 -0700
committerAnton Tananaev <anton@traccar.org>2022-05-06 14:27:17 -0700
commite3460181198fa98c5320ebe28650160603797f33 (patch)
treea340b2a35ba17e1fdafc5ee69efca97300d9a367
parenta0406374030e930b8bd8032900e83b4a432ae28a (diff)
downloadtrackermap-web-e3460181198fa98c5320ebe28650160603797f33.tar.gz
trackermap-web-e3460181198fa98c5320ebe28650160603797f33.tar.bz2
trackermap-web-e3460181198fa98c5320ebe28650160603797f33.zip
Fix style issues
-rw-r--r--modern/src/UserPage.js2
-rw-r--r--modern/src/attributes/EditAttributesView.js18
-rw-r--r--modern/src/common/converter.js2
-rw-r--r--modern/src/common/formatter.js4
4 files changed, 18 insertions, 8 deletions
diff --git a/modern/src/UserPage.js b/modern/src/UserPage.js
index 549d7c59..c6274af9 100644
--- a/modern/src/UserPage.js
+++ b/modern/src/UserPage.js
@@ -5,12 +5,12 @@ import {
Accordion, AccordionSummary, AccordionDetails, makeStyles, Typography,
} from '@material-ui/core';
import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
+import { useDispatch, useSelector } from 'react-redux';
import EditItemView from './EditItemView';
import EditAttributesView from './attributes/EditAttributesView';
import LinkField from './form/LinkField';
import { useTranslation } from './LocalizationProvider';
import useUserAttributes from './attributes/useUserAttributes';
-import { useDispatch, useSelector } from 'react-redux';
import { sessionActions } from './store';
const useStyles = makeStyles(() => ({
diff --git a/modern/src/attributes/EditAttributesView.js b/modern/src/attributes/EditAttributesView.js
index 56fdff5a..4343fde4 100644
--- a/modern/src/attributes/EditAttributesView.js
+++ b/modern/src/attributes/EditAttributesView.js
@@ -8,7 +8,9 @@ import AddIcon from '@material-ui/icons/Add';
import AddAttributeDialog from './AddAttributeDialog';
import { useTranslation } from '../LocalizationProvider';
import { useAttributePreference } from '../common/preferences';
-import { distanceFromMeters, distanceToMeters, distanceUnitString, speedFromKnots, speedToKnots, speedUnitString, volumeFromLiters, volumeToLiters, volumeUnitString } from '../common/converter';
+import {
+ distanceFromMeters, distanceToMeters, distanceUnitString, speedFromKnots, speedToKnots, speedUnitString, volumeFromLiters, volumeToLiters, volumeUnitString,
+} from '../common/converter';
const useStyles = makeStyles((theme) => ({
addButton: {
@@ -98,7 +100,7 @@ const EditAttributesView = ({ attributes, setAttributes, definitions }) => {
}
}
return '';
- }
+ };
const convertToList = (attributes) => {
const booleanList = [];
@@ -108,9 +110,13 @@ const EditAttributesView = ({ attributes, setAttributes, definitions }) => {
const type = getAttributeType(value);
const subtype = getAttributeSubtype(key);
if (type === 'boolean') {
- booleanList.push({ key, value, type, subtype });
+ booleanList.push({
+ key, value, type, subtype,
+ });
} else {
- otherList.push({ key, value, type, subtype });
+ otherList.push({
+ key, value, type, subtype,
+ });
}
});
return [...otherList, ...booleanList];
@@ -135,7 +141,9 @@ const EditAttributesView = ({ attributes, setAttributes, definitions }) => {
return (
<>
- {convertToList(attributes).map(({ key, value, type, subtype }) => {
+ {convertToList(attributes).map(({
+ key, value, type, subtype,
+ }) => {
if (type === 'boolean') {
return (
<Grid container direction="row" justify="space-between" key={key}>
diff --git a/modern/src/common/converter.js b/modern/src/common/converter.js
index e70473ca..61e2dfe6 100644
--- a/modern/src/common/converter.js
+++ b/modern/src/common/converter.js
@@ -20,7 +20,7 @@ export const speedUnitString = (unit, t) => {
default:
return t('sharedKn');
}
-}
+};
export const speedFromKnots = (value, unit) => value * speedConverter(unit);
diff --git a/modern/src/common/formatter.js b/modern/src/common/formatter.js
index 06e3b12f..08e29bc4 100644
--- a/modern/src/common/formatter.js
+++ b/modern/src/common/formatter.js
@@ -1,5 +1,7 @@
import moment from 'moment';
-import { distanceFromMeters, distanceUnitString, speedFromKnots, speedUnitString, volumeFromLiters, volumeUnitString } from './converter';
+import {
+ distanceFromMeters, distanceUnitString, speedFromKnots, speedUnitString, volumeFromLiters, volumeUnitString,
+} from './converter';
import { prefixString } from './stringUtils';
export const formatBoolean = (value, t) => (value ? t('sharedYes') : t('sharedNo'));