diff options
Diffstat (limited to 'modern/src/admin')
-rw-r--r-- | modern/src/admin/ServerPage.js | 5 | ||||
-rw-r--r-- | modern/src/admin/StatisticsPage.js | 6 | ||||
-rw-r--r-- | modern/src/admin/UsersPage.js | 3 |
3 files changed, 10 insertions, 4 deletions
diff --git a/modern/src/admin/ServerPage.js b/modern/src/admin/ServerPage.js index 05190643..62c93f67 100644 --- a/modern/src/admin/ServerPage.js +++ b/modern/src/admin/ServerPage.js @@ -7,12 +7,12 @@ import { import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; import { useHistory } from 'react-router-dom'; import { useDispatch, useSelector } from 'react-redux'; -import t from '../LocalizationProvider'; import { sessionActions } from '../store'; import EditAttributesView from '../attributes/EditAttributesView'; import deviceAttributes from '../attributes/deviceAttributes'; import userAttributes from '../attributes/userAttributes'; import OptionsLayout from '../settings/OptionsLayout'; +import { useTranslation } from '../LocalizationProvider'; const useStyles = makeStyles((theme) => ({ container: { @@ -31,9 +31,10 @@ const useStyles = makeStyles((theme) => ({ })); const ServerPage = () => { + const classes = useStyles(); const history = useHistory(); const dispatch = useDispatch(); - const classes = useStyles(); + const t = useTranslation(); const item = useSelector((state) => state.session.server); const setItem = (updatedItem) => dispatch(sessionActions.updateServer(updatedItem)); diff --git a/modern/src/admin/StatisticsPage.js b/modern/src/admin/StatisticsPage.js index 96ee4d18..9d075fef 100644 --- a/modern/src/admin/StatisticsPage.js +++ b/modern/src/admin/StatisticsPage.js @@ -3,11 +3,13 @@ import { FormControl, InputLabel, Select, MenuItem, TextField, Button, TableContainer, Table, TableRow, TableCell, TableHead, TableBody, Paper, } from '@material-ui/core'; import moment from 'moment'; -import t from '../LocalizationProvider'; import { formatDate } from '../common/formatter'; import OptionsLayout from '../settings/OptionsLayout'; +import { useTranslation } from '../LocalizationProvider'; const Filter = ({ setItems }) => { + const t = useTranslation(); + const [period, setPeriod] = useState('today'); const [from, setFrom] = useState(moment().subtract(1, 'hour')); const [to, setTo] = useState(moment()); @@ -95,6 +97,8 @@ const Filter = ({ setItems }) => { }; const StatisticsPage = () => { + const t = useTranslation(); + const [items, setItems] = useState([]); return ( diff --git a/modern/src/admin/UsersPage.js b/modern/src/admin/UsersPage.js index 2bfbb755..92db32e0 100644 --- a/modern/src/admin/UsersPage.js +++ b/modern/src/admin/UsersPage.js @@ -3,11 +3,11 @@ import { TableContainer, Table, TableRow, TableCell, TableHead, TableBody, makeStyles, IconButton, } from '@material-ui/core'; import MoreVertIcon from '@material-ui/icons/MoreVert'; -import t from '../LocalizationProvider'; import { useEffectAsync } from '../reactHelper'; import EditCollectionView from '../EditCollectionView'; import { formatBoolean } from '../common/formatter'; import OptionsLayout from '../settings/OptionsLayout'; +import { useTranslation } from '../LocalizationProvider'; const useStyles = makeStyles((theme) => ({ columnAction: { @@ -18,6 +18,7 @@ const useStyles = makeStyles((theme) => ({ const UsersView = ({ updateTimestamp, onMenuClick }) => { const classes = useStyles(); + const t = useTranslation(); const [items, setItems] = useState([]); |