Skip to content

Commit

Permalink
Merge pull request #1096 from kubeshop/devcatalin/fix/section-title
Browse files Browse the repository at this point in the history
fix section header padding and quick preview padding
  • Loading branch information
devcatalin authored Jan 22, 2022
2 parents 57edded + 0b9b190 commit dd67ef5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/components/molecules/QuickActionPreview/styled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const PreviewSpan = styled.span<{isItemSelected: boolean}>`
font-size: 12px;
cursor: pointer;
color: ${props => (props.isItemSelected ? Colors.blackPure : Colors.blue6)};
margin-left: 5px;
margin-right: 15px;
`;

Expand Down
6 changes: 5 additions & 1 deletion src/components/molecules/SectionRenderer/SectionHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ function SectionHeader(props: SectionHeaderProps) {
onMouseEnter={() => setIsHovered(true)}
onMouseLeave={() => setIsHovered(false)}
>
<S.NameContainer isHovered={isHovered} $hasCustomNameDisplay={Boolean(NameDisplay.Component)}>
<S.NameContainer
isHovered={isHovered}
isCheckable={Boolean(sectionBlueprint.builder?.makeCheckable)}
$hasCustomNameDisplay={Boolean(NameDisplay.Component)}
>
{sectionInstance.checkable &&
sectionInstance.isInitialized &&
(sectionBlueprint.customization?.isCheckVisibleOnHover
Expand Down
3 changes: 2 additions & 1 deletion src/components/molecules/SectionRenderer/styled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Colors, {FontColors} from '@styles/Colors';

type NameContainerProps = {
isHovered?: boolean;
isCheckable?: boolean;
$hasCustomNameDisplay: boolean;
};

Expand All @@ -27,7 +28,7 @@ export const NameContainer = styled.span<NameContainerProps>`
display: flex;
align-items: center;
width: 100%;
padding-left: 24px;
${props => props.isCheckable && `padding-left: 24px;`}
${props => !props.isHovered && 'padding-right: 30px;'}
${props => props.$hasCustomNameDisplay && 'padding: 0;'}
`;
Expand Down

0 comments on commit dd67ef5

Please sign in to comment.