diff --git a/.claude/launch.json b/.claude/launch.json new file mode 100644 index 00000000000..8ae9d3b6d54 --- /dev/null +++ b/.claude/launch.json @@ -0,0 +1,11 @@ +{ + "version": "0.0.1", + "configurations": [ + { + "name": "storybook", + "runtimeExecutable": "pnpm", + "runtimeArgs": ["--filter", "storybook", "dev"], + "port": 6006 + } + ] +} diff --git a/packages/shared/src/components/ShareMobile.tsx b/packages/shared/src/components/ShareMobile.tsx index c5eef681837..e84795f2eeb 100644 --- a/packages/shared/src/components/ShareMobile.tsx +++ b/packages/shared/src/components/ShareMobile.tsx @@ -1,7 +1,8 @@ import type { ReactElement } from 'react'; import React, { useContext } from 'react'; -import { LinkIcon, ShareIcon } from './icons'; +import { CopyIcon, LinkIcon, ShareIcon } from './icons'; import { useCopyPostLink } from '../hooks/useCopyPostLink'; +import { useShareCopyIcon } from '../hooks/useShareCopyIcon'; import { Button, ButtonColor, @@ -35,6 +36,7 @@ export function ShareMobile({ const { openSharePost } = useSharePost(origin); const { logEvent } = useLogContext(); const { logOpts } = useContext(ActiveFeedContext); + const showCopyIcon = useShareCopyIcon(); const onShare = () => { logEvent( @@ -51,7 +53,7 @@ export function ShareMobile({ size={ButtonSize.Small} onClick={onCopyPostLink} pressed={copying} - icon={} + icon={showCopyIcon ? : } variant={ButtonVariant.Tertiary} color={ButtonColor.Avocado} > diff --git a/packages/shared/src/components/cards/common/ActionButtons.v2.tsx b/packages/shared/src/components/cards/common/ActionButtons.v2.tsx index 3bdf0f9270c..ee2f27641a6 100644 --- a/packages/shared/src/components/cards/common/ActionButtons.v2.tsx +++ b/packages/shared/src/components/cards/common/ActionButtons.v2.tsx @@ -7,6 +7,7 @@ import { CardActionBar } from '../../buttons/CardActionBar'; import { AnalyticsIcon, DiscussIcon as CommentIcon, + CopyIcon, LinkIcon, DownvoteIcon, } from '../../icons'; @@ -21,6 +22,7 @@ import { PostTagsPanel } from '../../post/block/PostTagsPanel'; import { LinkWithTooltip } from '../../tooltips/LinkWithTooltip'; import { useCardActions } from '../../../hooks/cards/useCardActions'; import { useBrandSponsorship } from '../../../hooks/useBrandSponsorship'; +import { useShareCopyIcon } from '../../../hooks/useShareCopyIcon'; import { usePostImpressionsModal } from '../../../hooks/post/usePostImpressionsModal'; import { usePostImpressions } from '../../../hooks/post/usePostImpressions'; @@ -73,6 +75,7 @@ const ActionButtons = ({ }: ActionButtonsProps): ReactElement | null => { const config = variantConfig[variant]; const isFeedPreview = useFeedPreviewMode(); + const showCopyIcon = useShareCopyIcon(); // When impressions are enabled, awards are hidden below laptop (tablet + // mobile) to make room for the extra action. const isLaptop = useViewSize(ViewSize.Laptop); @@ -227,7 +230,7 @@ const ActionButtons = ({ } + icon={showCopyIcon ? : } label="Copy link" onClick={onCopyLink} color={ButtonColor.Cabbage} diff --git a/packages/shared/src/components/post/brief/BriefPostHeaderActions.tsx b/packages/shared/src/components/post/brief/BriefPostHeaderActions.tsx index d1cb33406be..d31a26c0abb 100644 --- a/packages/shared/src/components/post/brief/BriefPostHeaderActions.tsx +++ b/packages/shared/src/components/post/brief/BriefPostHeaderActions.tsx @@ -6,8 +6,9 @@ import type { PostHeaderActionsProps } from '../common'; import Link from '../../utilities/Link'; import { Button, ButtonSize } from '../../buttons/Button'; import { settingsUrl } from '../../../lib/constants'; -import { LinkIcon, SettingsIcon } from '../../icons'; +import { CopyIcon, LinkIcon, SettingsIcon } from '../../icons'; import { useSharePost } from '../../../hooks/useSharePost'; +import { useShareCopyIcon } from '../../../hooks/useShareCopyIcon'; import type { Origin } from '../../../lib/log'; const Container = classed('div', 'flex flex-row items-center'); @@ -27,15 +28,17 @@ export const BriefPostHeaderActions = ({ showShareButton?: boolean; }): ReactElement => { const { copyLink } = useSharePost(origin); + const showCopyIcon = useShareCopyIcon(); return (
{showShareButton && (