Financial-Times / dotcom-page-kit

📰 Page Kit provides a high quality, well tested, and thoroughly documented set of tools for assembling and delivering FT.com based upon the best industry standards.
https://financial-times.github.io/dotcom-page-kit/
21 stars 6 forks source link

Support for custom sticky headers #728

Open i-like-robots opened 4 years ago

i-like-robots commented 4 years ago

The article page currently has a custom markup injected into the sticky header. This markup contains social and share links which replaces the MyFT logo on the right-hand side.

Because this feature is currently broken and had previously been switched off for 12 months or more we have not re-implemented it as part of the migration, however we may need to in future.

Adding an option (customStickyHeaderRightHandSideContent) and passing it down through the tree of components would be brittle and hard to rationalise. Because it is a rarely used feature it would also create a supportability problem.

I propose that if we do need this feature then we create a generic CustomStickyHeader component. It would maintain the drawer menu and search bar buttons but otherwise be a blank container for implementations to insert custom content.

Example:

import { Header, CustomStickyHeader } from '@financial-times/dotcom-ui-header';

<Header showStickyHeader={false} />
<CustomStickyHeader>{myContent}</CustomStickyHeader>
kavanagh commented 4 years ago

The MyFT Page Timeline and Topic views have a sticky element. Maybe that could use this. Also Content Packages on article page.