Skip to content

Commit

Permalink
feat(bulk-import): update bulk import icon (janus-idp#1826)
Browse files Browse the repository at this point in the history
  • Loading branch information
debsmita1 authored Jun 20, 2024
1 parent 56951e5 commit 32c5553
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 8 deletions.
2 changes: 2 additions & 0 deletions plugins/bulk-import/dev/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { createDevApp } from '@backstage/dev-utils';

import { createDevAppThemes } from '@redhat-developer/red-hat-developer-hub-theme';

import { icon } from '../src/components/BulkImportIcon';
import { BulkImportPage, bulkImportPlugin } from '../src/plugin';

createDevApp()
Expand All @@ -13,5 +14,6 @@ createDevApp()
element: <BulkImportPage />,
title: 'Bulk import',
path: '/bulk-import/repositories',
icon,
})
.render();
19 changes: 12 additions & 7 deletions plugins/bulk-import/src/components/BulkImportIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
import React from 'react';

import { SidebarItem } from '@backstage/core-components';
import { IconComponent } from '@backstage/core-plugin-api';

import LibraryAddOutlinedIcon from '@mui/icons-material/LibraryAddOutlined';
import { getImageForIconClass } from '../utils/icons';

export const icon = () => {
return (
<img
src={getImageForIconClass('icon-bulk-import-white')}
alt="bulk import icon"
style={{ height: '25px' }}
/>
);
};

export const BulkImportIcon = () => {
// permission logic

return (
<SidebarItem
text="Bulk import"
to="bulk-import/repositories"
icon={LibraryAddOutlinedIcon as IconComponent}
/>
<SidebarItem text="Bulk import" to="bulk-import/repositories" icon={icon} />
);
};
54 changes: 54 additions & 0 deletions plugins/bulk-import/src/images/BulkImportIcon-White.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion plugins/bulk-import/src/utils/icons.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import approvalToolBlackImg from '../images/ApprovalTool_Black.svg';
import approvalToolWhiteImg from '../images/ApprovalTool_White.svg';
import bulkImportWhiteImg from '../images/BulkImportIcon-White.svg';
import chooseRepositoriesBlackImg from '../images/ChooseRepositories_Black.svg';
import chooseRepositoriesWhiteImg from '../images/ChooseRepositories_White.svg';
import editPullRequestBlackImg from '../images/EditPullRequest_Black.svg';
Expand All @@ -19,7 +20,8 @@ const logos = new Map<string, any>()
.set('icon-choose-repositories-white', chooseRepositoriesWhiteImg)
.set('icon-generate-cataloginfo-white', generateCatalogInfoWhiteImg)
.set('icon-track-status-white', trackStatusWhiteImg)
.set('icon-approval-tool-white', approvalToolWhiteImg);
.set('icon-approval-tool-white', approvalToolWhiteImg)
.set('icon-bulk-import-white', bulkImportWhiteImg);

export const getImageForIconClass = (iconClass: string): string => {
return logos.get(iconClass);
Expand Down

0 comments on commit 32c5553

Please sign in to comment.