-
-
Notifications
You must be signed in to change notification settings - Fork 730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: text overflow on project users access page #8853
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,32 +6,49 @@ import { | |
} from '../HtmlTooltip/HtmlTooltip'; | ||
|
||
const StyledLink = styled(Link, { | ||
shouldForwardProp: (prop) => prop !== 'highlighted', | ||
})<{ highlighted?: boolean }>(({ theme, highlighted }) => ({ | ||
backgroundColor: highlighted ? theme.palette.highlight : 'transparent', | ||
color: theme.palette.text.primary, | ||
textDecorationColor: theme.palette.text.disabled, | ||
textDecorationStyle: 'dashed', | ||
textUnderlineOffset: theme.spacing(0.5), | ||
whiteSpace: 'nowrap', | ||
})); | ||
shouldForwardProp: (prop) => prop !== 'highlighted' && prop !== 'clampText', | ||
})<{ highlighted?: boolean; clampText?: boolean }>( | ||
({ theme, highlighted, clampText }) => ({ | ||
backgroundColor: highlighted ? theme.palette.highlight : 'transparent', | ||
color: theme.palette.text.primary, | ||
textDecorationColor: theme.palette.text.disabled, | ||
textDecorationStyle: 'dashed', | ||
textUnderlineOffset: theme.spacing(0.5), | ||
whiteSpace: 'nowrap', | ||
...(clampText | ||
? { | ||
overflow: 'hidden', | ||
textOverflow: 'ellipsis', | ||
maxWidth: '100%', | ||
display: 'block', | ||
} | ||
: {}), | ||
}), | ||
); | ||
|
||
interface ITooltipLinkProps extends LinkProps { | ||
tooltip: ReactNode; | ||
highlighted?: boolean; | ||
tooltipProps?: Omit<IHtmlTooltipProps, 'title' | 'children'>; | ||
children: ReactNode; | ||
clampText?: boolean; | ||
} | ||
|
||
export const TooltipLink = ({ | ||
tooltip, | ||
highlighted, | ||
tooltipProps, | ||
children, | ||
clampText, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does it need to be configurable? when do we want ellipsis vs scrollbar? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same question 🙋🏼 But also: is it okay that we don't show the whole text. should we reconfigure the tables instead? 🤔 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We use this component in many other places, mostly but not only in tables. I think it's not always in a place constrained by column width. |
||
...props | ||
}: ITooltipLinkProps) => ( | ||
<HtmlTooltip title={tooltip} {...tooltipProps} arrow> | ||
<StyledLink tabIndex={0} highlighted={highlighted} {...props}> | ||
<StyledLink | ||
tabIndex={0} | ||
highlighted={highlighted} | ||
clampText={clampText} | ||
{...props} | ||
> | ||
{children} | ||
</StyledLink> | ||
</HtmlTooltip> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I was clamp I though we gonna use css clamp so maybe we should pick a term that doesn't have other meaning in CSS?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overflowEllipsis
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have many examples of Truncate/Truncated in the code