@financial-times/dotcom-ui-header 13.3.0 → 13.4.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29,5 +29,6 @@
29
29
  @include oGridRespondTo($until: 'M') {
30
30
  display: none;
31
31
  }
32
- margin: 0 10px;
32
+
33
+ margin-left: 10px;
33
34
  }
@@ -0,0 +1,9 @@
1
+ // The o3-button class selector has higher specificity due to its default styling rules,
2
+ // which can override custom styles applied to the button. To ensure our styles take precedence,
3
+ // we use a combination of class selectors to increase specificity.
4
+
5
+ .o3-button.o-header__mpr-button {
6
+ @include oGridRespondTo($until: 'L') {
7
+ display: none;
8
+ }
9
+ }
@@ -0,0 +1,22 @@
1
+ import React from 'react'
2
+ import { LinkButton } from '@financial-times/o3-button'
3
+ import type { MprButtonProps } from '@financial-times/o-header/src/tsx/components/mpr-button'
4
+
5
+ const MPR_URL = 'https://professional-monetary-policy-radar.ft.com/'
6
+
7
+ export const MprButton = ({ id, dataTrackable }: MprButtonProps) => (
8
+ <LinkButton
9
+ href={MPR_URL}
10
+ icon="radar"
11
+ label="MPR"
12
+ size="small"
13
+ type="primary"
14
+ theme="mono"
15
+ attributes={{
16
+ id: id,
17
+ 'data-trackable': dataTrackable,
18
+ className: `o-header__mpr-button`,
19
+ 'data-ft-origin': 'pro-central-banking'
20
+ }}
21
+ />
22
+ )
@@ -5,6 +5,7 @@ import { TNavMenuItem } from '@financial-times/dotcom-types-navigation'
5
5
  import { AskFtButton } from '../ask-ft/askFtButton'
6
6
  import { DropdownNavigation, ProfessionalLabel } from '../dropdown-navigation/dropdownNavigation'
7
7
  import { PRO_NAVIGATION_DROPDOWN_DEFAULT_LIST } from '../dropdown-navigation/constants'
8
+ import { MprButton } from '../mpr/mprButton'
8
9
 
9
10
  const HeaderWrapper = (props) => (
10
11
  <header
@@ -77,13 +78,16 @@ const TopWrapper = (props) => (
77
78
  </div>
78
79
  )
79
80
 
80
- const TopColumnLeft = (props: Pick<THeaderProps, 'showAskButton'>) => (
81
+ const TopColumnLeft = (props: THeaderProps) => (
81
82
  <div className="o-header__top-column o-header__top-column--left">
82
83
  <DrawerIcon />
83
84
  <SearchIcon />
84
85
  {props.showAskButton && (
85
86
  <AskFtButton variant="top" dataTrackable="ask-ft-button-header" id="ask-ft-button-header" />
86
87
  )}
88
+ {props.showMprButton && (
89
+ <MprButton dataTrackable="mpr-button-header" id="mpr-button-header" />
90
+ )}
87
91
  </div>
88
92
  )
89
93
 
package/src/header.scss CHANGED
@@ -21,3 +21,6 @@
21
21
 
22
22
  // Import the ask-ft button styles
23
23
  @import 'components/ask-ft/askFtButton.scss';
24
+
25
+ // Import the mpr button styles
26
+ @import 'components/mpr/mprButton.scss';
package/src/index.tsx CHANGED
@@ -35,7 +35,8 @@ const defaultProps: Partial<THeaderOptions> = {
35
35
  showStickyHeader: true,
36
36
  showMegaNav: true,
37
37
  showAskButton: false,
38
- showProNavigation: false
38
+ showProNavigation: false,
39
+ showMprButton: false,
39
40
  }
40
41
 
41
42
  function MainHeader(props: THeaderProps) {
@@ -13,6 +13,7 @@ export type THeaderOptions = {
13
13
  showAskButton?: boolean
14
14
  showProNavigation?: boolean
15
15
  showRestartSubscriptionButton?: boolean
16
+ showMprButton?: boolean
16
17
  }
17
18
 
18
19
  export type THeaderProps = THeaderOptions & {