Skip to content

Commit

Permalink
fix(ui): fix spacing on share buttons (#7272)
Browse files Browse the repository at this point in the history
  • Loading branch information
aditya-radhakrishnan authored Feb 7, 2023
1 parent aa2a3ce commit cf1e627
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 7 deletions.
4 changes: 4 additions & 0 deletions datahub-web-react/src/app/shared/share/ShareButtonMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ const StyledMenu = styled(Menu)`
border: 1px solid ${ANTD_GRAY[3]};
border-radius: 4px;
min-width: 140px;
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 10px;
`;

export default function ShareButtonMenu({ urn, entityType, subType, name }: ShareButtonMenuProps) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from 'react';
import styled from 'styled-components';
import styled from 'styled-components/macro';
import { CheckOutlined, LinkOutlined } from '@ant-design/icons';
import { Tooltip } from 'antd';
import MenuItem from 'antd/lib/menu/MenuItem';
Expand All @@ -12,9 +12,14 @@ interface CopyLinkMenuItemProps {
const StyledMenuItem = styled(MenuItem)`
&& {
color: ${ANTD_GRAY[8]};
background-color: ${ANTD_GRAY[1]};
}
`;

const TextSpan = styled.span`
padding-left: 12px;
`;

const StyledLinkOutlined = styled(LinkOutlined)`
font-size: 14px;
`;
Expand All @@ -35,9 +40,9 @@ export default function CopyLinkMenuItem({ key }: CopyLinkMenuItemProps) {
>
<Tooltip title="Copy a shareable link to this entity.">
{isClicked ? <CheckOutlined /> : <StyledLinkOutlined />}
<span>
<TextSpan>
<b>Copy Link</b>
</span>
</TextSpan>
</Tooltip>
</StyledMenuItem>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,14 @@ interface CopyUrnMenuItemProps {
const StyledMenuItem = styled(MenuItem)`
&& {
color: ${ANTD_GRAY[8]};
background-color: ${ANTD_GRAY[1]};
}
`;

const TextSpan = styled.span`
padding-left: 12px;
`;

export default function CopyUrnMenuItem({ urn, key, type }: CopyUrnMenuItemProps) {
/**
* Whether button has been clicked
Expand All @@ -33,9 +38,9 @@ export default function CopyUrnMenuItem({ urn, key, type }: CopyUrnMenuItemProps
>
<Tooltip title={`Copy the URN for this ${type}. An URN uniquely identifies an entity on DataHub.`}>
{isClicked ? <CheckOutlined /> : <CopyOutlined />}
<span>
<TextSpan>
<b>Copy URN</b>
</span>
</TextSpan>
</Tooltip>
</StyledMenuItem>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,14 @@ interface EmailMenuItemProps {
const StyledMenuItem = styled(MenuItem)`
&& {
color: ${ANTD_GRAY[8]};
background-color: ${ANTD_GRAY[1]};
}
`;

const TextSpan = styled.span`
padding-left: 12px;
`;

export default function EmailMenuItem({ urn, name, type, key }: EmailMenuItemProps) {
/**
* Whether button has been clicked
Expand All @@ -38,11 +43,11 @@ export default function EmailMenuItem({ urn, name, type, key }: EmailMenuItemPro
{(link) => (
<Tooltip title={`Share this ${type} via email`}>
{isClicked ? <CheckOutlined /> : <MailOutlined />}
<span>
<TextSpan>
<a href={link} style={{ color: 'inherit' }}>
<b>Email</b>
</a>
</span>
</TextSpan>
</Tooltip>
)}
</EmailShare>
Expand Down

0 comments on commit cf1e627

Please sign in to comment.