mirror of
https://github.com/lingble/twenty.git
synced 2025-11-01 13:17:57 +00:00
This PR was created by [GitStart](https://gitstart.com/) to address the requirements from this ticket: [TWNTY-7537](https://clients.gitstart.com/twenty/5449/tickets/TWNTY-7537). --- ### Description - Move navigation-bar components to `twenty-ui` Fixes twentyhq/private-issues#81 Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com> Co-authored-by: Charles Bochet <charles@twenty.com>
42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
import { useTheme } from '@emotion/react';
|
|
import styled from '@emotion/styled';
|
|
import { IconComponent } from '@ui/display/icon/types/IconComponent';
|
|
|
|
const StyledIconButton = styled.div<{ isActive?: boolean }>`
|
|
align-items: center;
|
|
background-color: ${({ isActive, theme }) =>
|
|
isActive ? theme.background.transparent.light : 'none'};
|
|
border-radius: ${({ theme }) => theme.spacing(1)};
|
|
cursor: pointer;
|
|
display: flex;
|
|
height: ${({ theme }) => theme.spacing(10)};
|
|
justify-content: center;
|
|
transition: background-color ${({ theme }) => theme.animation.duration.fast}s
|
|
ease;
|
|
width: ${({ theme }) => theme.spacing(10)};
|
|
|
|
&:hover {
|
|
background-color: ${({ theme }) => theme.background.transparent.light};
|
|
}
|
|
`;
|
|
|
|
type NavigationBarItemProps = {
|
|
Icon: IconComponent;
|
|
isActive: boolean;
|
|
onClick: () => void;
|
|
};
|
|
|
|
export const NavigationBarItem = ({
|
|
Icon,
|
|
isActive,
|
|
onClick,
|
|
}: NavigationBarItemProps) => {
|
|
const theme = useTheme();
|
|
|
|
return (
|
|
<StyledIconButton isActive={isActive} onClick={onClick}>
|
|
<Icon color={theme.color.gray50} size={theme.icon.size.lg} />
|
|
</StyledIconButton>
|
|
);
|
|
};
|