@newskit-render/core 1.42.1 → 1.44.2
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/CHANGELOG.md +68 -0
- package/__tests__/pages/__snapshots__/home.test.tsx.snap +46 -21
- package/components/article/__tests__/__snapshots__/index.test.tsx.snap +46 -21
- package/components/common/NewskitLogo.tsx +5 -3
- package/components/common/NewskitLogoShort.tsx +6 -4
- package/components/common/iconNavLink/IconNavLink.tsx +70 -0
- package/components/common/iconNavLink/__tests__/IconNavLink.test.tsx +35 -0
- package/components/common/iconNavLink/index.ts +3 -0
- package/components/common/iconNavLink/types.ts +24 -0
- package/components/common/icons/IconAccount.tsx +13 -0
- package/components/footer/__snapshots__/index.test.tsx.snap +6 -4
- package/components/header/index.test.tsx +17 -0
- package/components/header/index.tsx +32 -18
- package/cypress/e2e/account/account-subscription.spec.js +45 -0
- package/cypress/support/commands.js +5 -1
- package/infrastructure/.circleci/config.yml +1 -0
- package/package.json +7 -7
- package/pages/preview/[articleId]/version/[versionId]/index.tsx +17 -15
- package/temp/_app.tsx +209 -0
- package/temp/header.tsx +32 -18
|
@@ -255,7 +255,7 @@ exports[`Footer tests should render footer 1`] = `
|
|
|
255
255
|
>
|
|
256
256
|
<svg
|
|
257
257
|
class="emotion-5"
|
|
258
|
-
height="
|
|
258
|
+
height="48px"
|
|
259
259
|
viewBox="0 0 244 40"
|
|
260
260
|
>
|
|
261
261
|
<title>
|
|
@@ -263,15 +263,17 @@ exports[`Footer tests should render footer 1`] = `
|
|
|
263
263
|
</title>
|
|
264
264
|
<path
|
|
265
265
|
d="M61.846.936c3.35.413 4.944 4.005 4.92 8.746l.017-.013c-5.497 4.462-16.323 7.515-26.958 1.71l.011-.016c1.568.832 3.224 1.475 5.172 1.715 2.386.294 4.303-1.023 6.043-2.889l.124-.134.062-.068.123-.137.123-.138.122-.14.121-.142.061-.071.121-.144.12-.145.146-.178.073-.09.182-.226.181-.228.144-.184.144-.185.143-.185.215-.279 1.091-1.431.209-.271.209-.269.14-.178.14-.177.14-.175.141-.173.141-.172.113-.136.113-.135.114-.133.114-.132.057-.065.114-.13.057-.064.115-.127.173-.187.116-.123.175-.18.117-.118C58.328 1.663 59.933.7 61.846.936z"
|
|
266
|
-
fill="
|
|
266
|
+
fill="white"
|
|
267
267
|
/>
|
|
268
268
|
<path
|
|
269
269
|
d="M26.763 28.981l.011.013c-1.414-.671-2.883-1.176-4.519-1.378-1.738-.214-3.244.513-4.634 1.704l-.11.095-.163.146-.108.1-.108.101-.268.261-.106.107-.106.109-.106.11-.053.056-.105.112-.053.057-.125.136-.124.138-.124.139-.062.07-.123.142-.123.143-.122.145-.122.146-.061.073-.15.183-.075.092-.149.185-.075.093-.149.187-.149.188-.223.283-.296.38-.671.866-.222.285-.222.283-.148.188-.223.28-.149.185-.149.183-.149.182-.15.18-.117.139-.118.138-.118.136-.118.135-.119.133-.119.132-.119.13-.06.064-.12.127-.1.104-.1.103-.1.101-.151.15-.101.098-.102.096-.051.048-.102.094-.206.183-.103.089-.052.044-.104.086c-1.302 1.066-2.706 1.698-4.305 1.5-3.321-.41-4.98-3.93-5.064-8.601l-.097.09c6.351-5.963 17.155-6.757 26.506-2.264z"
|
|
270
|
-
fill="
|
|
270
|
+
fill="white"
|
|
271
|
+
fill-opacity="0.4"
|
|
271
272
|
/>
|
|
272
273
|
<path
|
|
273
274
|
d="M42.216 35.925c-2.861-.398-5.212-1.275-7.302-2.318l-.189-.095-.188-.096-.186-.097-.231-.122-.229-.123-.182-.099-.226-.125-.224-.126-.178-.101-.177-.102-.264-.153-.349-.205-.278-.166-.276-.166-.411-.249-1.214-.738-.334-.201-.333-.199-2.669-1.45-.012-.013c-9.258-4.447-19.94-3.714-26.315 2.087l-.095.088C.156 20.101 8.779 2.598 25.068 4.608c2.854.352 5.141 1.176 7.14 2.181l.178.09.177.091.175.092.087.046.173.093.172.094.17.095.085.048.211.12.209.121.166.097.165.098.164.098.163.099.162.099.161.099.16.1.261.164.13.082.258.164.256.164 1.137.733.25.161.25.159.312.197.312.194a31.02 31.02 0 0 0 1.568.911l.199.106c10.506 5.694 21.166 2.775 26.7-1.604l.149-.12c-.055 10.998-8.815 28.185-24.55 26.243z"
|
|
274
|
-
fill="
|
|
275
|
+
fill="white"
|
|
276
|
+
fill-opacity="0.701961"
|
|
275
277
|
/>
|
|
276
278
|
</svg>
|
|
277
279
|
</div>
|
|
@@ -53,4 +53,21 @@ describe('Header tests', () => {
|
|
|
53
53
|
'/section-three'
|
|
54
54
|
)
|
|
55
55
|
})
|
|
56
|
+
|
|
57
|
+
test('render Account link if there is user data', () => {
|
|
58
|
+
const user = {
|
|
59
|
+
firstName: '',
|
|
60
|
+
lastName: '',
|
|
61
|
+
cpn: '',
|
|
62
|
+
email: '',
|
|
63
|
+
hash: '',
|
|
64
|
+
mobile: '',
|
|
65
|
+
phoneNumber: '',
|
|
66
|
+
dateOfBirth: '',
|
|
67
|
+
subscriptions: [],
|
|
68
|
+
paymentFailure: { active: false },
|
|
69
|
+
}
|
|
70
|
+
const { getByTestId } = renderWithTheme(Header, { user })
|
|
71
|
+
expect(getByTestId('account-link')).toBeInTheDocument()
|
|
72
|
+
})
|
|
56
73
|
})
|
|
@@ -31,12 +31,14 @@ import NewsKitLogoShort from '../common/NewskitLogoShort'
|
|
|
31
31
|
import NavLink from '../common/NavLink'
|
|
32
32
|
import { AppContext } from '../../app-context/AppContext'
|
|
33
33
|
import { handleEnterKeyPress } from '../../helpers/a11y'
|
|
34
|
+
import IconNavLink from '../common/iconNavLink'
|
|
35
|
+
import { IconAccount } from '../common/icons/IconAccount'
|
|
34
36
|
|
|
35
|
-
export const headerSize = '
|
|
37
|
+
export const headerSize = 'sizing100'
|
|
36
38
|
|
|
37
39
|
const StyledHeader = styled.div`
|
|
38
40
|
${getSizingCssFromTheme('height', headerSize)}
|
|
39
|
-
${getColorCssFromTheme('backgroundColor', '
|
|
41
|
+
${getColorCssFromTheme('backgroundColor', 'interfaceBrand010')};
|
|
40
42
|
a,
|
|
41
43
|
a:visited:not(:disabled) {
|
|
42
44
|
${getColorCssFromTheme('color', 'white')};
|
|
@@ -44,14 +46,14 @@ const StyledHeader = styled.div`
|
|
|
44
46
|
line-height: ${getFontsFromTheme('fontLineHeight040')};
|
|
45
47
|
}
|
|
46
48
|
${getMediaQueryFromTheme('xs')} {
|
|
47
|
-
${getSizingCssFromTheme('paddingTop', '
|
|
48
|
-
${getSizingCssFromTheme('paddingBottom', '
|
|
49
|
+
${getSizingCssFromTheme('paddingTop', 'sizing040')};
|
|
50
|
+
${getSizingCssFromTheme('paddingBottom', 'sizing040')};
|
|
49
51
|
${getSizingCssFromTheme('paddingLeft', 'sizing000')};
|
|
50
52
|
${getSizingCssFromTheme('paddingRight', 'sizing000')};
|
|
51
53
|
}
|
|
52
54
|
${getMediaQueryFromTheme('lg')} {
|
|
53
|
-
${getSizingCssFromTheme('paddingTop', '
|
|
54
|
-
${getSizingCssFromTheme('paddingBottom', '
|
|
55
|
+
${getSizingCssFromTheme('paddingTop', 'sizing040')};
|
|
56
|
+
${getSizingCssFromTheme('paddingBottom', 'sizing040')};
|
|
55
57
|
${getSizingCssFromTheme('paddingLeft', 'sizing090')};
|
|
56
58
|
${getSizingCssFromTheme('paddingRight', 'sizing090')};
|
|
57
59
|
}
|
|
@@ -111,14 +113,14 @@ const NavigationContainer = styled.div<NavigationProps>`
|
|
|
111
113
|
overflow: auto;
|
|
112
114
|
width: 100%;
|
|
113
115
|
min-height: 100vh;
|
|
114
|
-
${getColorCssFromTheme('backgroundColor', '
|
|
116
|
+
${getColorCssFromTheme('backgroundColor', 'interfaceBrand010')};
|
|
115
117
|
left: 0;
|
|
116
118
|
${getSizingCssFromTheme('top', headerSize)}
|
|
117
|
-
z-index:
|
|
119
|
+
z-index: 2;
|
|
118
120
|
display: ${(props) => (props.show ? 'block' : 'none')};
|
|
119
121
|
|
|
120
122
|
${getMediaQueryFromTheme('md')} {
|
|
121
|
-
display:
|
|
123
|
+
display: flex;
|
|
122
124
|
position: relative;
|
|
123
125
|
overflow: hidden;
|
|
124
126
|
width: initial;
|
|
@@ -127,6 +129,7 @@ const NavigationContainer = styled.div<NavigationProps>`
|
|
|
127
129
|
left: initial;
|
|
128
130
|
top: initial;
|
|
129
131
|
z-index: 1;
|
|
132
|
+
${getSizingCssFromTheme('height', 'sizing080')}
|
|
130
133
|
}
|
|
131
134
|
`
|
|
132
135
|
|
|
@@ -146,12 +149,10 @@ const Navigation = styled.div`
|
|
|
146
149
|
const NavButton = ({
|
|
147
150
|
buttonText,
|
|
148
151
|
href,
|
|
149
|
-
isMobile,
|
|
150
152
|
ariaLabel,
|
|
151
153
|
}: {
|
|
152
154
|
buttonText: string
|
|
153
155
|
href: string
|
|
154
|
-
isMobile: boolean
|
|
155
156
|
isLast?: boolean
|
|
156
157
|
ariaLabel?: string
|
|
157
158
|
}) => (
|
|
@@ -159,9 +160,12 @@ const NavButton = ({
|
|
|
159
160
|
as="span"
|
|
160
161
|
spaceInline={{
|
|
161
162
|
xs: 'space000',
|
|
162
|
-
md: '
|
|
163
|
+
md: 'space040',
|
|
164
|
+
}}
|
|
165
|
+
spaceStack={{
|
|
166
|
+
xs: 'space050',
|
|
167
|
+
md: 'space000',
|
|
163
168
|
}}
|
|
164
|
-
spaceStack={isMobile ? 'space050' : ''}
|
|
165
169
|
>
|
|
166
170
|
<NavLink href={href} ariaLabel={ariaLabel} buttonText={buttonText} />
|
|
167
171
|
</Block>
|
|
@@ -228,8 +232,11 @@ const Header: React.FC<{ user: UserData }> = ({ user }) => {
|
|
|
228
232
|
stackDistribution="flex-end"
|
|
229
233
|
wrap="nowrap"
|
|
230
234
|
>
|
|
231
|
-
<NavigationContainer
|
|
232
|
-
|
|
235
|
+
<NavigationContainer
|
|
236
|
+
show={showMenu}
|
|
237
|
+
data-testid="NavigationContainer"
|
|
238
|
+
>
|
|
239
|
+
<Navigation data-testid="Navigation">
|
|
233
240
|
{showMenu && (
|
|
234
241
|
<Block
|
|
235
242
|
spaceStack="space050"
|
|
@@ -239,21 +246,28 @@ const Header: React.FC<{ user: UserData }> = ({ user }) => {
|
|
|
239
246
|
<NavButton
|
|
240
247
|
buttonText="Section One"
|
|
241
248
|
href="/section-one"
|
|
242
|
-
isMobile={showMenu}
|
|
243
249
|
ariaLabel="Section One Link"
|
|
244
250
|
/>
|
|
245
251
|
<NavButton
|
|
246
252
|
buttonText="Section Two"
|
|
247
253
|
href="/section-two"
|
|
248
|
-
isMobile={showMenu}
|
|
249
254
|
ariaLabel="Section Two Link"
|
|
250
255
|
/>
|
|
251
256
|
<NavButton
|
|
252
257
|
buttonText="Section Three"
|
|
253
258
|
href="/section-three"
|
|
254
|
-
isMobile={showMenu}
|
|
255
259
|
ariaLabel="Section Three Link"
|
|
256
260
|
/>
|
|
261
|
+
{user && (
|
|
262
|
+
<IconNavLink
|
|
263
|
+
icon={<IconAccount data-testid="account-link" />}
|
|
264
|
+
href="/account"
|
|
265
|
+
text="Account"
|
|
266
|
+
spaceInline="space040"
|
|
267
|
+
typographyPreset="utilityMeta020"
|
|
268
|
+
stylePreset="linkStandaloneInverse"
|
|
269
|
+
/>
|
|
270
|
+
)}
|
|
257
271
|
</Navigation>
|
|
258
272
|
</NavigationContainer>
|
|
259
273
|
<Visible xs sm>
|
|
@@ -219,4 +219,49 @@ describe('Account Subscription & Cancellation', () => {
|
|
|
219
219
|
cy.get('[data-testid="banner-container"]').should('not.exist')
|
|
220
220
|
cy.clearLocalStorage()
|
|
221
221
|
})
|
|
222
|
+
|
|
223
|
+
it('should show modal when Cancel subscription link is clicked but user is in payment failure', () => {
|
|
224
|
+
cy.GetAcsSession('withSub')
|
|
225
|
+
cy.mockConsent()
|
|
226
|
+
cy.visit('/account/subscription-and-billing', {
|
|
227
|
+
onBeforeLoad: (win) => {
|
|
228
|
+
let nextData
|
|
229
|
+
|
|
230
|
+
Object.defineProperty(win, '__NEXT_DATA__', {
|
|
231
|
+
set(o) {
|
|
232
|
+
// eslint-disable-next-line no-param-reassign
|
|
233
|
+
o.props.pageProps.user.paymentFailure = {
|
|
234
|
+
active: true,
|
|
235
|
+
startDate: new Date().toISOString(),
|
|
236
|
+
}
|
|
237
|
+
nextData = o
|
|
238
|
+
},
|
|
239
|
+
get() {
|
|
240
|
+
return nextData
|
|
241
|
+
},
|
|
242
|
+
})
|
|
243
|
+
},
|
|
244
|
+
})
|
|
245
|
+
cy.get('a[href="/account/cancellation"]').should('be.visible').click()
|
|
246
|
+
|
|
247
|
+
cy.contains('You have outstanding payments')
|
|
248
|
+
})
|
|
249
|
+
|
|
250
|
+
it('should show paypal subscription', () => {
|
|
251
|
+
cy.GetAcsSession('paypalSub')
|
|
252
|
+
cy.mockConsentAndVisit('/account/subscription-and-billing')
|
|
253
|
+
cy.contains('[data-testid="payment-type"]', 'Paypal account')
|
|
254
|
+
})
|
|
255
|
+
|
|
256
|
+
it('should show inline message for paypal subscription', () => {
|
|
257
|
+
cy.GetAcsSession('paypalSub')
|
|
258
|
+
cy.mockConsentAndVisit('/account/subscription-and-billing')
|
|
259
|
+
cy.get('a[href="/account/payment"]')
|
|
260
|
+
.should('be.visible')
|
|
261
|
+
.click({ force: true })
|
|
262
|
+
cy.contains(
|
|
263
|
+
'[data-testid="Zuora-inline"]',
|
|
264
|
+
'To update your Paypal credentials, please speak to one of our advisors on xxxx-xxx-xxxx or add a new payment method via credit/debit card using the form below.'
|
|
265
|
+
)
|
|
266
|
+
})
|
|
222
267
|
})
|
|
@@ -25,7 +25,11 @@ const userMap = {
|
|
|
25
25
|
withSub: {
|
|
26
26
|
username: 'render.e2e.sub@yopmail.com',
|
|
27
27
|
password: 'Ad45p0-swq151@',
|
|
28
|
-
}
|
|
28
|
+
},
|
|
29
|
+
paypalSub: {
|
|
30
|
+
username: 'render-paypal-payment@yopmail.com',
|
|
31
|
+
password: 'testing123',
|
|
32
|
+
},
|
|
29
33
|
}
|
|
30
34
|
|
|
31
35
|
Cypress.Commands.add('GetAcsSession', (user = 'default') => {
|
|
@@ -255,6 +255,7 @@ orbs:
|
|
|
255
255
|
echo 'export HELM_OPT_SET="$HELM_OPT_SET --set secret.items.OKTA_CLIENT_SECRET=${OKTA_CLIENT_SECRET}"' >> $BASH_ENV
|
|
256
256
|
echo 'export HELM_OPT_SET="$HELM_OPT_SET --set secret.items.OKTA_DOMAIN=${OKTA_DOMAIN}"' >> $BASH_ENV
|
|
257
257
|
echo 'export HELM_OPT_SET="$HELM_OPT_SET --set secret.items.NEXTAUTH_URL=${NEXTAUTH_URL}"' >> $BASH_ENV
|
|
258
|
+
echo 'export HELM_OPT_SET="$HELM_OPT_SET --set secret.items.NEXTAUTH_SECRET=${NEXTAUTH_SECRET}"' >> $BASH_ENV
|
|
258
259
|
echo 'export HELM_OPT_SET="$HELM_OPT_SET --set secret.items.SN_PASSWORD=${SN_PASSWORD}"' >> $BASH_ENV
|
|
259
260
|
echo 'export HELM_OPT_SET="$HELM_OPT_SET --set secret.items.SN_USERNAME=${SN_USERNAME}"' >> $BASH_ENV
|
|
260
261
|
echo 'export HELM_OPT_SET="$HELM_OPT_SET --set secret.items.SN_ENVIRONMENT=${SN_ENVIRONMENT}"' >> $BASH_ENV
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@newskit-render/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.44.2",
|
|
4
4
|
"description": "Newskit Render - Core package",
|
|
5
5
|
"author": "",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -34,12 +34,12 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@apollo/client": "3.4.16",
|
|
36
36
|
"@newskit-render/api": "^0.18.0",
|
|
37
|
-
"@newskit-render/auth": "^0.31.
|
|
38
|
-
"@newskit-render/checkout": "^0.26.
|
|
39
|
-
"@newskit-render/feature-flags": "^0.
|
|
40
|
-
"@newskit-render/feed": "^0.5.
|
|
41
|
-
"@newskit-render/my-account": "^0.
|
|
42
|
-
"@newskit-render/shared-components": "^0.
|
|
37
|
+
"@newskit-render/auth": "^0.31.3",
|
|
38
|
+
"@newskit-render/checkout": "^0.26.3",
|
|
39
|
+
"@newskit-render/feature-flags": "^0.13.0",
|
|
40
|
+
"@newskit-render/feed": "^0.5.2",
|
|
41
|
+
"@newskit-render/my-account": "^0.152.0",
|
|
42
|
+
"@newskit-render/shared-components": "^0.45.0",
|
|
43
43
|
"@newskit-render/validation": "^0.39.1",
|
|
44
44
|
"cross-fetch": "3.1.5",
|
|
45
45
|
"graphql": "15.6.0",
|
|
@@ -61,21 +61,23 @@ const PreviewArticle = ({
|
|
|
61
61
|
|
|
62
62
|
return (
|
|
63
63
|
<PageWithAuth onDenied={accessDeniedPage} isLoading={showOnLoading}>
|
|
64
|
-
|
|
65
|
-
<
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
64
|
+
<>
|
|
65
|
+
<CookieView>
|
|
66
|
+
<Button size="medium" onClick={() => signOut()}>
|
|
67
|
+
sign out
|
|
68
|
+
</Button>
|
|
69
|
+
</CookieView>
|
|
70
|
+
<ArticlePage
|
|
71
|
+
section={section}
|
|
72
|
+
articleURL={articleURL}
|
|
73
|
+
{...universalArticle}
|
|
74
|
+
siteHost={siteHost}
|
|
75
|
+
gscId={gscId}
|
|
76
|
+
twitterUsername={twitterUsername}
|
|
77
|
+
highlights={highlights}
|
|
78
|
+
relatedArticles={relatedArticles}
|
|
79
|
+
/>
|
|
80
|
+
</>
|
|
79
81
|
</PageWithAuth>
|
|
80
82
|
)
|
|
81
83
|
}
|
package/temp/_app.tsx
CHANGED
|
@@ -13,6 +13,215 @@ if (!process.browser) {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
const GlobalStyling = css`
|
|
16
|
+
@font-face {
|
|
17
|
+
font-family: GillSansMTStd-Medium;
|
|
18
|
+
src: url('/fonts/GillSansMTStd-Medium.otf');
|
|
19
|
+
}
|
|
20
|
+
@font-face {
|
|
21
|
+
font-family: TimesModern-Bold;
|
|
22
|
+
src: url('/fonts/TimesDigital-Bold.ttf') format('truetype');
|
|
23
|
+
}
|
|
24
|
+
@font-face {
|
|
25
|
+
font-family: TimesModern-Regular;
|
|
26
|
+
src: url('/fonts/TimesDigital-Regular.ttf') format('truetype');
|
|
27
|
+
}
|
|
28
|
+
@font-face {
|
|
29
|
+
font-family: TimesDigitalW04-Regular;
|
|
30
|
+
src: url('/fonts/TimesDigitalW04-Regular.ttf') format('truetype');
|
|
31
|
+
}
|
|
32
|
+
@font-face {
|
|
33
|
+
font-family: Montserrat;
|
|
34
|
+
src: url('/fonts/Montserrat-Regular.ttf') format('truetype');
|
|
35
|
+
}
|
|
36
|
+
@font-face {
|
|
37
|
+
font-family: TheSun-Bold;
|
|
38
|
+
src: url('/fonts/TheSun-Bold.ttf') format('truetype');
|
|
39
|
+
}
|
|
40
|
+
@font-face {
|
|
41
|
+
font-family: TheSun-HeavyNarrow;
|
|
42
|
+
src: url('/fonts/TheSun-HeavyNarrow.ttf') format('truetype');
|
|
43
|
+
}
|
|
44
|
+
@font-face {
|
|
45
|
+
font-family: TheSun-Regular;
|
|
46
|
+
src: url('/fonts/TheSun-Regular.ttf') format('truetype');
|
|
47
|
+
}
|
|
48
|
+
@font-face {
|
|
49
|
+
font-family: TheSun-Medium;
|
|
50
|
+
src: url('/fonts/TheSun-Medium.ttf') format('truetype');
|
|
51
|
+
}
|
|
52
|
+
@font-face {
|
|
53
|
+
font-family: 'DM Sans';
|
|
54
|
+
src: url('/fonts/dmsans-regular-webfont.woff2') format('woff2'),
|
|
55
|
+
url('/fonts/dmsans-regular-webfont.woff') format('woff');
|
|
56
|
+
font-style: normal;
|
|
57
|
+
font-weight: 400;
|
|
58
|
+
font-display: swap;
|
|
59
|
+
}
|
|
60
|
+
@font-face {
|
|
61
|
+
font-family: 'DM Sans';
|
|
62
|
+
src: url('/fonts/dmsans-italic-webfont.woff2') format('woff2'),
|
|
63
|
+
url('/fonts/dmsans-italic-webfont.woff') format('woff');
|
|
64
|
+
font-style: italic;
|
|
65
|
+
font-weight: 400;
|
|
66
|
+
font-display: swap;
|
|
67
|
+
}
|
|
68
|
+
@font-face {
|
|
69
|
+
font-family: 'DM Sans';
|
|
70
|
+
src: url('/fonts/dmsans-medium-webfont.woff2') format('woff2'),
|
|
71
|
+
url('/fonts/dmsans-medium-webfont.woff') format('woff');
|
|
72
|
+
font-style: normal;
|
|
73
|
+
font-weight: 500;
|
|
74
|
+
font-display: swap;
|
|
75
|
+
}
|
|
76
|
+
@font-face {
|
|
77
|
+
font-family: 'DM Sans';
|
|
78
|
+
src: url('/fonts/dmsans-mediumitalic-webfont.woff2') format('woff2'),
|
|
79
|
+
url('/fonts/dmsans-mediumitalic-webfont.woff') format('woff');
|
|
80
|
+
font-style: italic;
|
|
81
|
+
font-weight: 500;
|
|
82
|
+
font-display: swap;
|
|
83
|
+
}
|
|
84
|
+
@font-face {
|
|
85
|
+
font-family: 'DM Sans';
|
|
86
|
+
src: url('/fonts/dmsans-bold-webfont.woff2') format('woff2'),
|
|
87
|
+
url('/fonts/dmsans-bold-webfont.woff') format('woff');
|
|
88
|
+
font-style: normal;
|
|
89
|
+
font-weight: 700;
|
|
90
|
+
font-display: swap;
|
|
91
|
+
}
|
|
92
|
+
@font-face {
|
|
93
|
+
font-family: 'DM Sans';
|
|
94
|
+
src: url('/fonts/dmsans-bolditalic-webfont.woff2') format('woff2'),
|
|
95
|
+
url('/fonts/dmsans-bolditalic-webfont.woff') format('woff');
|
|
96
|
+
font-style: italic;
|
|
97
|
+
font-weight: 700;
|
|
98
|
+
font-display: swap;
|
|
99
|
+
}
|
|
100
|
+
@font-face {
|
|
101
|
+
font-family: 'Poppins';
|
|
102
|
+
src: url('/fonts/poppins-bold-webfont.woff2') format('woff2'),
|
|
103
|
+
url('/fonts/poppins-bold-webfont.woff') format('woff');
|
|
104
|
+
font-weight: 700;
|
|
105
|
+
font-style: normal;
|
|
106
|
+
}
|
|
107
|
+
@font-face {
|
|
108
|
+
font-family: 'Poppins';
|
|
109
|
+
src: url('/fonts/poppins-bolditalic-webfont.woff2') format('woff2'),
|
|
110
|
+
url('/fonts/poppins-bolditalic-webfont.woff') format('woff');
|
|
111
|
+
font-weight: normal;
|
|
112
|
+
font-style: italic;
|
|
113
|
+
}
|
|
114
|
+
@font-face {
|
|
115
|
+
font-family: 'Poppins';
|
|
116
|
+
src: url('/fonts/poppins-extrabold-webfont.woff2') format('woff2'),
|
|
117
|
+
url('/fonts/poppins-extrabold-webfont.woff') format('woff');
|
|
118
|
+
font-weight: 800;
|
|
119
|
+
font-style: normal;
|
|
120
|
+
}
|
|
121
|
+
@font-face {
|
|
122
|
+
font-family: 'Poppins';
|
|
123
|
+
src: url('/fonts/poppins-extrabolditalic-webfont.woff2') format('woff2'),
|
|
124
|
+
url('/fonts/poppins-extrabolditalic-webfont.woff') format('woff');
|
|
125
|
+
font-weight: 800;
|
|
126
|
+
font-style: italic;
|
|
127
|
+
}
|
|
128
|
+
@font-face {
|
|
129
|
+
font-family: 'Poppins';
|
|
130
|
+
src: url('/fonts/poppins-italic-webfont.woff2') format('woff2'),
|
|
131
|
+
url('/fonts/poppins-italic-webfont.woff') format('woff');
|
|
132
|
+
font-weight: 400;
|
|
133
|
+
font-style: italic;
|
|
134
|
+
}
|
|
135
|
+
@font-face {
|
|
136
|
+
font-family: 'Poppins';
|
|
137
|
+
src: url('/fonts/poppins-light-webfont.woff2') format('woff2'),
|
|
138
|
+
url('/fonts/poppins-light-webfont.woff') format('woff');
|
|
139
|
+
font-weight: 300;
|
|
140
|
+
font-style: normal;
|
|
141
|
+
}
|
|
142
|
+
@font-face {
|
|
143
|
+
font-family: 'Poppins';
|
|
144
|
+
src: url('/fonts/poppins-lightitalic-webfont.woff2') format('woff2'),
|
|
145
|
+
url('/fonts/poppins-lightitalic-webfont.woff') format('woff');
|
|
146
|
+
font-weight: 300;
|
|
147
|
+
font-style: italic;
|
|
148
|
+
}
|
|
149
|
+
@font-face {
|
|
150
|
+
font-family: 'Poppins';
|
|
151
|
+
src: url('/fonts/poppins-medium-webfont.woff2') format('woff2'),
|
|
152
|
+
url('/fonts/poppins-medium-webfont.woff') format('woff');
|
|
153
|
+
font-weight: 500;
|
|
154
|
+
font-style: normal;
|
|
155
|
+
}
|
|
156
|
+
@font-face {
|
|
157
|
+
font-family: 'Poppins';
|
|
158
|
+
src: url('/fonts/poppins-mediumitalic-webfont.woff2') format('woff2'),
|
|
159
|
+
url('/fonts/poppins-mediumitalic-webfont.woff') format('woff');
|
|
160
|
+
font-weight: 500;
|
|
161
|
+
font-style: italic;
|
|
162
|
+
}
|
|
163
|
+
@font-face {
|
|
164
|
+
font-family: 'Poppins';
|
|
165
|
+
src: url('/fonts/poppins-regular-webfont.woff2') format('woff2'),
|
|
166
|
+
url('/fonts/poppins-regular-webfont.woff') format('woff');
|
|
167
|
+
font-weight: 400;
|
|
168
|
+
font-style: normal;
|
|
169
|
+
}
|
|
170
|
+
@font-face {
|
|
171
|
+
font-family: 'Poppins';
|
|
172
|
+
src: url('/fonts/poppins-semibold-webfont.woff2') format('woff2'),
|
|
173
|
+
url('/fonts/poppins-semibold-webfont.woff') format('woff');
|
|
174
|
+
font-weight: 600;
|
|
175
|
+
font-style: normal;
|
|
176
|
+
}
|
|
177
|
+
@font-face {
|
|
178
|
+
font-family: 'Poppins';
|
|
179
|
+
src: url('/fonts/poppins-semibolditalic-webfont.woff2') format('woff2'),
|
|
180
|
+
url('/fonts/poppins-semibolditalic-webfont.woff') format('woff');
|
|
181
|
+
font-weight: 600;
|
|
182
|
+
font-style: italic;
|
|
183
|
+
}
|
|
184
|
+
@font-face {
|
|
185
|
+
font-family: 'DM Mono';
|
|
186
|
+
src: url('/fonts/dmmono-medium.woff2') format('woff2'),
|
|
187
|
+
url('/fonts/dmmono-medium.woff') format('woff');
|
|
188
|
+
font-style: normal;
|
|
189
|
+
font-weight: 500;
|
|
190
|
+
font-display: swap;
|
|
191
|
+
}
|
|
192
|
+
@font-face {
|
|
193
|
+
font-family: 'Bitter';
|
|
194
|
+
src: url('/fonts/bitter-regular.woff2') format('woff2'),
|
|
195
|
+
url('/fonts/bitter-regular.woff') format('woff');
|
|
196
|
+
font-style: normal;
|
|
197
|
+
font-weight: 400;
|
|
198
|
+
font-display: swap;
|
|
199
|
+
}
|
|
200
|
+
@font-face {
|
|
201
|
+
font-family: 'Bitter';
|
|
202
|
+
src: url('/fonts/bitter-medium.woff2') format('woff2'),
|
|
203
|
+
url('/fonts/bitter-medium.woff') format('woff');
|
|
204
|
+
font-style: normal;
|
|
205
|
+
font-weight: 500;
|
|
206
|
+
font-display: swap;
|
|
207
|
+
}
|
|
208
|
+
@font-face {
|
|
209
|
+
font-family: 'Bitter';
|
|
210
|
+
src: url('/fonts/bitter-mediumitalic.woff2') format('woff2'),
|
|
211
|
+
url('/fonts/bitter-mediumitalic.woff') format('woff');
|
|
212
|
+
font-style: italic;
|
|
213
|
+
font-weight: 500;
|
|
214
|
+
font-display: swap;
|
|
215
|
+
}
|
|
216
|
+
@font-face {
|
|
217
|
+
font-family: 'Bitter';
|
|
218
|
+
src: url('/fonts/bitter-semibold.woff2') format('woff2'),
|
|
219
|
+
url('/fonts/bitter-semibold.woff') format('woff');
|
|
220
|
+
font-style: normal;
|
|
221
|
+
font-weight: 600;
|
|
222
|
+
font-display: swap;
|
|
223
|
+
}
|
|
224
|
+
|
|
16
225
|
html,
|
|
17
226
|
body {
|
|
18
227
|
padding: 0;
|
package/temp/header.tsx
CHANGED
|
@@ -18,12 +18,14 @@ import NewsKitLogoFull from '../common/NewskitLogo'
|
|
|
18
18
|
import NewsKitLogoShort from '../common/NewskitLogoShort'
|
|
19
19
|
import NavLink from '../common/NavLink'
|
|
20
20
|
import { handleEnterKeyPress } from '../../helpers/a11y'
|
|
21
|
+
import IconNavLink from '../common/iconNavLink'
|
|
22
|
+
import { IconAccount } from '../common/icons/IconAccount'
|
|
21
23
|
|
|
22
|
-
export const headerSize = '
|
|
24
|
+
export const headerSize = 'sizing100'
|
|
23
25
|
|
|
24
26
|
const StyledHeader = styled.div`
|
|
25
27
|
${getSizingCssFromTheme('height', headerSize)}
|
|
26
|
-
${getColorCssFromTheme('backgroundColor', '
|
|
28
|
+
${getColorCssFromTheme('backgroundColor', 'interfaceBrand010')};
|
|
27
29
|
a,
|
|
28
30
|
a:visited:not(:disabled) {
|
|
29
31
|
${getColorCssFromTheme('color', 'white')};
|
|
@@ -31,14 +33,14 @@ const StyledHeader = styled.div`
|
|
|
31
33
|
line-height: ${getFontsFromTheme('fontLineHeight040')};
|
|
32
34
|
}
|
|
33
35
|
${getMediaQueryFromTheme('xs')} {
|
|
34
|
-
${getSizingCssFromTheme('paddingTop', '
|
|
35
|
-
${getSizingCssFromTheme('paddingBottom', '
|
|
36
|
+
${getSizingCssFromTheme('paddingTop', 'sizing040')};
|
|
37
|
+
${getSizingCssFromTheme('paddingBottom', 'sizing040')};
|
|
36
38
|
${getSizingCssFromTheme('paddingLeft', 'sizing000')};
|
|
37
39
|
${getSizingCssFromTheme('paddingRight', 'sizing000')};
|
|
38
40
|
}
|
|
39
41
|
${getMediaQueryFromTheme('lg')} {
|
|
40
|
-
${getSizingCssFromTheme('paddingTop', '
|
|
41
|
-
${getSizingCssFromTheme('paddingBottom', '
|
|
42
|
+
${getSizingCssFromTheme('paddingTop', 'sizing040')};
|
|
43
|
+
${getSizingCssFromTheme('paddingBottom', 'sizing040')};
|
|
42
44
|
${getSizingCssFromTheme('paddingLeft', 'sizing090')};
|
|
43
45
|
${getSizingCssFromTheme('paddingRight', 'sizing090')};
|
|
44
46
|
}
|
|
@@ -53,14 +55,14 @@ const NavigationContainer = styled.div<NavigationProps>`
|
|
|
53
55
|
overflow: auto;
|
|
54
56
|
width: 100%;
|
|
55
57
|
min-height: 100vh;
|
|
56
|
-
${getColorCssFromTheme('backgroundColor', '
|
|
58
|
+
${getColorCssFromTheme('backgroundColor', 'interfaceBrand010')};
|
|
57
59
|
left: 0;
|
|
58
60
|
${getSizingCssFromTheme('top', headerSize)}
|
|
59
|
-
z-index:
|
|
61
|
+
z-index: 2;
|
|
60
62
|
display: ${(props) => (props.show ? 'block' : 'none')};
|
|
61
63
|
|
|
62
64
|
${getMediaQueryFromTheme('md')} {
|
|
63
|
-
display:
|
|
65
|
+
display: flex;
|
|
64
66
|
position: relative;
|
|
65
67
|
overflow: auto;
|
|
66
68
|
width: initial;
|
|
@@ -69,6 +71,7 @@ const NavigationContainer = styled.div<NavigationProps>`
|
|
|
69
71
|
left: initial;
|
|
70
72
|
top: initial;
|
|
71
73
|
z-index: 1;
|
|
74
|
+
${getSizingCssFromTheme('height', 'sizing080')}
|
|
72
75
|
}
|
|
73
76
|
`
|
|
74
77
|
|
|
@@ -133,12 +136,10 @@ const BannerContainer = styled(Block)`
|
|
|
133
136
|
const NavButton = ({
|
|
134
137
|
buttonText,
|
|
135
138
|
href,
|
|
136
|
-
isMobile,
|
|
137
139
|
ariaLabel,
|
|
138
140
|
}: {
|
|
139
141
|
buttonText: string
|
|
140
142
|
href: string
|
|
141
|
-
isMobile: boolean
|
|
142
143
|
isLast?: boolean
|
|
143
144
|
ariaLabel?: string
|
|
144
145
|
}) => (
|
|
@@ -146,9 +147,12 @@ const NavButton = ({
|
|
|
146
147
|
as="span"
|
|
147
148
|
spaceInline={{
|
|
148
149
|
xs: 'space000',
|
|
149
|
-
md: '
|
|
150
|
+
md: 'space040',
|
|
151
|
+
}}
|
|
152
|
+
spaceStack={{
|
|
153
|
+
xs: 'space050',
|
|
154
|
+
md: 'space000',
|
|
150
155
|
}}
|
|
151
|
-
spaceStack={isMobile && 'space050'}
|
|
152
156
|
>
|
|
153
157
|
<NavLink href={href} ariaLabel={ariaLabel} buttonText={buttonText} />
|
|
154
158
|
</Block>
|
|
@@ -191,8 +195,11 @@ const Header: React.FC<{ user: UserData }> = ({ user }) => {
|
|
|
191
195
|
stackDistribution="flex-end"
|
|
192
196
|
wrap="nowrap"
|
|
193
197
|
>
|
|
194
|
-
<NavigationContainer
|
|
195
|
-
|
|
198
|
+
<NavigationContainer
|
|
199
|
+
show={showMenu}
|
|
200
|
+
data-testid="NavigationContainer"
|
|
201
|
+
>
|
|
202
|
+
<Navigation data-testid="Navigation">
|
|
196
203
|
{showMenu && (
|
|
197
204
|
<Block
|
|
198
205
|
spaceStack="space050"
|
|
@@ -202,21 +209,28 @@ const Header: React.FC<{ user: UserData }> = ({ user }) => {
|
|
|
202
209
|
<NavButton
|
|
203
210
|
buttonText="Section One"
|
|
204
211
|
href="/section-one"
|
|
205
|
-
isMobile={showMenu}
|
|
206
212
|
ariaLabel="Section One Link"
|
|
207
213
|
/>
|
|
208
214
|
<NavButton
|
|
209
215
|
buttonText="Section Two"
|
|
210
216
|
href="/section-two"
|
|
211
|
-
isMobile={showMenu}
|
|
212
217
|
ariaLabel="Section Two Link"
|
|
213
218
|
/>
|
|
214
219
|
<NavButton
|
|
215
220
|
buttonText="Section Three"
|
|
216
221
|
href="/section-three"
|
|
217
|
-
isMobile={showMenu}
|
|
218
222
|
ariaLabel="Section Three Link"
|
|
219
223
|
/>
|
|
224
|
+
{user && (
|
|
225
|
+
<IconNavLink
|
|
226
|
+
icon={<IconAccount data-testid="account-link" />}
|
|
227
|
+
href="/account"
|
|
228
|
+
text="Account"
|
|
229
|
+
spaceInline="space040"
|
|
230
|
+
typographyPreset="utilityMeta020"
|
|
231
|
+
stylePreset="linkStandaloneInverse"
|
|
232
|
+
/>
|
|
233
|
+
)}
|
|
220
234
|
</Navigation>
|
|
221
235
|
</NavigationContainer>
|
|
222
236
|
<Visible xs sm>
|