Skip to content

Commit

Permalink
change panel close icon
Browse files Browse the repository at this point in the history
  • Loading branch information
daniele-mng committed Sep 10, 2024
1 parent c35f33d commit 612989b
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
16 changes: 16 additions & 0 deletions src/web/components/icon/XIcon.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/* SPDX-FileCopyrightText: 2024 Greenbone AG
*
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

import withSvgIcon from './withSvgIcon';

import {X as Icon} from 'lucide-react';

import IconWithStrokeWidth from 'web/components/icon/IconWithStrokeWidth';

const XIcon = withSvgIcon()(props => (
<IconWithStrokeWidth IconComponent={Icon} {...props} />
));

export default XIcon;
14 changes: 14 additions & 0 deletions src/web/components/icon/__tests__/XIcon.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* SPDX-FileCopyrightText: 2024 Greenbone AG
*
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

import {describe} from '@gsa/testing';

import {testIcon} from 'web/components/icon/testing';

import XIcon from '../XIcon';

describe('XIcon component tests', () => {
testIcon(XIcon);
});
6 changes: 3 additions & 3 deletions src/web/components/panel/infopanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


import React from 'react';

import styled from 'styled-components';

import {isDefined} from 'gmp/utils/identity';

import DeleteIcon from 'web/components/icon/deleteicon';
import XIcon from 'web/components/icon/XIcon';

import {styledExcludeProps} from 'web/utils/styledConfig';
import PropTypes from 'web/utils/proptypes';
Expand Down Expand Up @@ -73,7 +72,7 @@ const InfoPanel = ({
{heading}
{isDefined(onCloseClick) && (
<Button data-testid="panel-close-button" onClick={onCloseClick}>
<DeleteIcon />
<XIcon />
</Button>
)}
</Heading>
Expand All @@ -85,6 +84,7 @@ const InfoPanel = ({
};

InfoPanel.propTypes = {
children: PropTypes.element,
footer: PropTypes.oneOfType([PropTypes.element, PropTypes.string]),
heading: PropTypes.oneOfType([PropTypes.element, PropTypes.string]),
isWarning: PropTypes.bool,
Expand Down

0 comments on commit 612989b

Please sign in to comment.