Skip to content

Commit

Permalink
Merge pull request #1431 from guardian/help-centre-remove-footer-support
Browse files Browse the repository at this point in the history
hide the support cta's from the help centre footer
  • Loading branch information
rBangay authored Dec 20, 2024
2 parents fb1e4fe + ab9e424 commit 48a999c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 14 deletions.
6 changes: 5 additions & 1 deletion client/components/shared/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ export const Main = ({
{children}
</main>
</div>
{hasMinimalFooter ? <MinimalFooter /> : <Footer />}
{hasMinimalFooter ? (
<MinimalFooter />
) : (
<Footer hideSupport={!!isHelpCentrePage} />
)}
</div>
</HasMinimalFooterContext.Provider>
);
Expand Down
4 changes: 4 additions & 0 deletions client/components/shared/footer/Footer.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@ export default {

export const Default: StoryFn<typeof Footer> = () => <Footer />;

export const WithoutSupport: StoryFn<typeof Footer> = () => (
<Footer hideSupport />
);

export const Minimal: StoryFn<typeof MinimalFooter> = () => <MinimalFooter />;
28 changes: 15 additions & 13 deletions client/components/shared/footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ const fillEmailSignup = (_: SyntheticEvent<HTMLIFrameElement>) => {
return;
};

export const Footer = () => {
export const Footer = ({ hideSupport }: { hideSupport?: boolean }) => {
const TODAY = new Date(Date.now());

const [isInUSA, setIsInUSA] = useState<boolean>(false);
Expand Down Expand Up @@ -255,19 +255,21 @@ export const Footer = () => {
</ul>
))}

<div css={supportStyles}>
<div css={supportTitleStyles}>
Support the&nbsp;Guardian
{!hideSupport && (
<div css={supportStyles}>
<div css={supportTitleStyles}>
Support the&nbsp;Guardian
</div>
<div css={supportButtonContainerStyles}>
<SupportTheGuardianButton
supportReferer="footer_support_contribute"
alternateButtonText="Support us"
theme="brand"
size="small"
/>
</div>
</div>
<div css={supportButtonContainerStyles}>
<SupportTheGuardianButton
supportReferer="footer_support_contribute"
alternateButtonText="Support us"
theme="brand"
size="small"
/>
</div>
</div>
)}
</div>
</div>

Expand Down

0 comments on commit 48a999c

Please sign in to comment.