Skip to content

Commit

Permalink
commented NavigationBar and NavigationBarItem because we are not usin…
Browse files Browse the repository at this point in the history
…g them now.
  • Loading branch information
ketanMehtaa committed Oct 24, 2024
1 parent 7875e71 commit 4b0fbf6
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 65 deletions.
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
import styled from '@emotion/styled';
import { IconComponent } from 'twenty-ui';
// import styled from '@emotion/styled';
// import { IconComponent } from 'twenty-ui';

import { NavigationBarItem } from './NavigationBarItem';
// import { NavigationBarItem } from './NavigationBarItem';

const StyledContainer = styled.div`
display: flex;
gap: ${({ theme }) => theme.spacing(4)};
justify-content: center;
padding: ${({ theme }) => theme.spacing(3)};
z-index: 1001;
`;
// const StyledContainer = styled.div`
// display: flex;
// gap: ${({ theme }) => theme.spacing(4)};
// justify-content: center;
// padding: ${({ theme }) => theme.spacing(3)};
// z-index: 1001;
// `;

type NavigationBarProps = {
activeItemName: string;
items: { name: string; Icon: IconComponent; onClick: () => void }[];
};
// type NavigationBarProps = {
// activeItemName: string;
// items: { name: string; Icon: IconComponent; onClick: () => void }[];
// };

export const NavigationBar = ({
activeItemName,
items,
}: NavigationBarProps) => (
<StyledContainer>
{items.map(({ Icon, name, onClick }) => (
<NavigationBarItem
key={name}
Icon={Icon}
isActive={activeItemName === name}
onClick={onClick}
/>
))}
</StyledContainer>
);
// export const NavigationBar = ({
// activeItemName,
// items,
// }: NavigationBarProps) => (
// <StyledContainer>
// {items.map(({ Icon, name, onClick }) => (
// <NavigationBarItem
// key={name}
// Icon={Icon}
// isActive={activeItemName === name}
// onClick={onClick}
// />
// ))}
// </StyledContainer>
// );
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
import { IconComponent } from 'twenty-ui';
// import { useTheme } from '@emotion/react';
// import styled from '@emotion/styled';
// import { IconComponent } from 'twenty-ui';

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)};
// 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};
}
`;
// &:hover {
// background-color: ${({ theme }) => theme.background.transparent.light};
// }
// `;

type NavigationBarItemProps = {
Icon: IconComponent;
isActive: boolean;
onClick: () => void;
};
// type NavigationBarItemProps = {
// Icon: IconComponent;
// isActive: boolean;
// onClick: () => void;
// };

export const NavigationBarItem = ({
Icon,
isActive,
onClick,
}: NavigationBarItemProps) => {
const theme = useTheme();
// 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>
);
};
// return (
// <StyledIconButton isActive={isActive} onClick={onClick}>
// <Icon color={theme.color.gray50} size={theme.icon.size.lg} />
// </StyledIconButton>
// );
// };

0 comments on commit 4b0fbf6

Please sign in to comment.