Skip to content

Commit

Permalink
Merge pull request #1153 from kubeshop/razvantopliceanu/fix/add-new-r…
Browse files Browse the repository at this point in the history
…esource-disabled

fix: add new resource button disabled color when in preview mode
  • Loading branch information
topliceanurazvan authored Jan 25, 2022
2 parents c351b02 + 5b28ee4 commit c5984b8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ export const FiltersNumber = styled.div`
margin-left: 5px;
`;

export const PlusButton = styled(Button)<{$highlighted?: boolean}>`
${({$highlighted}) => `
export const PlusButton = styled(Button)<{$highlighted: boolean; $disabled: boolean}>`
${({$disabled, $highlighted}) => `
border-radius: ${$highlighted ? '100%' : 'inherit'} !important;
color: ${$highlighted ? Colors.whitePure : Colors.blue6} !important`};
color: ${$highlighted ? Colors.whitePure : $disabled ? 'rgba(255, 255, 255, 0.3)' : Colors.blue6} !important`};
&:after {
${({$highlighted}) => `
Expand Down
11 changes: 6 additions & 5 deletions src/components/organisms/NavigatorPane/NavigatorPane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,14 @@ const NavPane: React.FC = () => {
</MonoPaneTitle>
<S.TitleBarRightButtons>
<S.PlusButton
className={highlightedItems.createResource ? 'animated-highlight' : ''}
$disabled={!isFolderOpen || isInPreviewMode}
$highlighted={highlightedItems.createResource}
disabled={!isFolderOpen || isInClusterMode || isInPreviewMode}
onClick={onClickNewResource}
type="link"
size="small"
className={highlightedItems.createResource ? 'animated-highlight' : ''}
disabled={!isFolderOpen || isInPreviewMode}
icon={<PlusOutlined />}
size="small"
type="link"
onClick={onClickNewResource}
/>
<Badge count={appliedFilters.length} size="small" offset={[-2, 2]} color={Colors.greenOkay}>
<Button
Expand Down

0 comments on commit c5984b8

Please sign in to comment.