Refactor/new menu item (#1448)

* wip

* finished

* Added disabled

* Fixed disabled

* Finished cleaning

* Minor fixes from merge

* Added docs

* Added PascalCase

* Fix from review

* Fixes from merge

* Fix lint

* Fixed storybook tests
This commit is contained in:
Lucas Bordeau
2023-09-06 16:41:26 +02:00
committed by GitHub
parent 5c7660f588
commit 28ca9a9e49
96 changed files with 816 additions and 918 deletions

View File

@ -1,9 +1,11 @@
import { ReactNode } from 'react';
import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
import { IconComponent } from '@/ui/icon/types/IconComponent';
type OwnProps = {
viewName: string;
viewIcon?: ReactNode;
ViewIcon?: IconComponent;
};
const StyledTitle = styled.div`
@ -32,10 +34,13 @@ const StyledText = styled.span`
white-space: nowrap;
`;
export function ColumnHead({ viewName, viewIcon }: OwnProps) {
export function ColumnHead({ viewName, ViewIcon }: OwnProps) {
const theme = useTheme();
return (
<StyledTitle>
<StyledIcon>{viewIcon}</StyledIcon>
<StyledIcon>
{ViewIcon && <ViewIcon size={theme.icon.size.md} />}
</StyledIcon>
<StyledText>{viewName}</StyledText>
</StyledTitle>
);