-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
223 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
frontend/src/metabase/browse/components/EllipsifiedWithMarkdown.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { Ellipsified } from "metabase/core/components/Ellipsified"; | ||
import Markdown from "metabase/core/components/Markdown"; | ||
|
||
export const EllipsifiedWithMarkdown = ({ | ||
shouldMarkdownifyTooltipTarget = false, | ||
shouldMarkdownifyTooltip = true, | ||
children, | ||
}: { | ||
/** NOTE: If the tooltip target is markdownified, | ||
* useIsTruncated won't know whether it has been truncated */ | ||
shouldMarkdownifyTooltipTarget?: boolean; | ||
shouldMarkdownifyTooltip?: boolean; | ||
children: string; | ||
}) => { | ||
const tooltip = shouldMarkdownifyTooltip ? ( | ||
<Markdown disallowHeading unstyleLinks lineClamp={12}> | ||
{children} | ||
</Markdown> | ||
) : ( | ||
children | ||
); | ||
const tooltipTarget = shouldMarkdownifyTooltipTarget ? ( | ||
<Markdown disallowHeading>{children}</Markdown> | ||
) : ( | ||
children | ||
); | ||
return <Ellipsified tooltip={tooltip}>{tooltipTarget}</Ellipsified>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.