Skip to content

Commit

Permalink
Icon improvements.
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 28776bbe1afd88fc33a12a30370a96a5d4faf48f
  • Loading branch information
cpojer committed Nov 29, 2024
1 parent ce955d3 commit e6abc1c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
23 changes: 21 additions & 2 deletions hera/campaign/CampaignEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ export default function CampaignEditor({
hide={hidden}
inset={0}
isExpanded={false}
size="wide"
toggleExpanded={() => void 0}
>
<Stack
Expand All @@ -469,8 +470,20 @@ export default function CampaignEditor({
</div>
{slug && (
<div>
<InlineLink className={iconStyle} selectedText={hasCopied}>
<Icon icon={hasCopied ? Check : Copy} />
<InlineLink selectedText={hasCopied}>
{hasCopied ? (
<Stack
alignCenter
className={smallTextStyle}
gap={2}
nowrap
>
<Icon height={18} icon={Check} width={18} />
<fbt desc="Text for copying a link">Copied</fbt>
</Stack>
) : (
<Icon className={iconStyle} icon={Copy} />
)}
</InlineLink>
</div>
)}
Expand Down Expand Up @@ -718,6 +731,12 @@ const primaryButtonStyle = css`
height: ${TileSize * 1.5}px;
`;

const smallTextStyle = css`
font-size: 0.75em;
`;

const iconStyle = css`
height: 24px;
margin-top: 4px;
width: 24px;
`;
8 changes: 7 additions & 1 deletion hera/editor/MapEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,7 @@ export default function MapEditor({
hide={hidden}
inset={inset}
isExpanded={menuIsExpanded}
size="wide"
toggleExpanded={() => setMenuIsExpanded((isExpanded) => !isExpanded)}
>
<Stack alignCenter gap nowrap>
Expand All @@ -960,7 +961,7 @@ export default function MapEditor({
</div>
</Stack>
<InlineLink className={cx(linkStyle, menuIsExpanded && hideStyle)}>
<Icon icon={ChevronDown} />
<Icon className={menuIconStyle} icon={ChevronDown} />
</InlineLink>
</Stack>
{menuIsExpanded && (
Expand Down Expand Up @@ -1199,6 +1200,11 @@ const linkStyle = css`
transition: opacity 150ms ease;
`;

const menuIconStyle = css`
width: 24px;
height: 24px;
`;

const hideStyle = css`
opacity: 0;
`;

0 comments on commit e6abc1c

Please sign in to comment.