Client: LDAP: show settings for paid

This commit is contained in:
Viktor Fomin 2024-07-24 00:46:19 +03:00
parent 333e8ffbe9
commit 185ad608e1
4 changed files with 5 additions and 23 deletions

View File

@ -75,10 +75,7 @@ const LDAP = ({
if (!isLoaded && isLdapAvailable) return <LdapLoader />; if (!isLoaded && isLdapAvailable) return <LdapLoader />;
return ( return (
<StyledLdapPage <StyledLdapPage isSmallWindow={isSmallWindow}>
isSmallWindow={isSmallWindow}
isSettingPaid={isLdapAvailable}
>
<Text className="intro-text settings_unavailable">{t("LdapIntro")}</Text> <Text className="intro-text settings_unavailable">{t("LdapIntro")}</Text>
<Box marginProp="8px 0 24px 0"> <Box marginProp="8px 0 24px 0">
<Link <Link

View File

@ -27,7 +27,6 @@
import styled, { css } from "styled-components"; import styled, { css } from "styled-components";
import { Box } from "@docspace/shared/components/box"; import { Box } from "@docspace/shared/components/box";
import { mobile } from "@docspace/shared/utils"; import { mobile } from "@docspace/shared/utils";
import { UnavailableStyles } from "../../../../utils/commonSettingsStyles";
const StyledLdapPage = styled(Box)` const StyledLdapPage = styled(Box)`
max-width: ${(props) => (props.isSmallWindow ? "100%" : "700px")}; max-width: ${(props) => (props.isSmallWindow ? "100%" : "700px")};
@ -222,8 +221,6 @@ const StyledLdapPage = styled(Box)`
margin-top: 24px; margin-top: 24px;
} }
} }
${(props) => !props.isSettingPaid && UnavailableStyles}
`; `;
export default StyledLdapPage; export default StyledLdapPage;

View File

@ -33,22 +33,14 @@ import { Text } from "@docspace/shared/components/text";
const HideButton = (props) => { const HideButton = (props) => {
const { t } = useTranslation("SingleSignOn"); const { t } = useTranslation("SingleSignOn");
const { const { text, label, isAdditionalParameters, value, setIsSettingsShown } =
text, props;
label,
isAdditionalParameters,
value,
setIsSettingsShown,
isDisabled,
} = props;
const marginProp = isAdditionalParameters ? null : "24px 0"; const marginProp = isAdditionalParameters ? null : "24px 0";
const onClick = () => { const onClick = () => {
setIsSettingsShown(!value); setIsSettingsShown(!value);
}; };
const onClickProp = isDisabled ? {} : { onClick: onClick };
return ( return (
<Box <Box
alignItems="center" alignItems="center"
@ -71,7 +63,7 @@ const HideButton = (props) => {
<Link <Link
className="hide-button settings_unavailable" className="hide-button settings_unavailable"
isHovered isHovered
{...onClickProp} onClick={onClick}
type="action" type="action"
> >
{value {value

View File

@ -83,11 +83,7 @@ const SettingsContainer = ({
const renderBody = () => ( const renderBody = () => (
<> <>
{!isMobileView && ( {!isMobileView && (
<HideButton <HideButton text={t("Settings:LDAP")} value={isSettingsShown} />
text={t("Settings:LDAP")}
value={isSettingsShown}
isDisabled={!isLdapAvailable}
/>
)} )}
{isMobileView && <ToggleLDAP />} {isMobileView && <ToggleLDAP />}