add styling to handle overflow text on ownership and members card

Signed-off-by: Claire Casey <ccasey@spotify.com>
This commit is contained in:
Claire Casey
2023-02-14 14:45:56 -05:00
parent 402abac0d1
commit 5cee4f71ca
2 changed files with 18 additions and 7 deletions
@@ -59,15 +59,14 @@ const useStyles = makeStyles((theme: Theme) =>
flex: '1',
minWidth: '0px',
},
email: {
overflowingText: {
overflow: 'hidden',
whiteSpace: 'nowrap',
textOverflow: 'ellipsis',
display: 'inline-block',
maxWidth: '100%',
'&:hover': {
overflow: 'visible',
whiteSpace: 'normal',
wordBreak: 'break-word',
},
},
}),
@@ -108,6 +107,7 @@ const MemberComponent = (props: { member: UserEntity }) => {
>
<Typography variant="h5">
<Link
className={classes.overflowingText}
to={generatePath(
`/catalog/:namespace/user/${metaName}`,
entityRouteParams(props.member),
@@ -117,7 +117,10 @@ const MemberComponent = (props: { member: UserEntity }) => {
</Link>
</Typography>
{profile?.email && (
<Link className={classes.email} to={`mailto:${profile.email}`}>
<Link
className={classes.overflowingText}
to={`mailto:${profile.email}`}
>
{profile.email}
</Link>
)}
@@ -44,8 +44,16 @@ const useStyles = makeStyles((theme: BackstageTheme) =>
},
height: '100%',
},
bold: {
title: {
fontWeight: theme.typography.fontWeightBold,
textAlign: 'center',
overflow: 'hidden',
textOverflow: 'ellipsis',
maxWidth: '100%',
'&:hover': {
overflow: 'visible',
wordBreak: 'break-word',
},
},
entityTypeBox: {
background: (props: { type: string }) =>
@@ -77,10 +85,10 @@ const EntityCountTile = ({
flexDirection="column"
alignItems="center"
>
<Typography className={classes.bold} variant="h6">
<Typography className={classes.title} variant="h6">
{counter}
</Typography>
<Typography className={classes.bold} variant="h6">
<Typography className={classes.title} variant="h6">
{pluralize(rawTitle.toLocaleUpperCase('en-US'), counter)}
</Typography>
{type && <Typography variant="subtitle1">{kind}</Typography>}