From f024ba9ed078d5905414e15fb9b067e6e91ad02f Mon Sep 17 00:00:00 2001 From: Jamie B <53781962+JamieB-gu@users.noreply.github.com> Date: Wed, 1 Jul 2026 15:57:14 +0100 Subject: [PATCH] Remove `FollowNotificationsButton` It's not used. --- ...tories.tsx => FollowTagButton.stories.tsx} | 38 ++++--------------- ...tons.test.tsx => FollowTagButton.test.tsx} | 24 +----------- ...{FollowButtons.tsx => FollowTagButton.tsx} | 36 +----------------- .../src/components/FollowWrapper.island.tsx | 2 +- 4 files changed, 11 insertions(+), 89 deletions(-) rename dotcom-rendering/src/components/{FollowButtons.stories.tsx => FollowTagButton.stories.tsx} (53%) rename dotcom-rendering/src/components/{FollowButtons.test.tsx => FollowTagButton.test.tsx} (62%) rename dotcom-rendering/src/components/{FollowButtons.tsx => FollowTagButton.tsx} (72%) diff --git a/dotcom-rendering/src/components/FollowButtons.stories.tsx b/dotcom-rendering/src/components/FollowTagButton.stories.tsx similarity index 53% rename from dotcom-rendering/src/components/FollowButtons.stories.tsx rename to dotcom-rendering/src/components/FollowTagButton.stories.tsx index f6b4a0cb2bb..2451fe3b700 100644 --- a/dotcom-rendering/src/components/FollowButtons.stories.tsx +++ b/dotcom-rendering/src/components/FollowTagButton.stories.tsx @@ -1,10 +1,10 @@ import { splitTheme } from '../../.storybook/decorators/splitThemeDecorator'; import { ArticleDesign, ArticleDisplay, Pillar } from '../lib/articleFormat'; -import { FollowNotificationsButton, FollowTagButton } from './FollowButtons'; +import { FollowTagButton } from './FollowTagButton'; export default { - component: [FollowNotificationsButton, FollowTagButton], - title: 'Components/FollowStatus', + component: FollowTagButton, + title: 'Components/FollowTagButton', args: { isFollowing: false, }, @@ -12,17 +12,11 @@ export default { export const Default = ({ isFollowing }: { isFollowing: boolean }) => { return ( - <> - undefined} - /> - undefined} - /> - + undefined} + /> ); }; @@ -37,22 +31,6 @@ Default.decorators = [ ]), ]; -export const NotificationsButtonBothStates = () => { - return ( - <> - undefined} - /> - undefined} - /> - - ); -}; -NotificationsButtonBothStates.decorators = [splitTheme()]; - export const FollowContributorBothStates = () => { return ( <> diff --git a/dotcom-rendering/src/components/FollowButtons.test.tsx b/dotcom-rendering/src/components/FollowTagButton.test.tsx similarity index 62% rename from dotcom-rendering/src/components/FollowButtons.test.tsx rename to dotcom-rendering/src/components/FollowTagButton.test.tsx index 102f60f8bae..02f1dc7bae4 100644 --- a/dotcom-rendering/src/components/FollowButtons.test.tsx +++ b/dotcom-rendering/src/components/FollowTagButton.test.tsx @@ -1,27 +1,5 @@ import { render, waitFor } from '@testing-library/react'; -import { FollowNotificationsButton, FollowTagButton } from './FollowButtons'; - -it('should show a Notifications Off button for a single contributor when rendering for apps', () => { - const { getByText } = render( - undefined} - />, - ); - expect(getByText('Notifications off')).toBeInTheDocument(); -}); - -it('should show a Notifications On button for a single contributor when rendering for apps', async () => { - const { getByText } = render( - undefined} - isFollowing={true} - />, - ); - await waitFor(() => - expect(getByText('Notifications on')).toBeInTheDocument(), - ); -}); +import { FollowTagButton } from './FollowTagButton'; it('should show a follow contributor button for a single contributor when rendering for apps', () => { const { getByText } = render( diff --git a/dotcom-rendering/src/components/FollowButtons.tsx b/dotcom-rendering/src/components/FollowTagButton.tsx similarity index 72% rename from dotcom-rendering/src/components/FollowButtons.tsx rename to dotcom-rendering/src/components/FollowTagButton.tsx index d2dce658e10..d454fad3a31 100644 --- a/dotcom-rendering/src/components/FollowButtons.tsx +++ b/dotcom-rendering/src/components/FollowTagButton.tsx @@ -1,11 +1,6 @@ import { css } from '@emotion/react'; import { space, textSans15 } from '@guardian/source/foundations'; -import { - SvgCheckmark, - SvgNotificationsOff, - SvgNotificationsOn, - SvgPlus, -} from '@guardian/source/react-components'; +import { SvgCheckmark, SvgPlus } from '@guardian/source/react-components'; import type { ReactNode } from 'react'; import { palette } from '../palette'; @@ -65,12 +60,6 @@ const containerStyles = css` column-gap: 0.2em; `; -const notificationsTextSpan = ({ - isFollowing, -}: Pick) => ( - Notifications {isFollowing ? 'on' : 'off'} -); - const tagTextSpan = ({ isFollowing, displayName, @@ -90,29 +79,6 @@ type ButtonProps = { onClickHandler: () => void; }; -export const FollowNotificationsButton = ({ - isFollowing, - onClickHandler, - withExtraBottomMargin = false, -}: ButtonProps & { withExtraBottomMargin?: boolean }) => { - return ( - - ); -}; - export const FollowTagButton = ({ isFollowing, displayName = '', diff --git a/dotcom-rendering/src/components/FollowWrapper.island.tsx b/dotcom-rendering/src/components/FollowWrapper.island.tsx index fe59a18768b..c2ed8d2ef9d 100644 --- a/dotcom-rendering/src/components/FollowWrapper.island.tsx +++ b/dotcom-rendering/src/components/FollowWrapper.island.tsx @@ -11,7 +11,7 @@ import { getNotificationsClient, getTagClient } from '../lib/bridgetApi'; import { useIsBridgetCompatible } from '../lib/useIsBridgetCompatible'; import { useIsMyGuardianEnabled } from '../lib/useIsMyGuardianEnabled'; import { palette as schemedPalette } from '../palette'; -import { FollowTagButton } from './FollowButtons'; +import { FollowTagButton } from './FollowTagButton'; type Props = { id: string;