diff --git a/frontend/src/features/about/system/SystemVersionComponent.js b/frontend/src/features/about/system/SystemVersionComponent.js index ba7a9a8..9644149 100644 --- a/frontend/src/features/about/system/SystemVersionComponent.js +++ b/frontend/src/features/about/system/SystemVersionComponent.js @@ -1,6 +1,5 @@ import React, { useMemo, useEffect, useState } from "react"; import PropTypes from "prop-types"; -import { makeStyles } from "@mui/material/styles"; import { List, ListItem, ListItemText, ListItemAvatar } from "@mui/material"; import Avatar from "@mui/material/Avatar"; import WebAssetIcon from "@mui/icons-material/WebAsset"; @@ -9,37 +8,37 @@ import SettingsInputSvideoIcon from "@mui/icons-material/SettingsInputSvideo"; import { useTranslation } from "react-i18next"; import packageData from "../../../../package.json"; import Paper from "@mui/material/Paper"; +import { useTheme } from "@mui/material/styles"; -const useStyles = makeStyles(theme => { - return { - horizontally: { - display: "flex", - flexDirection: "row", - padding: 0 - }, - vertical: { - width: "100%" - }, - value: { - fontSize: "0.9rem", - fontWeight: theme.typography.fontWeightMedium - }, - versionAvatar: { - backgroundColor: theme.palette.secondary.main - } - }; +const getStyles = theme => ({ + horizontally: { + display: "flex", + flexDirection: "row", + padding: 0 + }, + vertical: { + width: "100%" + }, + value: { + fontSize: "0.9rem", + fontWeight: theme.typography.fontWeightMedium + }, + versionAvatar: { + backgroundColor: theme.palette.secondary.main + } }); const SystemVersionComponent = ({ data }) => { - const classes = useStyles(); - const [listClass, setListClass] = useState(classes.horizontally); + const [listClass, setListClass] = useState(styles.horizontally); const { t } = useTranslation(); + const theme = useTheme(); + const styles = getStyles(theme); useEffect(() => { const mediaQuery = window.matchMedia("(max-width: 800px)"); function handleMatches(event) { - const cssClass = event.matches ? classes.vertical : classes.horizontally; + const cssClass = event.matches ? styles.vertical : styles.horizontally; setListClass(cssClass); } @@ -49,7 +48,7 @@ const SystemVersionComponent = ({ data }) => { return () => { mediaQuery.removeListener(handleMatches); }; - }, [classes.horizontally, classes.vertical]); + }, []); const lastReleaseDate = useMemo(() => { const format = "DD-MM-YYYY HH:mm:ss"; @@ -79,16 +78,16 @@ const SystemVersionComponent = ({ data }) => { return ( - + - + + {t("About.System.Version.Server", { version: data.server.version })} @@ -101,13 +100,13 @@ const SystemVersionComponent = ({ data }) => { - + + {t("About.System.Version.Api", { version: data.api.version })} @@ -120,13 +119,13 @@ const SystemVersionComponent = ({ data }) => { - + + {t("About.System.Version.Frontend", { version: process.env.APP_VERSION ?? packageData.version })}