diff --git a/web/src/components/buttons/BlueskyButton.tsx b/web/src/components/buttons/BlueskyButton.tsx new file mode 100644 index 0000000000..d31543035d --- /dev/null +++ b/web/src/components/buttons/BlueskyButton.tsx @@ -0,0 +1,46 @@ +import { Button, ButtonProps } from 'components/Button'; +import { useTranslation } from 'react-i18next'; +import { FaBluesky } from 'react-icons/fa6'; +import { ShareType, trackShare } from 'utils/analytics'; +import { baseUrl, DEFAULT_ICON_SIZE } from 'utils/constants'; + +interface BlueskyButtonProps + extends Omit< + ButtonProps, + 'icon' | 'children' | 'href' | 'onClick' | 'backgroundClasses' | 'foregroundClasses' + > { + iconSize?: number; + isIconOnly?: boolean; + isShareLink?: boolean; +} +const trackBlueskyShare = trackShare(ShareType.BLUESKY); + +export function BlueskyButton({ + isIconOnly, + iconSize = DEFAULT_ICON_SIZE, + isShareLink, + ...restProps +}: BlueskyButtonProps) { + const { t } = useTranslation(); + + return ( + } + {...restProps} + > + {isIconOnly + ? undefined + : t(isShareLink ? 'button.Bluesky-share' : 'button.Bluesky')} + + ); +} diff --git a/web/src/features/panels/ranking-panel/SocialIcons.tsx b/web/src/features/panels/ranking-panel/SocialIcons.tsx index 47b8501288..eaef39c3aa 100644 --- a/web/src/features/panels/ranking-panel/SocialIcons.tsx +++ b/web/src/features/panels/ranking-panel/SocialIcons.tsx @@ -1,3 +1,4 @@ +import { BlueskyButton } from 'components/buttons/BlueskyButton'; import { FacebookButton } from 'components/buttons/FacebookButton'; import { FeedbackButton } from 'components/buttons/FeedbackButton'; import { LinkedinButton } from 'components/buttons/LinkedinButton'; @@ -14,6 +15,7 @@ export default function SocialIconRow() {