Skip to content
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

Dynamic width of the pop-overs #6238

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions datahub-web-react/src/app/preview/DefaultPreviewCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ const PreviewContainer = styled.div`
align-items: center;
`;

const LeftColumn = styled.div`
max-width: 60%;
const LeftColumn = styled.div<{ expandWidth: boolean }>`
max-width: ${(props) => (props.expandWidth ? '100%' : '60%')};
`;

const RightColumn = styled.div`
Expand Down Expand Up @@ -258,9 +258,11 @@ export default function DefaultPreviewCard({
event.stopPropagation();
};

const shouldShowRightColumn = (topUsers && topUsers.length > 0) || (owners && owners.length > 0);

return (
<PreviewContainer data-testid={dataTestID} onMouseDown={onPreventMouseDown}>
<LeftColumn>
<LeftColumn expandWidth={!shouldShowRightColumn}>
<TitleContainer>
<PlatformContentView
platformName={platform}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const HoverEntityTooltip = ({ entity, canOpen = true, children }: Props)
visible={canOpen ? undefined : false}
color="white"
placement="topRight"
overlayStyle={{ minWidth: 500 }}
overlayStyle={{ minWidth: 300, maxWidth: 500, width: 'fit-content' }}
overlayInnerStyle={{ padding: 12 }}
title={<a href={url}>{entityRegistry.renderPreview(entity.type, PreviewType.HOVER_CARD, entity)}</a>}
>
Expand Down