improve the wrapping behavior of long entity links

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2021-06-22 09:30:36 +02:00
parent 1a337957c4
commit bba9df7f9e
2 changed files with 13 additions and 8 deletions
@@ -15,7 +15,7 @@
*/
import { Link, IconComponent } from '@backstage/core';
import { Grid, makeStyles, Typography } from '@material-ui/core';
import { makeStyles, Box, Typography } from '@material-ui/core';
import LanguageIcon from '@material-ui/icons/Language';
import React from 'react';
@@ -42,17 +42,17 @@ export const IconLink = ({
const classes = useStyles();
return (
<Grid container direction="row" spacing={1}>
<Grid item>
<Typography component="div" className={classes.svgIcon}>
<Box display="flex">
<Box mr={1} className={classes.svgIcon}>
<Typography component="div">
{Icon ? <Icon /> : <LanguageIcon />}
</Typography>
</Grid>
<Grid item>
</Box>
<Box flex>
<Link to={href} target="_blank" rel="noopener">
{text || href}
</Link>
</Grid>
</Grid>
</Box>
</Box>
);
};