diff options
author | Anton Tananaev <anton@traccar.org> | 2023-05-19 07:35:54 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2023-05-19 07:35:54 -0700 |
commit | 7f978889b45672285da1e73461e67bc78e78e1bb (patch) | |
tree | 8122a810ca1da580e34ac99701e28b399e2f4a67 /modern/src/login | |
parent | 03b6c9fe0eda8788480bd6ae675658769758c96d (diff) | |
download | trackermap-web-7f978889b45672285da1e73461e67bc78e78e1bb.tar.gz trackermap-web-7f978889b45672285da1e73461e67bc78e78e1bb.tar.bz2 trackermap-web-7f978889b45672285da1e73461e67bc78e78e1bb.zip |
Custom logo option
Diffstat (limited to 'modern/src/login')
-rw-r--r-- | modern/src/login/LogoImage.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/modern/src/login/LogoImage.js b/modern/src/login/LogoImage.js index 1b78c80e..f8de13e2 100644 --- a/modern/src/login/LogoImage.js +++ b/modern/src/login/LogoImage.js @@ -1,4 +1,5 @@ import React from 'react'; +import { useSelector } from 'react-redux'; import { makeStyles } from '@mui/styles'; import { ReactComponent as Logo } from '../resources/images/logo.svg'; @@ -15,7 +16,16 @@ const useStyles = makeStyles(() => ({ const LogoImage = ({ color }) => { const classes = useStyles(); - return (<Logo className={classes.image} style={{ color }} />); + const imageFile = useSelector((state) => state.session.server.attributes?.logo); + + if (imageFile) { + return ( + <img className={classes.image} src={imageFile} alt="" /> + ); + } + return ( + <Logo className={classes.image} style={{ color }} /> + ); }; export default LogoImage; |