Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Ask FT button to o-header #1788

Conversation

Ventzy
Copy link
Contributor

@Ventzy Ventzy commented Aug 19, 2024

Describe your changes

  • Add ASK FT button linking to https://ask.ft.com/ in o-header:
    • Top header - visible on screen size L and up
    • Drawer - visible on smaller screens, same as search in the drawer
    • Sticky header - visible on screen size L and up
  • Add new optional showAskButton prop in THeaderOptions to control ASK FT button rendering. By default, the button is not rendered
  • Add showAskButton prop in o-header stories

Ask FT button was previously added in dotcom-ui-header and it is currently active on ft.com home and article pages. This PR adds the same in o-header and will be followed with dotcom-ui-header changed to align with o-header. For reference - this is the PR in dotcom-ui-header which has added the button there - Financial-Times/dotcom-page-kit#1031

Please review the PR inline comments. I need confirmation if specific approaches taken are fine or adjustments are needed.

Issue ticket number and link

Ticket: https://financialtimes.atlassian.net/browse/ARP-251

Link to Figma designs

https://www.figma.com/design/G0vA3biIFmIeXa0bB3bqWW/ARP%3A-Ask-FT?node-id=6579-37992&t=MyjE38aot5OS5vmH-4

Storybook screenshots

Top

image

Sticky

image

Drawer mobile

image

Checklist before requesting a review

  • I have applied percy label for o-[COMPONENT] or chromatic label for o3-[COMPONENT] on my PR before merging and after review. Find more details in CONTRIBUTING.md
  • If it is a new feature, I have added thorough tests.
  • I have updated relevant docs.
  • I have updated relevant env variables in Doppler.

Comment on lines 20 to 22
header-button-text: oColorsByName('black-80'),
header-button-icon: oColorsByName('black-80'),
header-button-background: oColorsByName('black-5'),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added these three variable to generalize colors of a button in the header. Let me know if this is acceptable approach. Alternatively, I can set the same colors directly into the button's scss and keep variables unchanged.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Ventzy do these colours apply to just Ask FT buttons or all buttons that could appear in the header?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is just for Ask FT button now and we don't plan to add more buttons. If these colors does not look like sensible defaults, then probably would be better to be specified just for the Ask FT button.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If these colors does not look like sensible defaults, then probably would be better to be specified just for the Ask FT button.

As they're not specific to header buttons. Could they be removed, or alternatively renamed to show that they are colours for ask ft:

header-ask-ft-button-text: ...
header-ask-ft-button-icon: ...
header-ask-ft-button-background: ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed as suggested

@@ -105,3 +105,27 @@
}
// sass-lint:enable no-vendor-prefixes
}

@mixin _oHeaderAskFtButton() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Button's main styles. Added as mixing as it is used in both _top.scss and _drawer.scss

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created tsx/components/ directory as <AskFtButton> component is included in both top.tsx and drawer.tsx. Let me know if there is a better place for it.

@notlee notlee temporarily deployed to origami-webs-arp-251-mi-nltkhj August 20, 2024 06:55 Inactive
@frshwtr
Copy link
Contributor

frshwtr commented Aug 20, 2024

Thanks for raising this PR :) As there are markup changes, this branch will need to be released as a breaking change. Please ensure there is at least one feat!: commit on this PR so that it can be released as breaking.

A migration guide will also need writing. We also have another breaking o-header pull request so please make sure you add your migration guide alongside theirs.

@notlee notlee temporarily deployed to origami-webs-arp-251-mi-nltkhj August 21, 2024 09:24 Inactive
@frshwtr frshwtr changed the base branch from main to o-header-staging August 21, 2024 14:22
@notlee notlee temporarily deployed to origami-webs-arp-251-mi-nltkhj August 21, 2024 14:50 Inactive
@notlee notlee temporarily deployed to origami-webs-arp-251-mi-nltkhj August 21, 2024 15:43 Inactive
@Ventzy Ventzy force-pushed the ARP-251-migrate-ask-ft-button-from-dotcom-ui-header-to-o-header branch from be07dd7 to c852d07 Compare August 21, 2024 15:55
@Ventzy Ventzy marked this pull request as ready for review August 21, 2024 15:55
@Ventzy Ventzy requested a review from a team as a code owner August 21, 2024 15:55
@notlee notlee temporarily deployed to origami-webs-arp-251-mi-nltkhj August 21, 2024 15:55 Inactive
@Ventzy Ventzy merged commit 4a512e7 into o-header-staging Aug 21, 2024
3 checks passed
@Ventzy Ventzy deleted the ARP-251-migrate-ask-ft-button-from-dotcom-ui-header-to-o-header branch August 21, 2024 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants