@codecademy/brand 1.25.0-alpha.f9156d199c.0 → 1.25.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/dist/AppHeader/AppHeaderElements/AppHeaderCatalogSection/index.js +91 -4
- package/dist/AppHeader/AppHeaderElements/AppHeaderResourcesDropdown/index.js +4 -2
- package/dist/AppHeader/index.js +5 -2
- package/dist/AppHeader/shared/utils.d.ts +1 -0
- package/dist/AppHeaderMobile/AppHeaderSubMenuMobile/index.js +7 -5
- package/dist/GlobalHeader/GlobalHeaderItems.d.ts +1 -0
- package/dist/GlobalHeader/GlobalHeaderItems.js +12 -1
- package/dist/GlobalHeader/GlobalHeaderVariants.d.ts +14 -14
- package/dist/GlobalHeader/GlobalHeaderVariants.js +33 -33
- package/dist/GlobalHeader/index.d.ts +2 -1
- package/dist/GlobalHeader/index.js +54 -45
- package/dist/GlobalHeader/types.d.ts +1 -0
- package/dist/ResourceCard/index.d.ts +1 -1
- package/dist/ResourceCard/index.js +2 -2
- package/dist/lib/catalogList/index.d.ts +2 -1
- package/dist/lib/catalogList/index.js +26 -0
- package/dist/lib/resourcesList/index.d.ts +2 -2
- package/dist/lib/resourcesList/index.js +14 -5
- package/package.json +1 -1
|
@@ -4,12 +4,12 @@ import { TinyBlocks } from '@codecademy/gamut-illustrations';
|
|
|
4
4
|
import { Background } from '@codecademy/gamut-styles';
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import { useContext, useEffect, useRef } from 'react';
|
|
7
|
-
import { HeaderQuizContext } from '../../../GlobalHeader';
|
|
8
|
-
import { careerPaths, getTopSubjects, topLanguages } from '../../../lib/catalogList';
|
|
7
|
+
import { HeaderQuizContext, LiveLearningHubContext } from '../../../GlobalHeader';
|
|
8
|
+
import { careerPaths, getTopSubjects, liveLearningHubItems, topLanguages } from '../../../lib/catalogList';
|
|
9
9
|
import { DescriptionSectionContainer, LayoutGridAntiAliased, useMegaMenuHeaderResponsiveStyles } from '../../shared';
|
|
10
10
|
import { useAppHeaderDropdownContext } from '../AppHeaderDropdownProvider';
|
|
11
11
|
import { BannerAnchor, StyledAnchorColumn, StyledColumn, StyledFillButton, SubjectAnchor, topicWrapperProps, useBannerResponsiveStyles } from './elements';
|
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
13
|
const quizAnchorData = {
|
|
14
14
|
text: 'Take our quiz',
|
|
15
15
|
id: 'quiz',
|
|
@@ -53,6 +53,7 @@ export const AppHeaderCatalogSection = /*#__PURE__*/React.forwardRef(({
|
|
|
53
53
|
showOnboardingQuiz,
|
|
54
54
|
showSortingQuiz
|
|
55
55
|
} = useContext(HeaderQuizContext);
|
|
56
|
+
const isLiveLearningHubEnabled = useContext(LiveLearningHubContext);
|
|
56
57
|
const tabIndex = isOpen === false ? -1 : 0;
|
|
57
58
|
const styles = useMegaMenuHeaderResponsiveStyles();
|
|
58
59
|
const bannerStyles = useBannerResponsiveStyles();
|
|
@@ -250,6 +251,7 @@ export const AppHeaderCatalogSection = /*#__PURE__*/React.forwardRef(({
|
|
|
250
251
|
_: 16,
|
|
251
252
|
sm: 32
|
|
252
253
|
},
|
|
254
|
+
borderBottom: 1,
|
|
253
255
|
children: /*#__PURE__*/_jsx(DescriptionSection, {
|
|
254
256
|
title: "Top career paths",
|
|
255
257
|
subtitle: "Choose your career. We'll teach you the skills to get job-ready."
|
|
@@ -287,7 +289,92 @@ export const AppHeaderCatalogSection = /*#__PURE__*/React.forwardRef(({
|
|
|
287
289
|
})
|
|
288
290
|
})]
|
|
289
291
|
})
|
|
290
|
-
}, "Top career paths"),
|
|
292
|
+
}, "Top career paths"), isLiveLearningHubEnabled && /*#__PURE__*/_jsx(StyledColumn, {
|
|
293
|
+
as: "li",
|
|
294
|
+
size: 12,
|
|
295
|
+
children: /*#__PURE__*/_jsxs(LayoutGrid, {
|
|
296
|
+
children: [/*#__PURE__*/_jsx(Column, {
|
|
297
|
+
size: {
|
|
298
|
+
xs: 12,
|
|
299
|
+
lg: 3
|
|
300
|
+
},
|
|
301
|
+
children: /*#__PURE__*/_jsx(Background, {
|
|
302
|
+
...styles,
|
|
303
|
+
px: {
|
|
304
|
+
_: 16,
|
|
305
|
+
xs: 32,
|
|
306
|
+
sm: 64,
|
|
307
|
+
md: 48,
|
|
308
|
+
lg: 24
|
|
309
|
+
},
|
|
310
|
+
py: {
|
|
311
|
+
_: 16,
|
|
312
|
+
sm: 32
|
|
313
|
+
},
|
|
314
|
+
children: /*#__PURE__*/_jsx(DescriptionSection, {
|
|
315
|
+
title: liveLearningHubItems.title,
|
|
316
|
+
subtitle: liveLearningHubItems.description || ''
|
|
317
|
+
})
|
|
318
|
+
})
|
|
319
|
+
}), /*#__PURE__*/_jsx(Column, {
|
|
320
|
+
size: {
|
|
321
|
+
xs: 12,
|
|
322
|
+
lg: 8
|
|
323
|
+
},
|
|
324
|
+
children: /*#__PURE__*/_jsx(LayoutGrid, {
|
|
325
|
+
as: "ul",
|
|
326
|
+
py: 32,
|
|
327
|
+
pl: {
|
|
328
|
+
_: 16,
|
|
329
|
+
xs: 32,
|
|
330
|
+
sm: 64,
|
|
331
|
+
md: 48
|
|
332
|
+
},
|
|
333
|
+
children: liveLearningHubItems.data.map(dataItem => {
|
|
334
|
+
const {
|
|
335
|
+
id,
|
|
336
|
+
href,
|
|
337
|
+
text,
|
|
338
|
+
badge,
|
|
339
|
+
newTab
|
|
340
|
+
} = dataItem;
|
|
341
|
+
return /*#__PURE__*/_jsx(Column, {
|
|
342
|
+
as: "li",
|
|
343
|
+
size: {
|
|
344
|
+
_: 12,
|
|
345
|
+
lg: 4
|
|
346
|
+
},
|
|
347
|
+
children: /*#__PURE__*/_jsx(Anchor, {
|
|
348
|
+
"data-focusableresource": "true",
|
|
349
|
+
variant: "interface",
|
|
350
|
+
href: href,
|
|
351
|
+
onClick: event => onClick(event, dataItem),
|
|
352
|
+
tabIndex: tabIndex,
|
|
353
|
+
target: newTab ? '_blank' : '_self',
|
|
354
|
+
children: 'description' in dataItem && /*#__PURE__*/_jsxs(_Fragment, {
|
|
355
|
+
children: [/*#__PURE__*/_jsxs(FlexBox, {
|
|
356
|
+
whiteSpace: "nowrap",
|
|
357
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
358
|
+
fontSize: 16,
|
|
359
|
+
fontWeight: "bold",
|
|
360
|
+
as: "h3",
|
|
361
|
+
pb: 4,
|
|
362
|
+
children: text
|
|
363
|
+
}), badge]
|
|
364
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
365
|
+
fontSize: 14,
|
|
366
|
+
pb: 4,
|
|
367
|
+
pr: 40,
|
|
368
|
+
children: dataItem.description
|
|
369
|
+
})]
|
|
370
|
+
})
|
|
371
|
+
})
|
|
372
|
+
}, id);
|
|
373
|
+
})
|
|
374
|
+
})
|
|
375
|
+
})]
|
|
376
|
+
})
|
|
377
|
+
}, "Live Learning"), showQuiz && /*#__PURE__*/_jsx(Column, {
|
|
291
378
|
px: {
|
|
292
379
|
_: 16,
|
|
293
380
|
xs: 32,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
1
|
+
import { useCallback, useContext, useEffect, useRef, useState } from 'react';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
+
import { LiveLearningHubContext } from '../../../GlobalHeader';
|
|
3
4
|
import { getHeaderResourcesList } from '../../../lib/resourcesList';
|
|
4
5
|
import { AnimatedMegaMenuDropdown } from '../../shared';
|
|
5
6
|
import { AppHeaderDropdownProvider } from '../AppHeaderDropdownProvider';
|
|
@@ -23,10 +24,11 @@ export const AppHeaderResourcesDropdown = ({
|
|
|
23
24
|
lastOpenedDropdown,
|
|
24
25
|
setLastOpenedDropdown
|
|
25
26
|
} = useAppHeaderContext();
|
|
27
|
+
const isLiveLearningHubEnabled = useContext(LiveLearningHubContext);
|
|
26
28
|
|
|
27
29
|
// Add scrollbar for short screens after transition (otherwise scrollbar appears and dissapears for adequate heights during transition)
|
|
28
30
|
const [animationCompleteStyles, setAnimationCompleteStyles] = useState(false);
|
|
29
|
-
const headerResourcesList = getHeaderResourcesList();
|
|
31
|
+
const headerResourcesList = getHeaderResourcesList(isLiveLearningHubEnabled);
|
|
30
32
|
const animationFinished = () => {
|
|
31
33
|
setAnimationCompleteStyles(isOpen);
|
|
32
34
|
if (isOpen && dropdownRef.current) {
|
package/dist/AppHeader/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { useMemo, useRef } from 'react';
|
|
2
|
+
import { useContext, useMemo, useRef } from 'react';
|
|
3
|
+
import { LiveLearningHubContext } from '../GlobalHeader';
|
|
3
4
|
import { HeaderHeightArea } from '../HeaderHeightArea';
|
|
4
5
|
import { NotificationsDropdown } from '../Notifications/NotificationsDropdown';
|
|
5
6
|
import { useHeaderNotifications } from '../Notifications/useHeaderNotifications';
|
|
@@ -24,6 +25,7 @@ export const AppHeader = ({
|
|
|
24
25
|
type = 'standard'
|
|
25
26
|
}) => {
|
|
26
27
|
const menuContainerRef = useRef(null);
|
|
28
|
+
const isLiveLearningHubEnabled = useContext(LiveLearningHubContext);
|
|
27
29
|
const [notificationsBell, notificationsView] = useHeaderNotifications({
|
|
28
30
|
settings: notifications,
|
|
29
31
|
Renderer: NotificationsDropdown
|
|
@@ -53,7 +55,8 @@ export const AppHeader = ({
|
|
|
53
55
|
isStandalone,
|
|
54
56
|
isTeams,
|
|
55
57
|
redirectParam,
|
|
56
|
-
spacing: dropdownSpacing
|
|
58
|
+
spacing: dropdownSpacing,
|
|
59
|
+
isLiveLearningHubEnabled
|
|
57
60
|
})
|
|
58
61
|
}, item.id);
|
|
59
62
|
});
|
|
@@ -11,6 +11,7 @@ type AppHeaderItemToElementType = {
|
|
|
11
11
|
onKeyDown?: (event: React.KeyboardEvent) => void;
|
|
12
12
|
mobile?: boolean;
|
|
13
13
|
spacing?: ComponentProps<typeof Menu>['spacing'];
|
|
14
|
+
isLiveLearningHubEnabled?: boolean;
|
|
14
15
|
};
|
|
15
16
|
export declare const mapAppHeaderItemToElement: ({ action, item, isAnon, isStandalone, isTeams, redirectParam, onKeyDown, mobile, spacing, }: AppHeaderItemToElementType) => ReactNode;
|
|
16
17
|
export {};
|
|
@@ -2,12 +2,13 @@ import _styled from "@emotion/styled/base";
|
|
|
2
2
|
import { Anchor, Menu, Text } from '@codecademy/gamut';
|
|
3
3
|
import { ArrowChevronLeftIcon } from '@codecademy/gamut-icons';
|
|
4
4
|
import { css } from '@codecademy/gamut-styles';
|
|
5
|
-
import { useEffect, useRef } from 'react';
|
|
5
|
+
import { useContext, useEffect, useRef } from 'react';
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import { AppHeaderCatalogSection } from '../../AppHeader/AppHeaderElements/AppHeaderCatalogSection';
|
|
8
8
|
import { AppHeaderLinkSections } from '../../AppHeader/AppHeaderElements/AppHeaderLinkSections';
|
|
9
9
|
import { AppHeaderListItem } from '../../AppHeader/AppHeaderElements/AppHeaderListItem';
|
|
10
10
|
import { AppHeaderResourcesSection } from '../../AppHeader/AppHeaderElements/AppHeaderResourcesSection';
|
|
11
|
+
import { LiveLearningHubContext } from '../../GlobalHeader';
|
|
11
12
|
import { getHeaderResourcesList } from '../../lib/resourcesList';
|
|
12
13
|
import { MobileSubMenuWrapper, MobileUlWrapper } from './elements';
|
|
13
14
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -20,8 +21,8 @@ const StyledAnchor = /*#__PURE__*/_styled(Anchor, {
|
|
|
20
21
|
my: 24,
|
|
21
22
|
padding: 0,
|
|
22
23
|
width: 'calc(100% - 64px)'
|
|
23
|
-
}), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
24
|
-
const renderHeaderSection = (item, action, handleCloseMainMenu) => {
|
|
24
|
+
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iAzMiwgc206IDY0LCBtZDogNDggfX1cbiAgICAgICAgPlxuICAgICAgICAgIHtpc1Byb2ZpbGVNZW51ID8gaXRlbS51c2VyRGlzcGxheU5hbWUgOiBpdGVtLnRleHR9XG4gICAgICAgIDwvVGV4dD5cbiAgICAgICAgPE1lbnUgdmFyaWFudD1cImZpeGVkXCIgbXg9ezh9IHdpZHRoPVwiY2FsYygxMDAlIC0gMTZweClcIj5cbiAgICAgICAgICB7cmVuZGVySGVhZGVyU2VjdGlvbihcbiAgICAgICAgICAgIGl0ZW0sXG4gICAgICAgICAgICBhY3Rpb24sXG4gICAgICAgICAgICBoYW5kbGVDbG9zZU1haW5NZW51LFxuICAgICAgICAgICAgaXNMaXZlTGVhcm5pbmdIdWJFbmFibGVkXG4gICAgICAgICAgKX1cbiAgICAgICAgPC9NZW51PlxuICAgICAgPC9Nb2JpbGVTdWJNZW51V3JhcHBlcj5cbiAgICA8L01vYmlsZVVsV3JhcHBlcj5cbiAgKTtcbn07XG4iXX0= */");
|
|
25
|
+
const renderHeaderSection = (item, action, handleCloseMainMenu, isLiveLearningHubEnabled) => {
|
|
25
26
|
switch (item.type) {
|
|
26
27
|
case 'catalog-dropdown':
|
|
27
28
|
return /*#__PURE__*/_jsx(AppHeaderCatalogSection, {
|
|
@@ -33,7 +34,7 @@ const renderHeaderSection = (item, action, handleCloseMainMenu) => {
|
|
|
33
34
|
return /*#__PURE__*/_jsx(AppHeaderResourcesSection, {
|
|
34
35
|
action: action,
|
|
35
36
|
handleClose: handleCloseMainMenu,
|
|
36
|
-
resources: getHeaderResourcesList()
|
|
37
|
+
resources: getHeaderResourcesList(isLiveLearningHubEnabled)
|
|
37
38
|
});
|
|
38
39
|
default:
|
|
39
40
|
return /*#__PURE__*/_jsx(AppHeaderLinkSections, {
|
|
@@ -49,6 +50,7 @@ export const AppHeaderSubNavMobile = ({
|
|
|
49
50
|
handleCloseMainMenu,
|
|
50
51
|
item
|
|
51
52
|
}) => {
|
|
53
|
+
const isLiveLearningHubEnabled = useContext(LiveLearningHubContext);
|
|
52
54
|
const mainUlWrapper = useRef(null);
|
|
53
55
|
useEffect(() => {
|
|
54
56
|
if (mainUlWrapper?.current) {
|
|
@@ -97,7 +99,7 @@ export const AppHeaderSubNavMobile = ({
|
|
|
97
99
|
variant: "fixed",
|
|
98
100
|
mx: 8,
|
|
99
101
|
width: "calc(100% - 16px)",
|
|
100
|
-
children: renderHeaderSection(item, action, handleCloseMainMenu)
|
|
102
|
+
children: renderHeaderSection(item, action, handleCloseMainMenu, isLiveLearningHubEnabled)
|
|
101
103
|
})]
|
|
102
104
|
})]
|
|
103
105
|
});
|
|
@@ -4,6 +4,7 @@ export declare const loading: AppHeaderRenderElementItem;
|
|
|
4
4
|
export declare const logo: AppHeaderLogoItem;
|
|
5
5
|
export declare const enterpriseLogo: (user: User, removeAnchorLink?: boolean) => AppHeaderLogoItem;
|
|
6
6
|
export declare const myHome: AppHeaderLinkItem;
|
|
7
|
+
export declare const liveLearningHub: () => AppHeaderLinkItem;
|
|
7
8
|
export declare const myPercipioHome: (user: User, customTitle?: string) => AppHeaderLinkItem;
|
|
8
9
|
export declare const catalogDropdown: (hideCareerPaths?: boolean) => AppHeaderCatalogDropdownItem;
|
|
9
10
|
export declare const resourcesDropdown: () => AppHeaderResourcesDropdownItem;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Shimmer, Text } from '@codecademy/gamut';
|
|
2
|
-
import { AccountingCoinsIcon, ArrowThickCircleUpIcon, ArticleIcon, BookFlipPageIcon, BriefcaseIcon, CalendarIcon, ChatIcon, CommunityIcon, EarthIcon, GearIcon, HouseEntranceIcon, MiniArrowRightIcon, NotebookIcon, OfficeBuildingDoubleIcon, PersonIcon, PersonPonytailIcon, PieLineGraphIcon, SupportIcon } from '@codecademy/gamut-icons';
|
|
2
|
+
import { AccountingCoinsIcon, ArrowThickCircleUpIcon, ArticleIcon, BookFlipPageIcon, BriefcaseIcon, CalendarIcon, ChatIcon, CommunityIcon, EarthIcon, GearIcon, HouseEntranceIcon, MiniArrowRightIcon, NotebookIcon, OfficeBuildingDoubleIcon, OnlineClassStudentIcon, PersonIcon, PersonPonytailIcon, PieLineGraphIcon, SupportIcon } from '@codecademy/gamut-icons';
|
|
3
|
+
import { renderNewBadge } from '../lib/resourcesList';
|
|
3
4
|
import { formatEnterpriseUrl } from './urlHelpers';
|
|
4
5
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
6
|
export const loading = {
|
|
@@ -46,6 +47,16 @@ export const myHome = {
|
|
|
46
47
|
trackingTarget: 'topnav_home',
|
|
47
48
|
type: 'link'
|
|
48
49
|
};
|
|
50
|
+
export const liveLearningHub = () => ({
|
|
51
|
+
dataTestId: 'header-live-learning-hub',
|
|
52
|
+
icon: OnlineClassStudentIcon,
|
|
53
|
+
id: 'live-learning-hub',
|
|
54
|
+
text: 'Live Learning',
|
|
55
|
+
href: '/live-learning',
|
|
56
|
+
trackingTarget: 'topnav_live_learning_hub',
|
|
57
|
+
type: 'link',
|
|
58
|
+
badge: renderNewBadge(4)
|
|
59
|
+
});
|
|
49
60
|
export const myPercipioHome = (user, customTitle) => {
|
|
50
61
|
return {
|
|
51
62
|
dataTestId: 'header-percihome',
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { AppHeaderItem, FormattedAppHeaderItems, FormattedMobileAppHeaderItems } from '../AppHeader/shared';
|
|
2
2
|
import { GlobalHeaderProps } from '.';
|
|
3
3
|
import { User } from './types';
|
|
4
|
-
export declare const anonDefaultHeaderItems: (hidePricing?: boolean, user?: User) => FormattedAppHeaderItems;
|
|
5
|
-
export declare const anonDefaultMobileHeaderItems: (hidePricing?: boolean, user?: User) => FormattedMobileAppHeaderItems;
|
|
6
|
-
export declare const anonLandingHeaderItems: (hidePricing?: boolean, user?: User) => FormattedAppHeaderItems;
|
|
7
|
-
export declare const anonLandingMobileHeaderItems: (hidePricing?: boolean, user?: User) => FormattedMobileAppHeaderItems;
|
|
8
|
-
export declare const anonLoginHeaderItems: (hidePricing?: boolean, user?: User) => FormattedAppHeaderItems;
|
|
9
|
-
export declare const anonLoginMobileHeaderItems: (hidePricing?: boolean, user?: User) => FormattedMobileAppHeaderItems;
|
|
10
|
-
export declare const anonSignupHeaderItems: (hidePricing?: boolean, user?: User) => FormattedAppHeaderItems;
|
|
11
|
-
export declare const anonSignupMobileHeaderItems: (hidePricing?: boolean, user?: User) => FormattedMobileAppHeaderItems;
|
|
12
|
-
export declare const freeHeaderItems: (user: User, hidePricing?: boolean) => FormattedAppHeaderItems;
|
|
13
|
-
export declare const freeMobileHeaderItems: (user: User, hidePricing?: boolean) => FormattedMobileAppHeaderItems;
|
|
4
|
+
export declare const anonDefaultHeaderItems: (hidePricing?: boolean, user?: User, isLiveLearningHubEnabled?: boolean) => FormattedAppHeaderItems;
|
|
5
|
+
export declare const anonDefaultMobileHeaderItems: (hidePricing?: boolean, user?: User, isLiveLearningHubEnabled?: boolean) => FormattedMobileAppHeaderItems;
|
|
6
|
+
export declare const anonLandingHeaderItems: (hidePricing?: boolean, user?: User, isLiveLearningHubEnabled?: boolean) => FormattedAppHeaderItems;
|
|
7
|
+
export declare const anonLandingMobileHeaderItems: (hidePricing?: boolean, user?: User, isLiveLearningHubEnabled?: boolean) => FormattedMobileAppHeaderItems;
|
|
8
|
+
export declare const anonLoginHeaderItems: (hidePricing?: boolean, user?: User, isLiveLearningHubEnabled?: boolean) => FormattedAppHeaderItems;
|
|
9
|
+
export declare const anonLoginMobileHeaderItems: (hidePricing?: boolean, user?: User, isLiveLearningHubEnabled?: boolean) => FormattedMobileAppHeaderItems;
|
|
10
|
+
export declare const anonSignupHeaderItems: (hidePricing?: boolean, user?: User, isLiveLearningHubEnabled?: boolean) => FormattedAppHeaderItems;
|
|
11
|
+
export declare const anonSignupMobileHeaderItems: (hidePricing?: boolean, user?: User, isLiveLearningHubEnabled?: boolean) => FormattedMobileAppHeaderItems;
|
|
12
|
+
export declare const freeHeaderItems: (user: User, hidePricing?: boolean, isLiveLearningHubEnabled?: boolean) => FormattedAppHeaderItems;
|
|
13
|
+
export declare const freeMobileHeaderItems: (user: User, hidePricing?: boolean, isLiveLearningHubEnabled?: boolean) => FormattedMobileAppHeaderItems;
|
|
14
14
|
export declare const enterpriseHeaderItems: (user: User, props: GlobalHeaderProps) => {
|
|
15
15
|
left: AppHeaderItem[];
|
|
16
16
|
right: never[];
|
|
17
17
|
};
|
|
18
|
-
export declare const proHeaderItems: (user: User) => FormattedAppHeaderItems;
|
|
19
|
-
export declare const teamsHeaderItems: (user: User) => FormattedAppHeaderItems;
|
|
18
|
+
export declare const proHeaderItems: (user: User, isLiveLearningHubEnabled?: boolean) => FormattedAppHeaderItems;
|
|
19
|
+
export declare const teamsHeaderItems: (user: User, isLiveLearningHubEnabled?: boolean) => FormattedAppHeaderItems;
|
|
20
20
|
export declare const enterpriseMobileHeaderItems: (user: User, props: GlobalHeaderProps) => FormattedMobileAppHeaderItems;
|
|
21
|
-
export declare const proMobileHeaderItems: (user: User) => FormattedMobileAppHeaderItems;
|
|
22
|
-
export declare const teamsMobileHeaderItems: (user: User) => FormattedMobileAppHeaderItems;
|
|
21
|
+
export declare const proMobileHeaderItems: (user: User, isLiveLearningHubEnabled?: boolean) => FormattedMobileAppHeaderItems;
|
|
22
|
+
export declare const teamsMobileHeaderItems: (user: User, isLiveLearningHubEnabled?: boolean) => FormattedMobileAppHeaderItems;
|
|
23
23
|
export declare const loadingHeaderItems: FormattedAppHeaderItems;
|
|
24
24
|
export declare const loadingMobileHeaderItems: FormattedMobileAppHeaderItems;
|
|
25
25
|
export declare const simpleHeaderItems: FormattedAppHeaderItems;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { addPayment, bootcampCta, businessSolutions, careerCenter, catalogDropdown, communityDropdown, enterpriseLogo, freeProfile, loading, login, logo, myHome, myPercipioHome, pricingDropdown, proProfile, resourcesDropdown, signUp, simpleResourcesDropdown, tryProForFree, unpausePro, upgradePlan, upgradeToPro } from './GlobalHeaderItems';
|
|
1
|
+
import { addPayment, bootcampCta, businessSolutions, careerCenter, catalogDropdown, communityDropdown, enterpriseLogo, freeProfile, liveLearningHub, loading, login, logo, myHome, myPercipioHome, pricingDropdown, proProfile, resourcesDropdown, signUp, simpleResourcesDropdown, tryProForFree, unpausePro, upgradePlan, upgradeToPro } from './GlobalHeaderItems';
|
|
2
2
|
const transformSimpleResourcesDropdownlabels = resourcesLabel => ({
|
|
3
3
|
...simpleResourcesDropdown,
|
|
4
4
|
text: resourcesLabel?.title || simpleResourcesDropdown.text,
|
|
@@ -7,12 +7,12 @@ const transformSimpleResourcesDropdownlabels = resourcesLabel => ({
|
|
|
7
7
|
text: resourcesLabel?.[item.id] || item.text
|
|
8
8
|
}))
|
|
9
9
|
});
|
|
10
|
-
const anonHeaderItems = (renderLogin, renderSignUp, hidePricing, user) => {
|
|
10
|
+
const anonHeaderItems = (renderLogin, renderSignUp, hidePricing, user, isLiveLearningHubEnabled) => {
|
|
11
11
|
const specialLogo = {
|
|
12
12
|
...logo,
|
|
13
13
|
checkMini: true
|
|
14
14
|
};
|
|
15
|
-
const leftItems = [specialLogo, catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(), ...(hidePricing ? [] : [pricingDropdown]), careerCenter, businessSolutions];
|
|
15
|
+
const leftItems = [specialLogo, catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(), ...(hidePricing ? [] : [pricingDropdown]), ...(isLiveLearningHubEnabled ? [liveLearningHub()] : [careerCenter]), businessSolutions];
|
|
16
16
|
const rightItems = [];
|
|
17
17
|
if (renderLogin) {
|
|
18
18
|
rightItems.push(login);
|
|
@@ -25,7 +25,7 @@ const anonHeaderItems = (renderLogin, renderSignUp, hidePricing, user) => {
|
|
|
25
25
|
right: rightItems
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
|
-
const anonMobileHeaderItems = (renderLogin, renderSignUp, hidePricing, user) => {
|
|
28
|
+
const anonMobileHeaderItems = (renderLogin, renderSignUp, hidePricing, user, isLiveLearningHubEnabled) => {
|
|
29
29
|
const specialLogo = {
|
|
30
30
|
...logo,
|
|
31
31
|
checkMini: true
|
|
@@ -38,43 +38,43 @@ const anonMobileHeaderItems = (renderLogin, renderSignUp, hidePricing, user) =>
|
|
|
38
38
|
if (renderSignUp) {
|
|
39
39
|
rightItems.push(signUp);
|
|
40
40
|
}
|
|
41
|
-
const mainMenuItems = [catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(), ...(hidePricing ? [] : [pricingDropdown]), careerCenter, businessSolutions];
|
|
41
|
+
const mainMenuItems = [catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(), ...(hidePricing ? [] : [pricingDropdown]), ...(isLiveLearningHubEnabled ? [liveLearningHub()] : [careerCenter]), businessSolutions];
|
|
42
42
|
return {
|
|
43
43
|
left: leftItems,
|
|
44
44
|
right: rightItems,
|
|
45
45
|
mainMenu: mainMenuItems
|
|
46
46
|
};
|
|
47
47
|
};
|
|
48
|
-
export const anonDefaultHeaderItems = (hidePricing, user) => {
|
|
49
|
-
return anonHeaderItems(true, true, hidePricing, user);
|
|
48
|
+
export const anonDefaultHeaderItems = (hidePricing, user, isLiveLearningHubEnabled) => {
|
|
49
|
+
return anonHeaderItems(true, true, hidePricing, user, isLiveLearningHubEnabled);
|
|
50
50
|
};
|
|
51
|
-
export const anonDefaultMobileHeaderItems = (hidePricing, user) => {
|
|
52
|
-
return anonMobileHeaderItems(true, true, hidePricing, user);
|
|
51
|
+
export const anonDefaultMobileHeaderItems = (hidePricing, user, isLiveLearningHubEnabled) => {
|
|
52
|
+
return anonMobileHeaderItems(true, true, hidePricing, user, isLiveLearningHubEnabled);
|
|
53
53
|
};
|
|
54
|
-
export const anonLandingHeaderItems = (hidePricing, user) => {
|
|
55
|
-
return anonHeaderItems(true, false, hidePricing, user);
|
|
54
|
+
export const anonLandingHeaderItems = (hidePricing, user, isLiveLearningHubEnabled) => {
|
|
55
|
+
return anonHeaderItems(true, false, hidePricing, user, isLiveLearningHubEnabled);
|
|
56
56
|
};
|
|
57
|
-
export const anonLandingMobileHeaderItems = (hidePricing, user) => {
|
|
58
|
-
return anonMobileHeaderItems(true, false, hidePricing, user);
|
|
57
|
+
export const anonLandingMobileHeaderItems = (hidePricing, user, isLiveLearningHubEnabled) => {
|
|
58
|
+
return anonMobileHeaderItems(true, false, hidePricing, user, isLiveLearningHubEnabled);
|
|
59
59
|
};
|
|
60
|
-
export const anonLoginHeaderItems = (hidePricing, user) => {
|
|
61
|
-
return anonHeaderItems(false, true, hidePricing, user);
|
|
60
|
+
export const anonLoginHeaderItems = (hidePricing, user, isLiveLearningHubEnabled) => {
|
|
61
|
+
return anonHeaderItems(false, true, hidePricing, user, isLiveLearningHubEnabled);
|
|
62
62
|
};
|
|
63
|
-
export const anonLoginMobileHeaderItems = (hidePricing, user) => {
|
|
64
|
-
return anonMobileHeaderItems(false, true, hidePricing, user);
|
|
63
|
+
export const anonLoginMobileHeaderItems = (hidePricing, user, isLiveLearningHubEnabled) => {
|
|
64
|
+
return anonMobileHeaderItems(false, true, hidePricing, user, isLiveLearningHubEnabled);
|
|
65
65
|
};
|
|
66
|
-
export const anonSignupHeaderItems = (hidePricing, user) => {
|
|
67
|
-
return anonHeaderItems(true, false, hidePricing, user);
|
|
66
|
+
export const anonSignupHeaderItems = (hidePricing, user, isLiveLearningHubEnabled) => {
|
|
67
|
+
return anonHeaderItems(true, false, hidePricing, user, isLiveLearningHubEnabled);
|
|
68
68
|
};
|
|
69
|
-
export const anonSignupMobileHeaderItems = (hidePricing, user) => {
|
|
70
|
-
return anonMobileHeaderItems(true, false, hidePricing, user);
|
|
69
|
+
export const anonSignupMobileHeaderItems = (hidePricing, user, isLiveLearningHubEnabled) => {
|
|
70
|
+
return anonMobileHeaderItems(true, false, hidePricing, user, isLiveLearningHubEnabled);
|
|
71
71
|
};
|
|
72
|
-
export const freeHeaderItems = (user, hidePricing) => {
|
|
72
|
+
export const freeHeaderItems = (user, hidePricing, isLiveLearningHubEnabled) => {
|
|
73
73
|
const specialLogo = {
|
|
74
74
|
...logo,
|
|
75
75
|
checkMini: true
|
|
76
76
|
};
|
|
77
|
-
const leftItems = [specialLogo, myHome, catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(), ...(hidePricing ? [] : [pricingDropdown]), careerCenter, businessSolutions];
|
|
77
|
+
const leftItems = [specialLogo, myHome, catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(), ...(hidePricing ? [] : [pricingDropdown]), ...(isLiveLearningHubEnabled ? [liveLearningHub()] : [careerCenter]), businessSolutions];
|
|
78
78
|
const upgradeButton = upgradeToPro(user.proCheckoutUrl);
|
|
79
79
|
const rightItems = [];
|
|
80
80
|
rightItems.push(freeProfile(user));
|
|
@@ -84,7 +84,7 @@ export const freeHeaderItems = (user, hidePricing) => {
|
|
|
84
84
|
right: rightItems
|
|
85
85
|
};
|
|
86
86
|
};
|
|
87
|
-
export const freeMobileHeaderItems = (user, hidePricing) => {
|
|
87
|
+
export const freeMobileHeaderItems = (user, hidePricing, isLiveLearningHubEnabled) => {
|
|
88
88
|
const specialLogo = {
|
|
89
89
|
...logo,
|
|
90
90
|
checkMini: true
|
|
@@ -92,7 +92,7 @@ export const freeMobileHeaderItems = (user, hidePricing) => {
|
|
|
92
92
|
const leftItems = [specialLogo];
|
|
93
93
|
const rightItems = [];
|
|
94
94
|
const upgradeButton = upgradeToPro(user.proCheckoutUrl);
|
|
95
|
-
const mainMenuItems = [myHome, catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(), ...(hidePricing ? [] : [pricingDropdown]), careerCenter, businessSolutions, freeProfile(user, true), user.showProUpgrade ? upgradeButton : tryProForFree(user.proCheckoutUrl)];
|
|
95
|
+
const mainMenuItems = [myHome, catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(), ...(hidePricing ? [] : [pricingDropdown]), ...(isLiveLearningHubEnabled ? [liveLearningHub()] : [careerCenter]), businessSolutions, freeProfile(user, true), user.showProUpgrade ? upgradeButton : tryProForFree(user.proCheckoutUrl)];
|
|
96
96
|
return {
|
|
97
97
|
left: leftItems,
|
|
98
98
|
right: rightItems,
|
|
@@ -112,8 +112,8 @@ export const enterpriseHeaderItems = (user, props) => {
|
|
|
112
112
|
right: []
|
|
113
113
|
};
|
|
114
114
|
};
|
|
115
|
-
export const proHeaderItems = user => {
|
|
116
|
-
const leftItems = [logo, myHome, catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(), ...(user.isPlusUser ? [upgradePlan] : []), careerCenter, businessSolutions];
|
|
115
|
+
export const proHeaderItems = (user, isLiveLearningHubEnabled) => {
|
|
116
|
+
const leftItems = [logo, myHome, catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(), ...(user.isPlusUser ? [upgradePlan] : []), ...(isLiveLearningHubEnabled ? [liveLearningHub()] : [careerCenter]), businessSolutions];
|
|
117
117
|
const rightItems = [];
|
|
118
118
|
rightItems.push(proProfile(user));
|
|
119
119
|
if (user.isPaused) {
|
|
@@ -124,8 +124,8 @@ export const proHeaderItems = user => {
|
|
|
124
124
|
right: rightItems
|
|
125
125
|
};
|
|
126
126
|
};
|
|
127
|
-
export const teamsHeaderItems = user => {
|
|
128
|
-
const leftItems = [logo, myHome, catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(), careerCenter];
|
|
127
|
+
export const teamsHeaderItems = (user, isLiveLearningHubEnabled) => {
|
|
128
|
+
const leftItems = [logo, myHome, catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(), ...(isLiveLearningHubEnabled ? [liveLearningHub()] : [careerCenter])];
|
|
129
129
|
const rightItems = [];
|
|
130
130
|
if (user.isAccountManager && user.inBusinessTrial && !user.hasBusinessSubscription) {
|
|
131
131
|
rightItems.push(addPayment);
|
|
@@ -152,10 +152,10 @@ export const enterpriseMobileHeaderItems = (user, props) => {
|
|
|
152
152
|
mainMenu: mainMenuItems
|
|
153
153
|
};
|
|
154
154
|
};
|
|
155
|
-
export const proMobileHeaderItems = user => {
|
|
155
|
+
export const proMobileHeaderItems = (user, isLiveLearningHubEnabled) => {
|
|
156
156
|
const leftItems = [logo];
|
|
157
157
|
const rightItems = [];
|
|
158
|
-
const mainMenuItems = [myHome, catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(), ...(user.isPlusUser ? [upgradePlan] : []), careerCenter, businessSolutions, proProfile(user)];
|
|
158
|
+
const mainMenuItems = [myHome, catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(), ...(user.isPlusUser ? [upgradePlan] : []), ...(isLiveLearningHubEnabled ? [liveLearningHub()] : [careerCenter]), businessSolutions, proProfile(user)];
|
|
159
159
|
if (user.isPaused) {
|
|
160
160
|
mainMenuItems.push(unpausePro);
|
|
161
161
|
}
|
|
@@ -165,10 +165,10 @@ export const proMobileHeaderItems = user => {
|
|
|
165
165
|
mainMenu: mainMenuItems
|
|
166
166
|
};
|
|
167
167
|
};
|
|
168
|
-
export const teamsMobileHeaderItems = user => {
|
|
168
|
+
export const teamsMobileHeaderItems = (user, isLiveLearningHubEnabled) => {
|
|
169
169
|
const leftItems = [logo];
|
|
170
170
|
const rightItems = [];
|
|
171
|
-
const mainMenuItems = [myHome, catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(), careerCenter, proProfile(user)];
|
|
171
|
+
const mainMenuItems = [myHome, catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(), ...(isLiveLearningHubEnabled ? [liveLearningHub()] : [careerCenter]), proProfile(user)];
|
|
172
172
|
if (user.isAccountManager && user.inBusinessTrial && !user.hasBusinessSubscription) {
|
|
173
173
|
mainMenuItems.push(addPayment);
|
|
174
174
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { AnonHeader, EnterpriseHeader, FreeHeader, LoadingHeader, ProHeader, SimpleBootcampHeader, SimpleHeader, TeamsHeader } from './types';
|
|
3
3
|
export * from './types';
|
|
4
|
-
export
|
|
4
|
+
export declare const LiveLearningHubContext: React.Context<boolean>;
|
|
5
5
|
export declare const HeaderQuizContext: React.Context<{
|
|
6
6
|
showOnboardingQuiz?: boolean;
|
|
7
7
|
showSortingQuiz?: boolean;
|
|
8
8
|
}>;
|
|
9
|
+
export type GlobalHeaderProps = AnonHeader | FreeHeader | ProHeader | EnterpriseHeader | TeamsHeader | LoadingHeader | SimpleHeader | SimpleBootcampHeader;
|
|
9
10
|
export declare const GlobalHeader: React.FC<GlobalHeaderProps>;
|
|
@@ -1,38 +1,44 @@
|
|
|
1
1
|
import { Box } from '@codecademy/gamut';
|
|
2
2
|
import { useTheme } from '@emotion/react';
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import { useCallback } from 'react';
|
|
4
|
+
import { useCallback, useContext } from 'react';
|
|
5
5
|
import { AppHeader, AppHeaderMobile, isAppHeaderItemWithHref } from '..';
|
|
6
6
|
import { anonDefaultHeaderItems, anonDefaultMobileHeaderItems, anonLandingHeaderItems, anonLandingMobileHeaderItems, anonLoginHeaderItems, anonLoginMobileHeaderItems, anonSignupHeaderItems, anonSignupMobileHeaderItems, enterpriseHeaderItems, enterpriseMobileHeaderItems, freeHeaderItems, freeMobileHeaderItems, loadingHeaderItems, loadingMobileHeaderItems, proHeaderItems, proMobileHeaderItems, simpleBootcampHeaderItems, simpleBootcampMobileHeaderItems, simpleHeaderItems, simpleMobileHeaderItems, teamsHeaderItems, teamsMobileHeaderItems } from './GlobalHeaderVariants';
|
|
7
7
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
8
|
export * from './types';
|
|
9
|
+
export const LiveLearningHubContext = /*#__PURE__*/React.createContext(false);
|
|
10
|
+
export const HeaderQuizContext = /*#__PURE__*/React.createContext({
|
|
11
|
+
showOnboardingQuiz: false,
|
|
12
|
+
showSortingQuiz: false
|
|
13
|
+
});
|
|
9
14
|
|
|
10
15
|
// Overloading getAppHeaderItems function to return different types based on mobile parameter
|
|
11
16
|
|
|
12
17
|
function getAppHeaderItems(props, mobile) {
|
|
13
18
|
const {
|
|
14
|
-
hidePricing
|
|
19
|
+
hidePricing,
|
|
20
|
+
isLiveLearningHubEnabled
|
|
15
21
|
} = props;
|
|
16
22
|
switch (props.type) {
|
|
17
23
|
case 'anon':
|
|
18
24
|
switch (props.variant) {
|
|
19
25
|
case 'landing':
|
|
20
|
-
return mobile ? anonLandingMobileHeaderItems(hidePricing, props.user) : anonLandingHeaderItems(hidePricing, props.user);
|
|
26
|
+
return mobile ? anonLandingMobileHeaderItems(hidePricing, props.user, isLiveLearningHubEnabled) : anonLandingHeaderItems(hidePricing, props.user, isLiveLearningHubEnabled);
|
|
21
27
|
case 'login':
|
|
22
|
-
return mobile ? anonLoginMobileHeaderItems(hidePricing, props.user) : anonLoginHeaderItems(hidePricing, props.user);
|
|
28
|
+
return mobile ? anonLoginMobileHeaderItems(hidePricing, props.user, isLiveLearningHubEnabled) : anonLoginHeaderItems(hidePricing, props.user, isLiveLearningHubEnabled);
|
|
23
29
|
case 'signup':
|
|
24
|
-
return mobile ? anonSignupMobileHeaderItems(hidePricing, props.user) : anonSignupHeaderItems(hidePricing, props.user);
|
|
30
|
+
return mobile ? anonSignupMobileHeaderItems(hidePricing, props.user, isLiveLearningHubEnabled) : anonSignupHeaderItems(hidePricing, props.user, isLiveLearningHubEnabled);
|
|
25
31
|
default:
|
|
26
|
-
return mobile ? anonDefaultMobileHeaderItems(hidePricing, props.user) : anonDefaultHeaderItems(hidePricing, props.user);
|
|
32
|
+
return mobile ? anonDefaultMobileHeaderItems(hidePricing, props.user, isLiveLearningHubEnabled) : anonDefaultHeaderItems(hidePricing, props.user, isLiveLearningHubEnabled);
|
|
27
33
|
}
|
|
28
34
|
case 'enterprise':
|
|
29
35
|
return mobile ? enterpriseMobileHeaderItems(props.user, props) : enterpriseHeaderItems(props.user, props);
|
|
30
36
|
case 'free':
|
|
31
|
-
return mobile ? freeMobileHeaderItems(props.user, hidePricing) : freeHeaderItems(props.user, hidePricing);
|
|
37
|
+
return mobile ? freeMobileHeaderItems(props.user, hidePricing, isLiveLearningHubEnabled) : freeHeaderItems(props.user, hidePricing, isLiveLearningHubEnabled);
|
|
32
38
|
case 'pro':
|
|
33
|
-
return mobile ? proMobileHeaderItems(props.user) : proHeaderItems(props.user);
|
|
39
|
+
return mobile ? proMobileHeaderItems(props.user, isLiveLearningHubEnabled) : proHeaderItems(props.user, isLiveLearningHubEnabled);
|
|
34
40
|
case 'teams':
|
|
35
|
-
return mobile ? teamsMobileHeaderItems(props.user) : teamsHeaderItems(props.user);
|
|
41
|
+
return mobile ? teamsMobileHeaderItems(props.user, isLiveLearningHubEnabled) : teamsHeaderItems(props.user, isLiveLearningHubEnabled);
|
|
36
42
|
case 'simple':
|
|
37
43
|
return mobile ? simpleMobileHeaderItems : simpleHeaderItems;
|
|
38
44
|
case 'bootcamp':
|
|
@@ -41,16 +47,16 @@ function getAppHeaderItems(props, mobile) {
|
|
|
41
47
|
return mobile ? loadingMobileHeaderItems : loadingHeaderItems;
|
|
42
48
|
}
|
|
43
49
|
}
|
|
44
|
-
export const HeaderQuizContext = /*#__PURE__*/React.createContext({
|
|
45
|
-
showOnboardingQuiz: false,
|
|
46
|
-
showSortingQuiz: false
|
|
47
|
-
});
|
|
48
50
|
export const GlobalHeader = props => {
|
|
49
51
|
const {
|
|
50
52
|
action,
|
|
51
53
|
onLinkAction
|
|
52
54
|
} = props;
|
|
53
55
|
const theme = useTheme();
|
|
56
|
+
|
|
57
|
+
// Use context to get the live learning hub value, fallback to props for backward compatibility
|
|
58
|
+
const contextValue = useContext(LiveLearningHubContext);
|
|
59
|
+
const isLiveLearningHubEnabled = contextValue || !!props.isLiveLearningHubEnabled;
|
|
54
60
|
const combinedAction = useCallback((event, item) => {
|
|
55
61
|
action(event, item);
|
|
56
62
|
if (isAppHeaderItemWithHref(item)) onLinkAction?.(event, item);
|
|
@@ -63,38 +69,41 @@ export const GlobalHeader = props => {
|
|
|
63
69
|
showOnboardingQuiz,
|
|
64
70
|
showSortingQuiz
|
|
65
71
|
},
|
|
66
|
-
children: /*#__PURE__*/
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
72
|
+
children: /*#__PURE__*/_jsx(LiveLearningHubContext.Provider, {
|
|
73
|
+
value: isLiveLearningHubEnabled,
|
|
74
|
+
children: /*#__PURE__*/_jsxs(Box, {
|
|
75
|
+
as: "header",
|
|
76
|
+
position: "sticky",
|
|
77
|
+
top: 0,
|
|
78
|
+
zIndex: theme.elements.headerZ,
|
|
79
|
+
children: [/*#__PURE__*/_jsx(AppHeader, {
|
|
80
|
+
action: combinedAction,
|
|
81
|
+
items: getAppHeaderItems(props, false),
|
|
82
|
+
search: props.search,
|
|
83
|
+
...(props.type === 'anon' ? {
|
|
84
|
+
redirectParam: props.redirectParam
|
|
85
|
+
} : hideNotification ? {} : {
|
|
86
|
+
notifications: props.notifications
|
|
87
|
+
}),
|
|
88
|
+
hideRightButtonDefaults: hideNotification,
|
|
89
|
+
isAnon: props.type === 'anon',
|
|
90
|
+
isTeams: props.type === 'teams',
|
|
91
|
+
type: hideNotification ? 'enterprise' : 'standard'
|
|
92
|
+
}), /*#__PURE__*/_jsx(AppHeaderMobile, {
|
|
93
|
+
action: combinedAction,
|
|
94
|
+
items: getAppHeaderItems(props, true),
|
|
95
|
+
...(props.type === 'anon' || hideNotification ? {} : {
|
|
96
|
+
notifications: props.notifications
|
|
97
|
+
}),
|
|
98
|
+
search: props.search,
|
|
99
|
+
redirectParam: props.type === 'anon' ? props.redirectParam : undefined,
|
|
100
|
+
isEnterprise: props.type === 'enterprise',
|
|
101
|
+
isAnon: props.type === 'anon',
|
|
102
|
+
isSimple: props.type === 'simple',
|
|
103
|
+
hideRightMenuButton: props.type === 'simple' || props.type === 'loading',
|
|
104
|
+
navigationMenuFormattedLabel: props?.localizedLabels?.navigationMenuFormattedLabel
|
|
105
|
+
}), props.children]
|
|
106
|
+
})
|
|
98
107
|
})
|
|
99
108
|
});
|
|
100
109
|
};
|
|
@@ -47,13 +47,13 @@ export const ResourceCard = ({
|
|
|
47
47
|
pt: 12,
|
|
48
48
|
pb: 4,
|
|
49
49
|
children: title
|
|
50
|
-
}), description &&
|
|
50
|
+
}), description && /*#__PURE__*/_jsx(Text, {
|
|
51
51
|
variant: "p-small",
|
|
52
52
|
truncate: "ellipsis",
|
|
53
53
|
truncateLines: 2,
|
|
54
54
|
mb: 16,
|
|
55
55
|
children: description
|
|
56
|
-
})
|
|
56
|
+
})]
|
|
57
57
|
})]
|
|
58
58
|
});
|
|
59
59
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { AppHeaderLinkItem } from '../../AppHeader/shared';
|
|
1
|
+
import { AppHeaderLinkItem, AppHeaderResourcesDataItem } from '../../AppHeader/shared';
|
|
2
2
|
export declare const careerPaths: AppHeaderLinkItem[];
|
|
3
|
+
export declare const liveLearningHubItems: AppHeaderResourcesDataItem;
|
|
3
4
|
export declare const topLanguages: AppHeaderLinkItem[];
|
|
4
5
|
export declare const getTopSubjects: () => AppHeaderLinkItem[];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { renderNewBadge } from '../resourcesList';
|
|
1
2
|
export const careerPaths = [{
|
|
2
3
|
id: 'full-stack-engineer-career-path',
|
|
3
4
|
href: '/learn/paths/full-stack-engineer-career-path',
|
|
@@ -35,6 +36,31 @@ export const careerPaths = [{
|
|
|
35
36
|
text: 'Data Scientist',
|
|
36
37
|
type: 'link'
|
|
37
38
|
}];
|
|
39
|
+
|
|
40
|
+
// TODO: replace copy for placeholder text (lorem ipsum)
|
|
41
|
+
export const liveLearningHubItems = {
|
|
42
|
+
title: 'Live Learning',
|
|
43
|
+
description: 'Build skills faster through live learning with expert instructors.',
|
|
44
|
+
data: [{
|
|
45
|
+
id: 'bootcamps',
|
|
46
|
+
href: '/live-learning#bootcamps',
|
|
47
|
+
text: 'Bootcamps',
|
|
48
|
+
description: 'Lorem ipsum dolor sit amet, consectetur',
|
|
49
|
+
trackingTarget: 'topnav_catalog_live_learning_bootcamps',
|
|
50
|
+
type: 'link',
|
|
51
|
+
newTab: true,
|
|
52
|
+
badge: renderNewBadge()
|
|
53
|
+
}, {
|
|
54
|
+
id: 'gk',
|
|
55
|
+
href: '/live-learning#gk',
|
|
56
|
+
text: 'GK x Codecademy',
|
|
57
|
+
description: 'Lorem ipsum dolor sit amet, consectetur',
|
|
58
|
+
trackingTarget: 'topnav_catalog_live_learning_gk_codecademy',
|
|
59
|
+
type: 'link',
|
|
60
|
+
newTab: true,
|
|
61
|
+
badge: renderNewBadge()
|
|
62
|
+
}]
|
|
63
|
+
};
|
|
38
64
|
export const topLanguages = [{
|
|
39
65
|
id: 'python',
|
|
40
66
|
href: '/catalog/language/python',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AppFooterResourcesDataItem, AppHeaderResourcesDataItem } from '../../AppHeader/shared';
|
|
2
2
|
export declare const renderBadge: (text: string) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
export declare const renderNewBadge: () => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const renderNewBadge: (mt?: number) => import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export declare const footerResourcesList: AppFooterResourcesDataItem[];
|
|
5
|
-
export declare const getHeaderResourcesList: () => AppHeaderResourcesDataItem[];
|
|
5
|
+
export declare const getHeaderResourcesList: (isLiveLearningHubEnabled?: boolean) => AppHeaderResourcesDataItem[];
|
|
@@ -6,9 +6,9 @@ export const renderBadge = text => /*#__PURE__*/_jsx(Badge, {
|
|
|
6
6
|
alignSelf: "center",
|
|
7
7
|
children: text
|
|
8
8
|
});
|
|
9
|
-
export const renderNewBadge = () => /*#__PURE__*/_jsx(Badge, {
|
|
9
|
+
export const renderNewBadge = (mt = 2) => /*#__PURE__*/_jsx(Badge, {
|
|
10
10
|
size: "sm",
|
|
11
|
-
mt:
|
|
11
|
+
mt: mt,
|
|
12
12
|
ml: 8,
|
|
13
13
|
alignSelf: "start",
|
|
14
14
|
variant: "accent",
|
|
@@ -56,7 +56,7 @@ export const footerResourcesList = [{
|
|
|
56
56
|
trackingTarget: 'workspaces',
|
|
57
57
|
text: 'Workspaces'
|
|
58
58
|
}];
|
|
59
|
-
export const getHeaderResourcesList =
|
|
59
|
+
export const getHeaderResourcesList = isLiveLearningHubEnabled => {
|
|
60
60
|
const inspirationSection = {
|
|
61
61
|
title: 'Inspiration & career',
|
|
62
62
|
links: [{
|
|
@@ -83,7 +83,16 @@ export const getHeaderResourcesList = () => {
|
|
|
83
83
|
trackingTarget: 'topnav_resources_inspiration_learning_tips',
|
|
84
84
|
type: 'link',
|
|
85
85
|
newTab: true
|
|
86
|
-
}, {
|
|
86
|
+
}, ...(isLiveLearningHubEnabled ? [{
|
|
87
|
+
id: 'career-center',
|
|
88
|
+
href: '/career-center',
|
|
89
|
+
text: 'Career Center',
|
|
90
|
+
description: 'Get tools to reach your tech career goals.',
|
|
91
|
+
trackingTarget: 'topnav_resources_inspiration_career_center',
|
|
92
|
+
type: 'link',
|
|
93
|
+
newTab: true,
|
|
94
|
+
badge: renderNewBadge()
|
|
95
|
+
}] : [{
|
|
87
96
|
id: 'job-readiness-check',
|
|
88
97
|
href: '/job-readiness',
|
|
89
98
|
text: 'Job-readiness checker',
|
|
@@ -92,7 +101,7 @@ export const getHeaderResourcesList = () => {
|
|
|
92
101
|
type: 'link',
|
|
93
102
|
newTab: true,
|
|
94
103
|
badge: renderNewBadge()
|
|
95
|
-
}]
|
|
104
|
+
}])]
|
|
96
105
|
};
|
|
97
106
|
return [{
|
|
98
107
|
title: 'Docs',
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codecademy/brand",
|
|
3
3
|
"description": "Brand component library for Codecademy",
|
|
4
|
-
"version": "1.25.0
|
|
4
|
+
"version": "1.25.0",
|
|
5
5
|
"author": "Codecademy Engineering <dev@codecademy.com>",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@emotion/is-prop-valid": "^1.2.1",
|