Client: AsideHeader: Added removal of border by condition.

This commit is contained in:
Tatiana Lopaeva 2024-08-23 18:47:00 +03:00
parent fc9b768f32
commit 73a5e191f5
4 changed files with 23 additions and 10 deletions

View File

@ -146,14 +146,18 @@ const StyledHeaderContainer = styled.div`
text-overflow: ellipsis;
white-space: nowrap;
}
::after {
content: "";
border-bottom: ${(props) =>
`1px solid ${props.theme.modalDialog.headerBorderColor}`};
width: calc(100% + 32px);
position: absolute;
inset-inline-end: -16px;
bottom: 0;
}
${(props) =>
!props.withoutBorder &&
css`
::after {
content: "";
border-bottom: ${(props) =>
`1px solid ${props.theme.modalDialog.headerBorderColor}`};
width: calc(100% + 32px);
position: absolute;
inset-inline-end: -16px;
bottom: 0;
}
`}
`;
export { StyledAside, StyledHeaderContainer };

View File

@ -53,6 +53,7 @@ export interface AsideHeaderProps {
onCloseClick?: () => void;
style?: React.CSSProperties;
isLoading?: boolean;
withoutBorder?: boolean;
}
export interface StyledAsideProps {
visible: boolean;

View File

@ -45,6 +45,7 @@ const AsideHeader = (props: AsideHeaderProps) => {
id,
style,
isLoading,
withoutBorder = false,
} = props;
const backButtonRender = (
@ -101,7 +102,12 @@ const AsideHeader = (props: AsideHeaderProps) => {
const loaderComponent = <RectangleSkeleton height="28" width="100%" />;
return (
<StyledHeaderContainer id={id} className={className} style={style}>
<StyledHeaderContainer
id={id}
className={className}
style={style}
withoutBorder={withoutBorder}
>
{isLoading ? loaderComponent : mainComponent}
</StyledHeaderContainer>
);

View File

@ -35,6 +35,7 @@ const Header = React.memo(
onCloseClick,
withoutBackButton,
headerLabel,
withoutBorder,
}: HeaderProps) => {
return (
<AsideHeader
@ -44,6 +45,7 @@ const Header = React.memo(
}
onBackClick={onBackClick}
onCloseClick={onCloseClick}
withoutBorder={withoutBorder}
/>
);
},