Move ScmIntegrationIcon

Signed-off-by: Oliver Sand <oliver.sand@sda-se.com>
This commit is contained in:
Oliver Sand
2021-06-08 13:31:45 +02:00
parent eec173625f
commit f4e3ac5ce6
12 changed files with 118 additions and 20 deletions
@@ -26,8 +26,16 @@ import {
InfoCardVariants,
useApi,
} from '@backstage/core';
import { scmIntegrationsApiRef } from '@backstage/integration-react';
import { getEntityRelations, useEntity } from '@backstage/plugin-catalog-react';
import {
ScmIntegrationIcon,
scmIntegrationsApiRef,
} from '@backstage/integration-react';
import {
getEntityMetadataEditUrl,
getEntityRelations,
getEntitySourceLocation,
useEntity,
} from '@backstage/plugin-catalog-react';
import {
Card,
CardContent,
@@ -40,9 +48,7 @@ import DocsIcon from '@material-ui/icons/Description';
import EditIcon from '@material-ui/icons/Edit';
import ExtensionIcon from '@material-ui/icons/Extension';
import React from 'react';
import { getEntityMetadataEditUrl, getEntitySourceLocation } from '../../utils';
import { AboutContent } from './AboutContent';
import { ScmIntegrationIcon } from './ScmIntegrationIcon';
const useStyles = makeStyles({
gridItemCard: {
@@ -1,31 +0,0 @@
/*
* Copyright 2020 Spotify AB
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import CodeIcon from '@material-ui/icons/Code';
import GitHubIcon from '@material-ui/icons/GitHub';
import React from 'react';
export const ScmIntegrationIcon = ({ type }: { type?: string }) => {
// TODO: In the future we might want to support more types here as a GitLab or
// Bitbucket icons were requested here in the past, or even use the icon
// customization feature of the app. But material UI react doesn't provide more.
switch (type) {
case 'github':
return <GitHubIcon />;
default:
return <CodeIcon />;
}
};
@@ -17,4 +17,3 @@
export { AboutCard } from './AboutCard';
export { AboutContent } from './AboutContent';
export { AboutField } from './AboutField';
export { ScmIntegrationIcon } from './ScmIntegrationIcon';