Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
ehconitin committed Nov 12, 2024
1 parent 0944a1b commit 3cc8d8d
Showing 1 changed file with 65 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,54 @@
import { H2Title, Section, IconLock, Tag } from 'twenty-ui';
import styled from '@emotion/styled';
import { AnimatePresence, motion } from 'framer-motion';
import { useRecoilValue } from 'recoil';
import {
H2Title,
IconLock,
IconTool,
MAIN_COLORS,
Section,
Tag,
} from 'twenty-ui';

import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';
import { SettingsReadDocumentationButton } from '@/settings/developers/components/SettingsReadDocumentationButton';
import { useExpandedHeightAnimation } from '@/settings/hooks/useExpandedHeightAnimation';
import { SettingsSSOIdentitiesProvidersListCard } from '@/settings/security/components/SettingsSSOIdentitiesProvidersListCard';
import { SettingsSecurityOptionsList } from '@/settings/security/components/SettingsSecurityOptionsList';
import { getSettingsPagePath } from '@/settings/utils/getSettingsPagePath';
import { SettingsPath } from '@/types/SettingsPath';
import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';
import { isAdvancedModeEnabledState } from '@/ui/navigation/navigation-drawer/states/isAdvancedModeEnabledState';

const StyledIconContainer = styled.div`
border-right: 1px solid ${MAIN_COLORS.yellow};
display: flex;
left: ${({ theme }) => theme.spacing(-6)};
position: absolute;
height: 100%;
`;

const StyledIconTool = styled(IconTool)`
margin-right: ${({ theme }) => theme.spacing(0.5)};
`;

const StyledAdvancedContainer = styled.div`
display: flex;
gap: ${({ theme }) => theme.spacing(2)};
position: relative;
width: 100%;
`;

const StyledContainer = styled.div`
width: 100%;
`;

export const SettingsSecurity = () => {
const isAdvancedModeEnabled = useRecoilValue(isAdvancedModeEnabledState);
const { contentRef, motionAnimationVariants } = useExpandedHeightAnimation(
isAdvancedModeEnabled,
);

return (
<SubMenuTopBarContainer
title="Security"
Expand Down Expand Up @@ -38,11 +78,30 @@ export const SettingsSecurity = () => {
<SettingsSSOIdentitiesProvidersListCard />
</Section>
<Section>
<H2Title
title="Other"
description="Customize your workspace security"
/>
<SettingsSecurityOptionsList />
<AnimatePresence>
{isAdvancedModeEnabled && (
<motion.div
ref={contentRef}
initial="initial"
animate="animate"
exit="exit"
variants={motionAnimationVariants}
>
<StyledAdvancedContainer>
<StyledIconContainer>
<StyledIconTool size={12} color={MAIN_COLORS.yellow} />
</StyledIconContainer>
<StyledContainer>
<H2Title
title="Other"
description="Customize your workspace security"
/>
<SettingsSecurityOptionsList />
</StyledContainer>
</StyledAdvancedContainer>
</motion.div>
)}
</AnimatePresence>
</Section>
</SettingsPageContainer>
</SubMenuTopBarContainer>
Expand Down

0 comments on commit 3cc8d8d

Please sign in to comment.