Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Icons and main menu and active tabs #4098

Merged
merged 4 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/web/components/icon/IconWithStrokeWidth.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* SPDX-FileCopyrightText: 2024 Greenbone AG
*
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

import PropTypes from 'prop-types';

const IconWithStrokeWidth = ({IconComponent, strokeWidth = 1.5, ...props}) => {
return <IconComponent {...props} strokeWidth={strokeWidth} />;
};

IconWithStrokeWidth.propTypes = {
IconComponent: PropTypes.elementType.isRequired,
strokeWidth: PropTypes.number,
};

export default IconWithStrokeWidth;
7 changes: 5 additions & 2 deletions src/web/components/icon/alerticon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@

import withSvgIcon from './withSvgIcon';

import Icon from './svg/alert.svg';
import {Megaphone as Icon} from 'lucide-react';
import IconWithStrokeWidth from 'web/components/icon/IconWithStrokeWidth';

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

export default AlertIcon;

Expand Down
7 changes: 5 additions & 2 deletions src/web/components/icon/alterableicon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@

import withSvgIcon from './withSvgIcon';

import Icon from './svg/alterable.svg';
import {FilePenLine as Icon} from 'lucide-react';
import IconWithStrokeWidth from 'web/components/icon/IconWithStrokeWidth';

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

export default AlterableIcon;

Expand Down
8 changes: 6 additions & 2 deletions src/web/components/icon/auditicon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@

import withSvgIcon from './withSvgIcon';

import Icon from './svg/audit.svg';
import {ClipboardCheck as Icon} from 'lucide-react';

const AuditIcon = withSvgIcon()(Icon);
import IconWithStrokeWidth from 'web/components/icon/IconWithStrokeWidth';

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

export default AuditIcon;

Expand Down
7 changes: 5 additions & 2 deletions src/web/components/icon/calendaricon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@

import withSvgIcon from './withSvgIcon';

import Icon from './svg/calendar.svg';
import {Calendar as Icon} from 'lucide-react';
import IconWithStrokeWidth from 'web/components/icon/IconWithStrokeWidth';

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

export default CalendarIcon;

Expand Down
8 changes: 6 additions & 2 deletions src/web/components/icon/credentialicon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@

import withSvgIcon from './withSvgIcon';

import Icon from './svg/credential.svg';
import {KeyRound as Icon} from 'lucide-react';

const CredentialIcon = withSvgIcon()(Icon);
import IconWithStrokeWidth from 'web/components/icon/IconWithStrokeWidth';

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

export default CredentialIcon;

Expand Down
8 changes: 6 additions & 2 deletions src/web/components/icon/dashboardicon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@

import withSvgIcon from './withSvgIcon';

import Icon from './svg/dashboard.svg';
import {BarChart3 as Icon} from 'lucide-react';

const DashboardIcon = withSvgIcon()(Icon);
import IconWithStrokeWidth from 'web/components/icon/IconWithStrokeWidth';

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

export default DashboardIcon;

Expand Down
8 changes: 6 additions & 2 deletions src/web/components/icon/deleteicon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ import SelectionType from 'web/utils/selectiontype';

import withSvgIcon from './withSvgIcon';

import Icon from './svg/delete.svg';
import {CircleX as Icon} from 'lucide-react';

const DeleteSvgIcon = withSvgIcon()(Icon);
import IconWithStrokeWidth from 'web/components/icon/IconWithStrokeWidth';

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

