Added working link button

This commit is contained in:
Sebastian Qvarfordt
2020-06-04 17:05:51 +02:00
parent 2020979780
commit c2369b7be6
+14 -3
View File
@@ -17,6 +17,13 @@ import React from 'react';
import { Component } from './component';
import { Entity, Location } from '@backstage/catalog-model';
import Edit from '@material-ui/icons/Edit';
import IconButton from '@material-ui/core/IconButton';
import { styled } from '@material-ui/core/styles';
const DescriptionWrapper = styled('span')({
display: 'flex',
alignItems: 'center',
});
export function envelopeToComponent(
envelope: Entity,
@@ -26,10 +33,14 @@ export function envelopeToComponent(
name: envelope.metadata?.name ?? '',
kind: envelope.kind ?? 'unknown',
description: (
<span style={{ display: 'flex', alignItems: 'center' }}>
<DescriptionWrapper>
{envelope.metadata?.annotations?.description ?? 'placeholder'}
<Edit style={{ fontSize: 20, paddingLeft: '5px' }} />
</span>
<a href={location?.target}>
<IconButton size="small">
<Edit fontSize="small" />
</IconButton>
</a>
</DescriptionWrapper>
),
location,
};