@ -47,14 +47,16 @@ type SettingsNavigationItem = {
|
|||||||
indentationLevel?: NavigationDrawerItemIndentationLevel;
|
indentationLevel?: NavigationDrawerItemIndentationLevel;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const StyledNavigationDrawerSection = styled(NavigationDrawerSection)`
|
||||||
|
margin-bottom: ${({ theme }) => theme.spacing(3)};
|
||||||
|
`;
|
||||||
|
|
||||||
const StyledIconContainer = styled.div`
|
const StyledIconContainer = styled.div`
|
||||||
border-right: 1px solid ${MAIN_COLORS.yellow};
|
border-right: 1px solid ${MAIN_COLORS.yellow};
|
||||||
display: flex;
|
|
||||||
width: 16px;
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: ${({ theme }) => theme.spacing(-5)};
|
left: ${({ theme }) => theme.spacing(-5)};
|
||||||
margin-top: ${({ theme }) => theme.spacing(2)};
|
margin-top: ${({ theme }) => theme.spacing(2)};
|
||||||
height: 90%;
|
height: 75%;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const StyledDeveloperSection = styled.div`
|
const StyledDeveloperSection = styled.div`
|
||||||
@ -119,7 +121,7 @@ export const SettingsNavigationDrawerItems = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<NavigationDrawerSection>
|
<StyledNavigationDrawerSection>
|
||||||
<NavigationDrawerSectionTitle label="User" />
|
<NavigationDrawerSectionTitle label="User" />
|
||||||
<SettingsNavigationDrawerItem
|
<SettingsNavigationDrawerItem
|
||||||
label="Profile"
|
label="Profile"
|
||||||
@ -152,8 +154,8 @@ export const SettingsNavigationDrawerItems = () => {
|
|||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</NavigationDrawerItemGroup>
|
</NavigationDrawerItemGroup>
|
||||||
</NavigationDrawerSection>
|
</StyledNavigationDrawerSection>
|
||||||
<NavigationDrawerSection>
|
<StyledNavigationDrawerSection>
|
||||||
<NavigationDrawerSectionTitle label="Workspace" />
|
<NavigationDrawerSectionTitle label="Workspace" />
|
||||||
<SettingsNavigationDrawerItem
|
<SettingsNavigationDrawerItem
|
||||||
label="General"
|
label="General"
|
||||||
@ -190,7 +192,7 @@ export const SettingsNavigationDrawerItems = () => {
|
|||||||
Icon={IconCode}
|
Icon={IconCode}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</NavigationDrawerSection>
|
</StyledNavigationDrawerSection>
|
||||||
<AnimatePresence>
|
<AnimatePresence>
|
||||||
{isAdvancedModeEnabled && (
|
{isAdvancedModeEnabled && (
|
||||||
<motion.div
|
<motion.div
|
||||||
@ -204,7 +206,7 @@ export const SettingsNavigationDrawerItems = () => {
|
|||||||
<StyledIconContainer>
|
<StyledIconContainer>
|
||||||
<StyledIconTool size={12} color={MAIN_COLORS.yellow} />
|
<StyledIconTool size={12} color={MAIN_COLORS.yellow} />
|
||||||
</StyledIconContainer>
|
</StyledIconContainer>
|
||||||
<NavigationDrawerSection>
|
<StyledNavigationDrawerSection>
|
||||||
<NavigationDrawerSectionTitle label="Developers" />
|
<NavigationDrawerSectionTitle label="Developers" />
|
||||||
<SettingsNavigationDrawerItem
|
<SettingsNavigationDrawerItem
|
||||||
label="API & Webhooks"
|
label="API & Webhooks"
|
||||||
@ -218,12 +220,12 @@ export const SettingsNavigationDrawerItems = () => {
|
|||||||
Icon={IconFunction}
|
Icon={IconFunction}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</NavigationDrawerSection>
|
</StyledNavigationDrawerSection>
|
||||||
</StyledDeveloperSection>
|
</StyledDeveloperSection>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
)}
|
)}
|
||||||
</AnimatePresence>
|
</AnimatePresence>
|
||||||
<NavigationDrawerSection>
|
<StyledNavigationDrawerSection>
|
||||||
<NavigationDrawerSectionTitle label="Other" />
|
<NavigationDrawerSectionTitle label="Other" />
|
||||||
<SettingsNavigationDrawerItem
|
<SettingsNavigationDrawerItem
|
||||||
label="Releases"
|
label="Releases"
|
||||||
@ -235,7 +237,7 @@ export const SettingsNavigationDrawerItems = () => {
|
|||||||
onClick={signOut}
|
onClick={signOut}
|
||||||
Icon={IconDoorEnter}
|
Icon={IconDoorEnter}
|
||||||
/>
|
/>
|
||||||
</NavigationDrawerSection>
|
</StyledNavigationDrawerSection>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -6,15 +6,11 @@ const transitionValues = {
|
|||||||
opactity: { duration: 0.2 },
|
opactity: { duration: 0.2 },
|
||||||
height: { duration: 0.4 },
|
height: { duration: 0.4 },
|
||||||
},
|
},
|
||||||
transitionEnd: {
|
|
||||||
overflow: 'visible',
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const commonStyles = {
|
const commonStyles = {
|
||||||
opacity: 0,
|
opacity: 0,
|
||||||
height: 0,
|
height: 0,
|
||||||
overflow: 'hidden',
|
|
||||||
...transitionValues,
|
...transitionValues,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -29,7 +25,6 @@ const advancedSectionAnimationConfig = (
|
|||||||
opacity: 1,
|
opacity: 1,
|
||||||
height: isExpanded ? measuredHeight : 0,
|
height: isExpanded ? measuredHeight : 0,
|
||||||
...transitionValues,
|
...transitionValues,
|
||||||
overflow: 'hidden',
|
|
||||||
},
|
},
|
||||||
exit: {
|
exit: {
|
||||||
...commonStyles,
|
...commonStyles,
|
||||||
|
|||||||
@ -49,12 +49,10 @@ const StyledContainer = styled.div<{ isSubMenu?: boolean }>`
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
const StyledItemsContainer = styled.div<{ isSubMenu?: boolean }>`
|
const StyledItemsContainer = styled.div`
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
margin-bottom: auto;
|
margin-bottom: auto;
|
||||||
gap: ${({ theme }) => theme.spacing(3)};
|
|
||||||
${({ isSubMenu }) => (!isSubMenu ? 'overflow-y: auto' : '')};
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const NavigationDrawer = ({
|
export const NavigationDrawer = ({
|
||||||
@ -111,9 +109,7 @@ export const NavigationDrawer = ({
|
|||||||
showCollapseButton={isHovered}
|
showCollapseButton={isHovered}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<StyledItemsContainer isSubMenu={isSubMenu}>
|
<StyledItemsContainer>{children}</StyledItemsContainer>
|
||||||
{children}
|
|
||||||
</StyledItemsContainer>
|
|
||||||
{footer}
|
{footer}
|
||||||
</StyledContainer>
|
</StyledContainer>
|
||||||
</StyledAnimatedContainer>
|
</StyledAnimatedContainer>
|
||||||
|
|||||||
Reference in New Issue
Block a user