mirror of
https://github.com/datahub-project/datahub.git
synced 2025-10-29 01:42:08 +00:00
improvement(ui): bring compact markdown viewer changes to OSS (#13593)
This commit is contained in:
parent
7b21a5cea3
commit
f335093607
@ -2,7 +2,7 @@ import React, { useCallback, useState } from 'react';
|
||||
import styled from 'styled-components';
|
||||
|
||||
import { Editor } from '@app/entityV2/shared/tabs/Documentation/components/editor/Editor';
|
||||
import { Button } from '@src/alchemy-components';
|
||||
import { Button, Tooltip } from '@src/alchemy-components';
|
||||
|
||||
const LINE_HEIGHT = 1.5;
|
||||
|
||||
@ -88,6 +88,10 @@ const FixedLineHeightEditor = styled(CompactEditor)<{ customStyle?: React.CSSPro
|
||||
}
|
||||
`;
|
||||
|
||||
const MoreIndicator = styled.span`
|
||||
break-word: normal;
|
||||
`;
|
||||
|
||||
export type Props = {
|
||||
content: string;
|
||||
lineLimit?: number | null;
|
||||
@ -131,7 +135,11 @@ export default function CompactMarkdownViewer({
|
||||
readOnly
|
||||
/>
|
||||
</MarkdownViewContainer>
|
||||
{hideShowMore && <>...</>}
|
||||
{hideShowMore && isTruncated && (
|
||||
<Tooltip title={content}>
|
||||
<MoreIndicator>...</MoreIndicator>
|
||||
</Tooltip>
|
||||
)}
|
||||
|
||||
{!hideShowMore &&
|
||||
(isShowingMore || isTruncated) && ( // "show more" when isTruncated, "show less" when isShowingMore
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user