Client: PortalSettings: WhiteLabel: fix show about

This commit is contained in:
Viktor Fomin 2024-08-16 12:59:35 +03:00
parent a2ee76937e
commit fbda39866a

View File

@ -77,6 +77,7 @@ const WhiteLabel = (props) => {
isWhitelableLoaded, isWhitelableLoaded,
isCustomizationAvailable, isCustomizationAvailable,
isEnterprise,
} = props; } = props;
const navigate = useNavigate(); const navigate = useNavigate();
const location = useLocation(); const location = useLocation();
@ -86,6 +87,7 @@ const WhiteLabel = (props) => {
const [isEmpty, setIsEmpty] = useState(isWhitelableLoaded && !logoText); const [isEmpty, setIsEmpty] = useState(isWhitelableLoaded && !logoText);
const isMobileView = deviceType === DeviceType.mobile; const isMobileView = deviceType === DeviceType.mobile;
const showAbout = isManagement() && isCustomizationAvailable && isEnterprise;
const init = async () => { const init = async () => {
const isWhiteLabelPage = standalone const isWhiteLabelPage = standalone
@ -173,6 +175,7 @@ const WhiteLabel = (props) => {
); );
if (options.isEditor && !isCustomizationAvailable) continue; if (options.isEditor && !isCustomizationAvailable) continue;
if (!showAbout && logoUrlsWhiteLabel[i].name === "AboutPage") continue;
const isDocsEditorName = logoUrlsWhiteLabel[i].name === "DocsEditor"; const isDocsEditorName = logoUrlsWhiteLabel[i].name === "DocsEditor";
@ -448,39 +451,42 @@ const WhiteLabel = (props) => {
</div> </div>
</div> </div>
<div className="logo-wrapper"> {showAbout && (
<Text <>
fontSize="15px" <div className="logo-wrapper">
fontWeight="600" <Text
className="settings_unavailable" fontSize="15px"
> fontWeight="600"
{t("LogoAbout")} ({logoUrlsWhiteLabel[6].size.width}x className="settings_unavailable"
{logoUrlsWhiteLabel[6].size.height}) >
</Text> {t("LogoAbout")} ({logoUrlsWhiteLabel[6].size.width}x
<div className="logos-wrapper"> {logoUrlsWhiteLabel[6].size.height})
<Logo </Text>
title={t("Profile:LightTheme")} <div className="logos-wrapper">
src={logoUrlsWhiteLabel[6].path.light} <Logo
imageClass="border-img logo-about background-white" title={t("Profile:LightTheme")}
inputId={`logoUploader_${WhiteLabelLogoType.AboutPage}_light`} src={logoUrlsWhiteLabel[6].path.light}
linkId="link-about-light" imageClass="border-img logo-about background-white"
onChangeText={t("ChangeLogoButton")} inputId={`logoUploader_${WhiteLabelLogoType.AboutPage}_light`}
onChange={onChangeLogo} linkId="link-about-light"
isSettingPaid={isSettingPaid} onChangeText={t("ChangeLogoButton")}
/> onChange={onChangeLogo}
<Logo isSettingPaid={isSettingPaid}
title={t("Profile:DarkTheme")} />
src={logoUrlsWhiteLabel[6].path.dark} <Logo
imageClass="border-img logo-about background-dark" title={t("Profile:DarkTheme")}
inputId={`logoUploader_${WhiteLabelLogoType.AboutPage}_dark`} src={logoUrlsWhiteLabel[6].path.dark}
linkId="link-about-dark" imageClass="border-img logo-about background-dark"
onChangeText={t("ChangeLogoButton")} inputId={`logoUploader_${WhiteLabelLogoType.AboutPage}_dark`}
onChange={onChangeLogo} linkId="link-about-dark"
isSettingPaid={isSettingPaid} onChangeText={t("ChangeLogoButton")}
/> onChange={onChangeLogo}
</div> isSettingPaid={isSettingPaid}
</div> />
</div>
</div>
</>
)}
<div className="logo-wrapper"> <div className="logo-wrapper">
<Text <Text
fontSize="15px" fontSize="15px"
@ -568,50 +574,54 @@ const WhiteLabel = (props) => {
); );
}; };
export default inject(({ settingsStore, common, currentQuotaStore }) => { export default inject(
const { ({ settingsStore, common, currentQuotaStore, currentTariffStatusStore }) => {
setLogoText, const {
whiteLabelLogoText, setLogoText,
getWhiteLabelLogoText, whiteLabelLogoText,
restoreWhiteLabelSettings, getWhiteLabelLogoText,
initSettings, restoreWhiteLabelSettings,
saveWhiteLabelSettings, initSettings,
logoUrlsWhiteLabel, saveWhiteLabelSettings,
setLogoUrlsWhiteLabel, logoUrlsWhiteLabel,
defaultLogoTextWhiteLabel, setLogoUrlsWhiteLabel,
enableRestoreButton, defaultLogoTextWhiteLabel,
resetIsInit, enableRestoreButton,
isWhitelableLoaded, resetIsInit,
} = common; isWhitelableLoaded,
} = common;
const { const {
whiteLabelLogoUrls: defaultWhiteLabelLogoUrls, whiteLabelLogoUrls: defaultWhiteLabelLogoUrls,
deviceType, deviceType,
standalone, standalone,
} = settingsStore; } = settingsStore;
const { isBrandingAndCustomizationAvailable, isCustomizationAvailable } = const { isBrandingAndCustomizationAvailable, isCustomizationAvailable } =
currentQuotaStore; currentQuotaStore;
const { isEnterprise } = currentTariffStatusStore;
return { return {
setLogoText, setLogoText,
theme: settingsStore.theme, theme: settingsStore.theme,
logoText: whiteLabelLogoText, logoText: whiteLabelLogoText,
getWhiteLabelLogoText, getWhiteLabelLogoText,
saveWhiteLabelSettings, saveWhiteLabelSettings,
restoreWhiteLabelSettings, restoreWhiteLabelSettings,
defaultWhiteLabelLogoUrls, defaultWhiteLabelLogoUrls,
isSettingPaid: isBrandingAndCustomizationAvailable, isSettingPaid: isBrandingAndCustomizationAvailable,
initSettings, initSettings,
logoUrlsWhiteLabel, logoUrlsWhiteLabel,
setLogoUrlsWhiteLabel, setLogoUrlsWhiteLabel,
defaultLogoTextWhiteLabel, defaultLogoTextWhiteLabel,
enableRestoreButton, enableRestoreButton,
deviceType, deviceType,
resetIsInit, resetIsInit,
standalone, standalone,
isWhitelableLoaded, isWhitelableLoaded,
isCustomizationAvailable, isCustomizationAvailable,
}; isEnterprise,
})(withTranslation(["Settings", "Profile", "Common"])(observer(WhiteLabel))); };
},
)(withTranslation(["Settings", "Profile", "Common"])(observer(WhiteLabel)));