Skip to content

Commit

Permalink
fix: dry run config edit icon
Browse files Browse the repository at this point in the history
  • Loading branch information
devcatalin committed Oct 11, 2023
1 parent e2f55cd commit 176566e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,20 @@ const HelmConfigRenderer: React.FC<IProps> = props => {
: undefined
);

const onClickEdit = useCallback(() => {
if (!previewConfiguration || !helmChart) {
return;
}
const onClickEdit = useCallback<React.MouseEventHandler<HTMLSpanElement>>(
e => {
e.stopPropagation();

dispatch(
openPreviewConfigurationEditor({helmChartId: helmChart.id, previewConfigurationId: previewConfiguration.id})
);
}, [previewConfiguration, helmChart, dispatch]);
if (!previewConfiguration || !helmChart) {
return;
}

dispatch(
openPreviewConfigurationEditor({helmChartId: helmChart.id, previewConfigurationId: previewConfiguration.id})
);
},
[previewConfiguration, helmChart, dispatch]
);

if (!previewConfiguration) {
return null;
Expand All @@ -58,7 +63,7 @@ const HelmConfigRenderer: React.FC<IProps> = props => {
>
<S.ItemName isPreviewed={mightBePreview}>{previewConfiguration.name}</S.ItemName>
{isOptimisticLoading && <S.ReloadIcon spin />}
<S.EditIcon onClick={onClickEdit} />
<S.EditIcon $isPreviewed={mightBePreview} onClick={onClickEdit} />
{renderPreviewControls()}
</S.ItemContainer>
);
Expand Down
4 changes: 2 additions & 2 deletions src/components/organisms/ExplorerPane/DryRunsPane/styled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ export const ItemName = styled.div<ItemNameProps>`
}};
`;

export const EditIcon = styled(EditOutlined)`
color: ${Colors.blackPure};
export const EditIcon = styled(EditOutlined)<{$isPreviewed: boolean}>`
color: ${props => (props.$isPreviewed ? Colors.blackPure : Colors.blue6)};
margin-left: 8px;
`;

Expand Down

0 comments on commit 176566e

Please sign in to comment.