@codecademy/brand 3.14.0-alpha.b4a7d94973.0 → 3.14.0-alpha.c1be8cc71a.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/AppHeaderCatalogDropdown/NavPanels.js +2 -10
- package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogDropdown/consts.js +5 -5
- package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogDropdown/index.js +20 -5
- package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogSection/index.js +3 -3
- package/dist/AppHeader/AppHeaderElements/AppHeaderDietCard/index.d.ts +1 -2
- package/dist/AppHeader/AppHeaderElements/AppHeaderDietCard/index.js +28 -10
- package/dist/AppHeader/AppHeaderElements/AppHeaderLinkSections/index.js +0 -0
- package/dist/AppHeader/AppHeaderElements/AppHeaderResourcesDropdown/consts.js +21 -21
- package/dist/AppHeader/AppHeaderElements/AppHeaderResourcesDropdown/index.js +25 -4
- package/dist/AppHeader/Search/QuizAndHelpCenterLinks.js +3 -4
- package/dist/AppHeaderMobile/AppHeaderSubMenuMobile/index.js +4 -3
- package/dist/GlobalHeader/GlobalHeaderItems.d.ts +1 -1
- package/dist/GlobalHeader/GlobalHeaderItems.js +25 -27
- package/dist/GlobalHeader/GlobalHeaderVariants.d.ts +10 -10
- package/dist/GlobalHeader/GlobalHeaderVariants.js +24 -24
- package/dist/GlobalHeader/context.d.ts +21 -1
- package/dist/GlobalHeader/context.js +64 -2
- package/dist/GlobalHeader/index.d.ts +0 -5
- package/dist/GlobalHeader/index.js +57 -61
- package/dist/GlobalHeader/types.d.ts +0 -1
- package/package.json +1 -1
|
@@ -11,12 +11,12 @@ const transformSimpleResourcesDropdownlabels = resourcesLabel => ({
|
|
|
11
11
|
text: resourcesLabel?.[item.id] || item.text
|
|
12
12
|
}))
|
|
13
13
|
});
|
|
14
|
-
const anonHeaderItems = (renderLogin, renderSignUp, hidePricing, user, isBlpHeroExperimentVariant
|
|
14
|
+
const anonHeaderItems = (renderLogin, renderSignUp, hidePricing, user, isBlpHeroExperimentVariant) => {
|
|
15
15
|
const specialLogo = {
|
|
16
16
|
...logo,
|
|
17
17
|
checkMini: true
|
|
18
18
|
};
|
|
19
|
-
const leftItems = [specialLogo, catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(), ...(hidePricing ? [] : [pricingDropdown
|
|
19
|
+
const leftItems = [specialLogo, catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(), ...(hidePricing ? [] : [pricingDropdown]), liveLearningHub, businessSolutions];
|
|
20
20
|
const rightItems = [];
|
|
21
21
|
if (isBusinessPage(isBlpHeroExperimentVariant)) {
|
|
22
22
|
if (renderSignUp) {
|
|
@@ -38,7 +38,7 @@ const anonHeaderItems = (renderLogin, renderSignUp, hidePricing, user, isBlpHero
|
|
|
38
38
|
right: rightItems
|
|
39
39
|
};
|
|
40
40
|
};
|
|
41
|
-
const anonMobileHeaderItems = (renderLogin, renderSignUp, hidePricing, user, isBlpHeroExperimentVariant
|
|
41
|
+
const anonMobileHeaderItems = (renderLogin, renderSignUp, hidePricing, user, isBlpHeroExperimentVariant) => {
|
|
42
42
|
const specialLogo = {
|
|
43
43
|
...logo,
|
|
44
44
|
checkMini: true
|
|
@@ -60,43 +60,43 @@ const anonMobileHeaderItems = (renderLogin, renderSignUp, hidePricing, user, isB
|
|
|
60
60
|
rightItems.push(signUp);
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
const mainMenuItems = [catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(), ...(hidePricing ? [] : [pricingDropdown
|
|
63
|
+
const mainMenuItems = [catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(), ...(hidePricing ? [] : [pricingDropdown]), liveLearningHub, businessSolutions];
|
|
64
64
|
return {
|
|
65
65
|
left: leftItems,
|
|
66
66
|
right: rightItems,
|
|
67
67
|
mainMenu: mainMenuItems
|
|
68
68
|
};
|
|
69
69
|
};
|
|
70
|
-
export const anonDefaultHeaderItems = (hidePricing, user, isBlpHeroExperimentVariant
|
|
71
|
-
return anonHeaderItems(true, true, hidePricing, user, isBlpHeroExperimentVariant
|
|
70
|
+
export const anonDefaultHeaderItems = (hidePricing, user, isBlpHeroExperimentVariant) => {
|
|
71
|
+
return anonHeaderItems(true, true, hidePricing, user, isBlpHeroExperimentVariant);
|
|
72
72
|
};
|
|
73
|
-
export const anonDefaultMobileHeaderItems = (hidePricing, user, isBlpHeroExperimentVariant
|
|
74
|
-
return anonMobileHeaderItems(true, true, hidePricing, user, isBlpHeroExperimentVariant
|
|
73
|
+
export const anonDefaultMobileHeaderItems = (hidePricing, user, isBlpHeroExperimentVariant) => {
|
|
74
|
+
return anonMobileHeaderItems(true, true, hidePricing, user, isBlpHeroExperimentVariant);
|
|
75
75
|
};
|
|
76
|
-
export const anonLandingHeaderItems = (hidePricing, user
|
|
77
|
-
return anonHeaderItems(true, false, hidePricing, user
|
|
76
|
+
export const anonLandingHeaderItems = (hidePricing, user) => {
|
|
77
|
+
return anonHeaderItems(true, false, hidePricing, user);
|
|
78
78
|
};
|
|
79
|
-
export const anonLandingMobileHeaderItems = (hidePricing, user
|
|
80
|
-
return anonMobileHeaderItems(true, false, hidePricing, user
|
|
79
|
+
export const anonLandingMobileHeaderItems = (hidePricing, user) => {
|
|
80
|
+
return anonMobileHeaderItems(true, false, hidePricing, user);
|
|
81
81
|
};
|
|
82
|
-
export const anonLoginHeaderItems = (hidePricing, user
|
|
83
|
-
return anonHeaderItems(false, true, hidePricing, user
|
|
82
|
+
export const anonLoginHeaderItems = (hidePricing, user) => {
|
|
83
|
+
return anonHeaderItems(false, true, hidePricing, user);
|
|
84
84
|
};
|
|
85
|
-
export const anonLoginMobileHeaderItems = (hidePricing, user
|
|
86
|
-
return anonMobileHeaderItems(false, true, hidePricing, user
|
|
85
|
+
export const anonLoginMobileHeaderItems = (hidePricing, user) => {
|
|
86
|
+
return anonMobileHeaderItems(false, true, hidePricing, user);
|
|
87
87
|
};
|
|
88
|
-
export const anonSignupHeaderItems = (hidePricing, user
|
|
89
|
-
return anonHeaderItems(true, false, hidePricing, user
|
|
88
|
+
export const anonSignupHeaderItems = (hidePricing, user) => {
|
|
89
|
+
return anonHeaderItems(true, false, hidePricing, user);
|
|
90
90
|
};
|
|
91
|
-
export const anonSignupMobileHeaderItems = (hidePricing, user
|
|
92
|
-
return anonMobileHeaderItems(true, false, hidePricing, user
|
|
91
|
+
export const anonSignupMobileHeaderItems = (hidePricing, user) => {
|
|
92
|
+
return anonMobileHeaderItems(true, false, hidePricing, user);
|
|
93
93
|
};
|
|
94
|
-
export const freeHeaderItems = (user, hidePricing
|
|
94
|
+
export const freeHeaderItems = (user, hidePricing) => {
|
|
95
95
|
const specialLogo = {
|
|
96
96
|
...logo,
|
|
97
97
|
checkMini: true
|
|
98
98
|
};
|
|
99
|
-
const leftItems = [specialLogo, myHome, catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(), ...(hidePricing ? [] : [pricingDropdown
|
|
99
|
+
const leftItems = [specialLogo, myHome, catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(), ...(hidePricing ? [] : [pricingDropdown]), liveLearningHub, businessSolutions];
|
|
100
100
|
const upgradeButton = upgradeToPro(user.proCheckoutUrl);
|
|
101
101
|
const rightItems = [];
|
|
102
102
|
rightItems.push(freeProfile(user));
|
|
@@ -106,7 +106,7 @@ export const freeHeaderItems = (user, hidePricing, isInRevampedBlpExperimentVari
|
|
|
106
106
|
right: rightItems
|
|
107
107
|
};
|
|
108
108
|
};
|
|
109
|
-
export const freeMobileHeaderItems = (user, hidePricing
|
|
109
|
+
export const freeMobileHeaderItems = (user, hidePricing) => {
|
|
110
110
|
const specialLogo = {
|
|
111
111
|
...logo,
|
|
112
112
|
checkMini: true
|
|
@@ -114,7 +114,7 @@ export const freeMobileHeaderItems = (user, hidePricing, isInRevampedBlpExperime
|
|
|
114
114
|
const leftItems = [specialLogo];
|
|
115
115
|
const rightItems = [];
|
|
116
116
|
const upgradeButton = upgradeToPro(user.proCheckoutUrl);
|
|
117
|
-
const mainMenuItems = [myHome, catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(), ...(hidePricing ? [] : [pricingDropdown
|
|
117
|
+
const mainMenuItems = [myHome, catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(), ...(hidePricing ? [] : [pricingDropdown]), liveLearningHub, businessSolutions, freeProfile(user), user.showProUpgrade ? upgradeButton : tryProForFree(user.proCheckoutUrl)];
|
|
118
118
|
return {
|
|
119
119
|
left: leftItems,
|
|
120
120
|
right: rightItems,
|
|
@@ -11,4 +11,24 @@ export interface GlobalHeaderDynamicDataContextType {
|
|
|
11
11
|
}
|
|
12
12
|
declare const GlobalHeaderDynamicDataContext: React.Context<GlobalHeaderDynamicDataContextType>;
|
|
13
13
|
export declare const useGlobalHeaderDynamicDataContext: () => GlobalHeaderDynamicDataContextType;
|
|
14
|
-
export
|
|
14
|
+
export declare const DropdownPositions: Record<'free' | 'anon' | 'pro' | 'teams' | 'default', {
|
|
15
|
+
catalogDropdown: {
|
|
16
|
+
narrow: string;
|
|
17
|
+
wide: string;
|
|
18
|
+
};
|
|
19
|
+
resourceDropdown: {
|
|
20
|
+
narrow: string;
|
|
21
|
+
wide: string;
|
|
22
|
+
};
|
|
23
|
+
}>;
|
|
24
|
+
declare const HeaderDisplayContext: React.Context<{
|
|
25
|
+
showOnboardingQuiz?: boolean;
|
|
26
|
+
showSortingQuiz?: boolean;
|
|
27
|
+
headerType: keyof typeof DropdownPositions;
|
|
28
|
+
}>;
|
|
29
|
+
export declare const useHeaderDisplayContext: () => {
|
|
30
|
+
showOnboardingQuiz?: boolean;
|
|
31
|
+
showSortingQuiz?: boolean;
|
|
32
|
+
headerType: keyof typeof DropdownPositions;
|
|
33
|
+
};
|
|
34
|
+
export { GlobalHeaderDynamicDataContext, GlobalHeaderItemClickContext, HeaderDisplayContext, };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createContext, useContext } from 'react';
|
|
1
|
+
import React, { createContext, useContext } from 'react';
|
|
2
2
|
const GlobalHeaderItemClickContext = /*#__PURE__*/createContext({
|
|
3
3
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
4
4
|
globalHeaderItemClick: () => {}
|
|
@@ -12,4 +12,66 @@ const GlobalHeaderDynamicDataContext = /*#__PURE__*/createContext({
|
|
|
12
12
|
export const useGlobalHeaderDynamicDataContext = () => {
|
|
13
13
|
return useContext(GlobalHeaderDynamicDataContext);
|
|
14
14
|
};
|
|
15
|
-
export
|
|
15
|
+
export const DropdownPositions = {
|
|
16
|
+
free: {
|
|
17
|
+
catalogDropdown: {
|
|
18
|
+
narrow: '-9rem',
|
|
19
|
+
wide: '-14rem'
|
|
20
|
+
},
|
|
21
|
+
resourceDropdown: {
|
|
22
|
+
narrow: '-14.5rem',
|
|
23
|
+
wide: '-19.5rem'
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
anon: {
|
|
27
|
+
catalogDropdown: {
|
|
28
|
+
narrow: '-4rem',
|
|
29
|
+
wide: '-9.5rem'
|
|
30
|
+
},
|
|
31
|
+
resourceDropdown: {
|
|
32
|
+
narrow: '-9.5rem',
|
|
33
|
+
wide: '-14.5rem'
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
pro: {
|
|
37
|
+
catalogDropdown: {
|
|
38
|
+
narrow: '-14rem',
|
|
39
|
+
wide: '-14rem'
|
|
40
|
+
},
|
|
41
|
+
resourceDropdown: {
|
|
42
|
+
narrow: '-19.5rem',
|
|
43
|
+
wide: '-19.5rem'
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
teams: {
|
|
47
|
+
catalogDropdown: {
|
|
48
|
+
narrow: '-14rem',
|
|
49
|
+
wide: '-14rem'
|
|
50
|
+
},
|
|
51
|
+
resourceDropdown: {
|
|
52
|
+
narrow: '-19.5rem',
|
|
53
|
+
wide: '-19.5rem'
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
// won't be used, but is here to handle the case where the header type is not one of the above
|
|
57
|
+
// other header types are not part of the experiment
|
|
58
|
+
default: {
|
|
59
|
+
catalogDropdown: {
|
|
60
|
+
narrow: '-9rem',
|
|
61
|
+
wide: '-9rem'
|
|
62
|
+
},
|
|
63
|
+
resourceDropdown: {
|
|
64
|
+
narrow: '-14.5rem',
|
|
65
|
+
wide: '-14.5rem'
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
const HeaderDisplayContext = /*#__PURE__*/React.createContext({
|
|
70
|
+
showOnboardingQuiz: false,
|
|
71
|
+
showSortingQuiz: false,
|
|
72
|
+
headerType: 'default'
|
|
73
|
+
});
|
|
74
|
+
export const useHeaderDisplayContext = () => {
|
|
75
|
+
return useContext(HeaderDisplayContext);
|
|
76
|
+
};
|
|
77
|
+
export { GlobalHeaderDynamicDataContext, GlobalHeaderItemClickContext, HeaderDisplayContext };
|
|
@@ -2,12 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { AnonHeader, EnterpriseHeader, FreeHeader, LoadingHeader, ProHeader, SimpleBootcampHeader, SimpleHeader, TeamsHeader } from './types';
|
|
3
3
|
export * from './types';
|
|
4
4
|
export declare const LiveLearningHubContext: React.Context<boolean>;
|
|
5
|
-
export declare const HeaderQuizContext: React.Context<{
|
|
6
|
-
showOnboardingQuiz?: boolean;
|
|
7
|
-
showSortingQuiz?: boolean;
|
|
8
|
-
}>;
|
|
9
5
|
export declare const GlobalNavRedesignContext: React.Context<boolean>;
|
|
10
6
|
export declare const BlpHeroExperimentContext: React.Context<boolean>;
|
|
11
|
-
export declare const RevampedBlpExperimentContext: React.Context<boolean>;
|
|
12
7
|
export type GlobalHeaderProps = AnonHeader | FreeHeader | ProHeader | EnterpriseHeader | TeamsHeader | LoadingHeader | SimpleHeader | SimpleBootcampHeader;
|
|
13
8
|
export declare const GlobalHeader: React.FC<GlobalHeaderProps>;
|
|
@@ -3,18 +3,13 @@ import { useTheme } from '@emotion/react';
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { useCallback, useMemo } from 'react';
|
|
5
5
|
import { AppHeader, AppHeaderMobile, isAppHeaderItemWithHref } from '..';
|
|
6
|
-
import { GlobalHeaderDynamicDataContext, GlobalHeaderItemClickContext } from './context';
|
|
6
|
+
import { DropdownPositions, GlobalHeaderDynamicDataContext, GlobalHeaderItemClickContext, HeaderDisplayContext } from './context';
|
|
7
7
|
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';
|
|
8
8
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
9
|
export * from './types';
|
|
10
10
|
export const LiveLearningHubContext = /*#__PURE__*/React.createContext(false);
|
|
11
|
-
export const HeaderQuizContext = /*#__PURE__*/React.createContext({
|
|
12
|
-
showOnboardingQuiz: false,
|
|
13
|
-
showSortingQuiz: false
|
|
14
|
-
});
|
|
15
11
|
export const GlobalNavRedesignContext = /*#__PURE__*/React.createContext(false);
|
|
16
12
|
export const BlpHeroExperimentContext = /*#__PURE__*/React.createContext(false);
|
|
17
|
-
export const RevampedBlpExperimentContext = /*#__PURE__*/React.createContext(false);
|
|
18
13
|
|
|
19
14
|
// Overloading getAppHeaderItems function to return different types based on mobile parameter
|
|
20
15
|
|
|
@@ -29,18 +24,18 @@ function getAppHeaderItems(props, mobile, dynamicDataLoading) {
|
|
|
29
24
|
case 'anon':
|
|
30
25
|
switch (props.variant) {
|
|
31
26
|
case 'landing':
|
|
32
|
-
return mobile ? anonLandingMobileHeaderItems(hidePricing, props.user
|
|
27
|
+
return mobile ? anonLandingMobileHeaderItems(hidePricing, props.user) : anonLandingHeaderItems(hidePricing, props.user);
|
|
33
28
|
case 'login':
|
|
34
|
-
return mobile ? anonLoginMobileHeaderItems(hidePricing, props.user
|
|
29
|
+
return mobile ? anonLoginMobileHeaderItems(hidePricing, props.user) : anonLoginHeaderItems(hidePricing, props.user);
|
|
35
30
|
case 'signup':
|
|
36
|
-
return mobile ? anonSignupMobileHeaderItems(hidePricing, props.user
|
|
31
|
+
return mobile ? anonSignupMobileHeaderItems(hidePricing, props.user) : anonSignupHeaderItems(hidePricing, props.user);
|
|
37
32
|
default:
|
|
38
|
-
return mobile ? anonDefaultMobileHeaderItems(hidePricing, props.user, props.isBlpHeroExperimentVariant
|
|
33
|
+
return mobile ? anonDefaultMobileHeaderItems(hidePricing, props.user, props.isBlpHeroExperimentVariant) : anonDefaultHeaderItems(hidePricing, props.user, props.isBlpHeroExperimentVariant);
|
|
39
34
|
}
|
|
40
35
|
case 'enterprise':
|
|
41
36
|
return mobile ? enterpriseMobileHeaderItems(props.user, props) : enterpriseHeaderItems(props.user, props);
|
|
42
37
|
case 'free':
|
|
43
|
-
return mobile ? freeMobileHeaderItems(props.user, hidePricing
|
|
38
|
+
return mobile ? freeMobileHeaderItems(props.user, hidePricing) : freeHeaderItems(props.user, hidePricing);
|
|
44
39
|
case 'pro':
|
|
45
40
|
return mobile ? proMobileHeaderItems(props.user) : proHeaderItems(props.user);
|
|
46
41
|
case 'teams':
|
|
@@ -68,63 +63,64 @@ export const GlobalHeader = props => {
|
|
|
68
63
|
const hideNotification = props.type === 'loading' || props.type === 'enterprise' || props.type === 'simple' || props.type === 'bootcamp';
|
|
69
64
|
const showOnboardingQuiz = props.type === 'anon' || (props.type === 'free' || props.type === 'pro') && !props.user.enrolledInTwoOrMoreContainers;
|
|
70
65
|
const showSortingQuiz = (props.type === 'free' || props.type === 'pro') && props.user.enrolledInTwoOrMoreContainers;
|
|
71
|
-
return /*#__PURE__*/_jsx(
|
|
66
|
+
return /*#__PURE__*/_jsx(HeaderDisplayContext.Provider, {
|
|
72
67
|
value: {
|
|
73
68
|
showOnboardingQuiz,
|
|
74
|
-
showSortingQuiz
|
|
69
|
+
showSortingQuiz,
|
|
70
|
+
headerType: useMemo(() => {
|
|
71
|
+
if (props.type in DropdownPositions) return props.type;
|
|
72
|
+
return 'default';
|
|
73
|
+
}, [props.type])
|
|
75
74
|
},
|
|
76
75
|
children: /*#__PURE__*/_jsx(GlobalNavRedesignContext.Provider, {
|
|
77
76
|
value: !!props.displayGlobalNavRedesign,
|
|
78
77
|
children: /*#__PURE__*/_jsx(BlpHeroExperimentContext.Provider, {
|
|
79
78
|
value: !!props.isBlpHeroExperimentVariant,
|
|
80
|
-
children: /*#__PURE__*/_jsx(
|
|
81
|
-
value:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
,
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
navigationMenuFormattedLabel: props?.localizedLabels?.navigationMenuFormattedLabel
|
|
126
|
-
}), props.children]
|
|
127
|
-
})
|
|
79
|
+
children: /*#__PURE__*/_jsx(GlobalHeaderItemClickContext.Provider, {
|
|
80
|
+
value: {
|
|
81
|
+
globalHeaderItemClick: combinedAction
|
|
82
|
+
},
|
|
83
|
+
children: /*#__PURE__*/_jsx(GlobalHeaderDynamicDataContext.Provider, {
|
|
84
|
+
value: useMemo(() => ({
|
|
85
|
+
globalHeaderDynamicData: dynamicData ?? null
|
|
86
|
+
}), [dynamicData]),
|
|
87
|
+
children: /*#__PURE__*/_jsxs(Box, {
|
|
88
|
+
as: "header",
|
|
89
|
+
position: "sticky",
|
|
90
|
+
top: 0,
|
|
91
|
+
zIndex: theme.elements.headerZ,
|
|
92
|
+
overflow: {
|
|
93
|
+
_: 'hidden',
|
|
94
|
+
sm: 'visible'
|
|
95
|
+
} // Prevent tooltip overflow on mobile
|
|
96
|
+
,
|
|
97
|
+
children: [/*#__PURE__*/_jsx(AppHeader, {
|
|
98
|
+
action: combinedAction,
|
|
99
|
+
items: getAppHeaderItems(props, false, dynamicDataLoading ?? false),
|
|
100
|
+
search: props.search,
|
|
101
|
+
...(props.type === 'anon' ? {
|
|
102
|
+
redirectParam: props.redirectParam
|
|
103
|
+
} : hideNotification ? {} : {
|
|
104
|
+
notifications: props.notifications
|
|
105
|
+
}),
|
|
106
|
+
hideRightButtonDefaults: hideNotification,
|
|
107
|
+
isAnon: props.type === 'anon',
|
|
108
|
+
isTeams: props.type === 'teams',
|
|
109
|
+
type: hideNotification ? 'enterprise' : 'standard'
|
|
110
|
+
}), /*#__PURE__*/_jsx(AppHeaderMobile, {
|
|
111
|
+
action: combinedAction,
|
|
112
|
+
items: getAppHeaderItems(props, true, dynamicDataLoading ?? false),
|
|
113
|
+
...(props.type === 'anon' || hideNotification ? {} : {
|
|
114
|
+
notifications: props.notifications
|
|
115
|
+
}),
|
|
116
|
+
search: props.search,
|
|
117
|
+
redirectParam: props.type === 'anon' ? props.redirectParam : undefined,
|
|
118
|
+
isEnterprise: props.type === 'enterprise',
|
|
119
|
+
isAnon: props.type === 'anon',
|
|
120
|
+
isSimple: props.type === 'simple',
|
|
121
|
+
hideRightMenuButton: props.type === 'simple' || props.type === 'loading',
|
|
122
|
+
navigationMenuFormattedLabel: props?.localizedLabels?.navigationMenuFormattedLabel
|
|
123
|
+
}), props.children]
|
|
128
124
|
})
|
|
129
125
|
})
|
|
130
126
|
})
|
|
@@ -33,7 +33,6 @@ interface BaseHeader extends WithChildrenProp, AppHeaderAction {
|
|
|
33
33
|
search: AppHeaderSearch;
|
|
34
34
|
displayGlobalNavRedesign?: boolean;
|
|
35
35
|
isBlpHeroExperimentVariant?: boolean;
|
|
36
|
-
isInRevampedBlpExperimentVariant?: boolean;
|
|
37
36
|
dynamicData?: GlobalHeaderDynamicData | null;
|
|
38
37
|
dynamicDataLoading?: boolean;
|
|
39
38
|
}
|
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": "3.14.0-alpha.
|
|
4
|
+
"version": "3.14.0-alpha.c1be8cc71a.0",
|
|
5
5
|
"author": "Codecademy Engineering <dev@codecademy.com>",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@emotion/is-prop-valid": "^1.2.1",
|