Fix custom header text positioning to match originals
This commit is contained in:
parent
47d84fae2d
commit
92d7560362
1 changed files with 13 additions and 9 deletions
|
@ -14,7 +14,7 @@ type Options = {
|
||||||
preset?: Presets;
|
preset?: Presets;
|
||||||
};
|
};
|
||||||
|
|
||||||
const HeaderWrapper = styled.div<{ position: Options['position'] }>`
|
export const HeaderWrapper = styled.div<{ position: Options['position'] }>`
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: ${(props) =>
|
justify-content: ${(props) =>
|
||||||
props.position === 'right'
|
props.position === 'right'
|
||||||
|
@ -27,10 +27,12 @@ const HeaderWrapper = styled.div<{ position: Options['position'] }>`
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const TextHeaderWrapper = styled(_Text)<{ position: Options['position'] }>`
|
const HeaderText = styled(_Text)<{ position: Options['position'] }>`
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
color: var(--ag-header-foreground-color);
|
color: var(--ag-header-foreground-color);
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
|
line-height: inherit;
|
||||||
text-align: ${(props) =>
|
text-align: ${(props) =>
|
||||||
props.position === 'right'
|
props.position === 'right'
|
||||||
? 'flex-end'
|
? 'flex-end'
|
||||||
|
@ -82,13 +84,15 @@ export const GenericTableHeader = (
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TextHeaderWrapper
|
<HeaderWrapper position={position}>
|
||||||
overflow="hidden"
|
<HeaderText
|
||||||
position={position}
|
overflow="hidden"
|
||||||
weight={500}
|
position={position}
|
||||||
>
|
weight={500}
|
||||||
{children || displayName}
|
>
|
||||||
</TextHeaderWrapper>
|
{children || displayName}
|
||||||
|
</HeaderText>
|
||||||
|
</HeaderWrapper>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Reference in a new issue