@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.
- package/README.md +15 -15
- package/dist/node/components/mpr/mprButton.d.ts +3 -0
- package/dist/node/components/mpr/mprButton.js +16 -0
- package/dist/node/components/top/partials.d.ts +1 -1
- package/dist/node/components/top/partials.js +3 -1
- package/dist/node/index.d.ts +1 -0
- package/dist/node/index.js +2 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/__test__/components/MainHeader.spec.tsx +11 -0
- package/src/__test__/components/__snapshots__/MainHeader.spec.tsx.snap +4024 -270
- package/src/components/ask-ft/askFtButton.scss +2 -1
- package/src/components/mpr/mprButton.scss +9 -0
- package/src/components/mpr/mprButton.tsx +22 -0
- package/src/components/top/partials.tsx +5 -1
- package/src/header.scss +3 -0
- package/src/index.tsx +2 -1
- package/src/interfaces.d.ts +1 -0
|
@@ -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:
|
|
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
package/src/index.tsx
CHANGED