const DeleteIcon = ({selectionType, title, ...props}) => {
if (!isDefined(title)) {
Expand Down
5 changes: 3 additions & 2 deletions src/web/components/icon/detailsicon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ import React from 'react';

import SvgIcon from './svgicon';

import Icon from './svg/details.svg';
import {ZoomIn as Icon} from 'lucide-react';
import IconWithStrokeWidth from 'web/components/icon/IconWithStrokeWidth';

const DetailsIcon = props => (
<SvgIcon {...props}>
<Icon />
<IconWithStrokeWidth IconComponent={Icon} {...props} />
</SvgIcon>
);

Expand Down
8 changes: 6 additions & 2 deletions src/web/components/icon/disableicon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@

import withSvgIcon from './withSvgIcon';

import Icon from './svg/disable.svg';
import {PowerOff as Icon} from 'lucide-react';

const DisableIcon = withSvgIcon()(Icon);
import IconWithStrokeWidth from 'web/components/icon/IconWithStrokeWidth';

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

export default DisableIcon;

Expand Down
9 changes: 6 additions & 3 deletions src/web/components/icon/downloadicon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


import withSvgIcon from './withSvgIcon';

import Icon from './svg/download.svg';
import {Download as Icon} from 'lucide-react';

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

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

export default DownloadIcon;

Expand Down
8 changes: 6 additions & 2 deletions src/web/components/icon/editicon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@

import withSvgIcon from './withSvgIcon';

import Icon from './svg/edit.svg';
import {Pencil as Icon} from 'lucide-react';

const EditIcon = withSvgIcon()(Icon);
import IconWithStrokeWidth from 'web/components/icon/IconWithStrokeWidth';

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

export default EditIcon;

Expand Down
8 changes: 6 additions & 2 deletions src/web/components/icon/enableicon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@

import withSvgIcon from './withSvgIcon';

import Icon from './svg/enable.svg';
import {Power as Icon} from 'lucide-react';

const EnableIcon = withSvgIcon()(Icon);
import IconWithStrokeWidth from 'web/components/icon/IconWithStrokeWidth';

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

export default EnableIcon;

Expand Down
9 changes: 6 additions & 3 deletions src/web/components/icon/exporticon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/


import React from 'react';

import _ from 'gmp/locale';
Expand All @@ -14,9 +13,13 @@ import SelectionType from 'web/utils/selectiontype';

import withSvgIcon from './withSvgIcon';

import Icon from './svg/export.svg';
import {FileOutput as Icon} from 'lucide-react';

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

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

const ExportIcon = ({selectionType, title, ...other}) => {
let download_title = title;
Expand Down
7 changes: 5 additions & 2 deletions src/web/components/icon/feedicon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@

import withSvgIcon from './withSvgIcon';

import Icon from './svg/feed.svg';
import {Rss as Icon} from 'lucide-react';
import IconWithStrokeWidth from 'web/components/icon/IconWithStrokeWidth';

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

export default FeedIcon;

Expand Down
8 changes: 6 additions & 2 deletions src/web/components/icon/filtericon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@

import withSvgIcon from './withSvgIcon';

import Icon from './svg/filter.svg';
import {Filter as Icon} from 'lucide-react';

const FilterIcon = withSvgIcon()(Icon);
import IconWithStrokeWidth from 'web/components/icon/IconWithStrokeWidth';

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

export default FilterIcon;

Expand Down
8 changes: 6 additions & 2 deletions src/web/components/icon/firsticon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@

import withSvgIcon from './withSvgIcon';

import Icon from './svg/first.svg';
import {ChevronFirst as Icon} from 'lucide-react';

const FirstIcon = withSvgIcon()(Icon);
import IconWithStrokeWidth from 'web/components/icon/IconWithStrokeWidth';

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

export default FirstIcon;

Expand Down
7 changes: 5 additions & 2 deletions src/web/components/icon/foldicon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@

import withSvgIcon from './withSvgIcon';

import FoldSvg from './svg/fold.svg';
import {Folder as Icon} from 'lucide-react';
import IconWithStrokeWidth from 'web/components/icon/IconWithStrokeWidth';

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

export default FoldIcon;

Expand Down
8 changes: 6 additions & 2 deletions src/web/components/icon/groupicon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@

import withSvgIcon from './withSvgIcon';

import Icon from './svg/group.svg';
import {Users as Icon} from 'lucide-react';

const GroupIcon = withSvgIcon()(Icon);
import IconWithStrokeWidth from 'web/components/icon/IconWithStrokeWidth';

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

export default GroupIcon;

Expand Down
8 changes: 6 additions & 2 deletions src/web/components/icon/helpicon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@

import withSvgIcon from './withSvgIcon';

import Icon from './svg/help.svg';
import {HelpCircle as Icon} from 'lucide-react';

const HelpIcon = withSvgIcon()(Icon);
import IconWithStrokeWidth from 'web/components/icon/IconWithStrokeWidth';

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

export default HelpIcon;

Expand Down
8 changes: 6 additions & 2 deletions src/web/components/icon/importicon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@

import withSvgIcon from './withSvgIcon';

import Icon from './svg/import.svg';
import {FileInput as Icon} from 'lucide-react';

const ImportIcon = withSvgIcon()(Icon);
import IconWithStrokeWidth from 'web/components/icon/IconWithStrokeWidth';

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

export default ImportIcon;

Expand Down
8 changes: 6 additions & 2 deletions src/web/components/icon/infoicon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@

import withSvgIcon from './withSvgIcon';

import Icon from './svg/info.svg';
import {Info as Icon} from 'lucide-react';

const InfoIcon = withSvgIcon()(Icon);
import IconWithStrokeWidth from 'web/components/icon/IconWithStrokeWidth';

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

export default InfoIcon;

Expand Down
8 changes: 6 additions & 2 deletions src/web/components/icon/keyicon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@

import withSvgIcon from './withSvgIcon';

import Icon from './svg/key.svg';
import {Key as Icon} from 'lucide-react';

const KeyIcon = withSvgIcon()(Icon);
import IconWithStrokeWidth from 'web/components/icon/IconWithStrokeWidth';

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

export default KeyIcon;

Expand Down
8 changes: 6 additions & 2 deletions src/web/components/icon/lasticon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@

import withSvgIcon from './withSvgIcon';

import Icon from './svg/last.svg';
import {ChevronLast as Icon} from 'lucide-react';

const LastIcon = withSvgIcon()(Icon);
import IconWithStrokeWidth from 'web/components/icon/IconWithStrokeWidth';

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

export default LastIcon;

Expand Down
Loading
Loading