* padding fix for header container * collapse menu hover and fade transition added * Update front/src/modules/ui/navbar/components/NavWorkspaceButton.tsx Co-authored-by: Emilien Chauvet <emilien.chauvet.enpc@gmail.com> * Update front/src/modules/ui/navbar/components/NavWorkspaceButton.tsx Co-authored-by: Emilien Chauvet <emilien.chauvet.enpc@gmail.com> * Update front/src/modules/ui/navbar/components/NavCollapseButton.tsx Co-authored-by: Emilien Chauvet <emilien.chauvet.enpc@gmail.com> * Update isVisible * Update requested proposals for naming --------- Co-authored-by: Emilien Chauvet <emilien.chauvet.enpc@gmail.com>
42 lines
1007 B
TypeScript
42 lines
1007 B
TypeScript
import { useState } from 'react';
|
|
import styled from '@emotion/styled';
|
|
|
|
import NavItemsContainer from './NavItemsContainer';
|
|
import NavWorkspaceButton from './NavWorkspaceButton';
|
|
import SupportChat from './SupportChat';
|
|
|
|
type OwnProps = {
|
|
children: React.ReactNode;
|
|
};
|
|
|
|
const StyledContainer = styled.div`
|
|
display: flex;
|
|
flex-direction: column;
|
|
height: 100%;
|
|
justify-content: space-between;
|
|
margin-bottom: ${({ theme }) => theme.spacing(2.5)};
|
|
width: 100%;
|
|
`;
|
|
|
|
export default function MainNavbar({ children }: OwnProps) {
|
|
const [isHovered, setIsHovered] = useState(false);
|
|
|
|
const handleHover = () => {
|
|
setIsHovered(true);
|
|
};
|
|
|
|
const handleMouseLeave = () => {
|
|
setIsHovered(false);
|
|
};
|
|
|
|
return (
|
|
<StyledContainer>
|
|
<div onMouseEnter={handleHover} onMouseLeave={handleMouseLeave}>
|
|
<NavWorkspaceButton hideCollapseButton={isHovered} />
|
|
<NavItemsContainer>{children}</NavItemsContainer>
|
|
</div>
|
|
<SupportChat />
|
|
</StyledContainer>
|
|
);
|
|
}
|