Client: fix logo

This commit is contained in:
Viktor Fomin 2022-11-28 13:31:58 +03:00
parent ef88b12780
commit cf400cb800

View File

@ -3,17 +3,13 @@ import styled from "styled-components";
import { ReactSVG } from "react-svg";
import { hugeMobile } from "@docspace/components/utils/device";
import { isMobileOnly } from "react-device-detect";
import { inject, observer } from "mobx-react";
const StyledWrapper = styled.div`
.logo-wrapper {
width: 100%;
height: 46px;
svg {
path:last-child {
fill: ${(props) => props.theme.client.home.logoColor};
}
}
@media ${hugeMobile} {
display: none;
}
@ -21,17 +17,29 @@ const StyledWrapper = styled.div`
`;
const DocspaceLogo = (props) => {
const { className } = props;
const { className, whiteLabelLogoUrls } = props;
if (isMobileOnly) return <></>;
const logo =
userTheme === "Dark"
? whiteLabelLogoUrls[1].path.dark
: whiteLabelLogoUrls[1].path.light;
return (
<StyledWrapper>
<ReactSVG
src="/static/images/docspace.big.react.svg"
className={`logo-wrapper ${className}`}
/>
<ReactSVG src={logo} className={`logo-wrapper ${className}`} />
</StyledWrapper>
);
};
export default DocspaceLogo;
export default inject(({ auth }) => {
const { settingsStore, userStore } = auth;
const { whiteLabelLogoUrls } = settingsStore;
const { userTheme } = userStore;
return {
whiteLabelLogoUrls,
userTheme,
};
})(observer(DocspaceLogo));