@codecademy/brand 2.0.0-alpha.2bc261aded.0 → 2.0.0-alpha.3a7b7c993e.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/AppHeader/AppHeaderElements/AppHeaderCatalogSection/index.js +7 -8
- package/dist/AppHeader/AppHeaderElements/AppHeaderResourcesDropdown/index.js +2 -4
- package/dist/AppHeader/Search/consts.js +1 -1
- package/dist/AppHeader/index.js +2 -5
- package/dist/AppHeaderMobile/AppHeaderSubMenuMobile/index.js +5 -7
- package/dist/FeatureList/index.js +5 -4
- package/dist/GlobalFooter/FooterNavLinks/CatalogLinks.js +6 -9
- package/dist/GlobalFooter/FooterNavLinks/CompanyLinks.js +1 -1
- package/dist/GlobalFooter/FooterNavLinks/ReferralRock/ReferAFriendLinkWithModal.js +3 -3
- package/dist/GlobalFooter/index.js +17 -25
- package/dist/GlobalHeader/GlobalHeaderItems.js +6 -3
- package/dist/GlobalHeader/GlobalHeaderVariants.js +33 -33
- package/dist/GlobalHeader/index.js +46 -49
- package/dist/LandingPage/PageFeaturesEnhanced.js +3 -0
- package/dist/LearningOutcomeAssessmentScores/AssessmentDetail.js +55 -0
- package/dist/LearningOutcomeAssessmentScores/index.js +24 -0
- package/dist/LearningOutcomeCard/index.js +187 -127
- package/dist/LearningOutcomeFlyout/LearningOutcomeCardList.js +23 -0
- package/dist/LearningOutcomeFlyout/index.js +181 -0
- package/dist/LearningOutcomeTile/index.js +2 -4
- package/dist/PlanCard/index.js +75 -28
- package/dist/index.js +3 -3
- package/dist/lib/catalogList/index.js +3 -3
- package/dist/lib/resourcesList/index.js +2 -11
- package/dist/stories/Molecules/LearningOutcomeAssessmentScores.stories.js +23 -0
- package/dist/stories/Molecules/LearningOutcomeCard.stories.js +169 -39
- package/dist/stories/Molecules/LearningOutcomeFlyout.stories.js +44 -0
- package/package.json +1 -1
|
@@ -3,6 +3,9 @@ import { AccountingCoinsIcon, ArrowThickCircleUpIcon, ArticleIcon, BookFlipPageI
|
|
|
3
3
|
import { renderNewBadge } from '../lib/resourcesList';
|
|
4
4
|
import { formatEnterpriseUrl } from './urlHelpers';
|
|
5
5
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
const shouldShowBusinessDashboardLink = user => {
|
|
7
|
+
return (user?.isAccountManager || user?.isBusinessAdmin) && !user?.isSkillsoftUser;
|
|
8
|
+
};
|
|
6
9
|
export const loading = {
|
|
7
10
|
id: 'header-loading',
|
|
8
11
|
type: 'render-element',
|
|
@@ -282,13 +285,13 @@ const profileLogOut = {
|
|
|
282
285
|
text: 'Log Out',
|
|
283
286
|
type: 'link'
|
|
284
287
|
};
|
|
285
|
-
export const freeProfile =
|
|
288
|
+
export const freeProfile = user => {
|
|
286
289
|
const topSection = [profileMyProfile];
|
|
287
290
|
if (user?.isBusinessAdmin || !user?.isBusinessSsoUser) {
|
|
288
291
|
topSection.push(profileAccount);
|
|
289
292
|
}
|
|
290
293
|
topSection.push(profileMyHome);
|
|
291
|
-
if (
|
|
294
|
+
if (shouldShowBusinessDashboardLink(user)) {
|
|
292
295
|
topSection.push(profileBusinessAccount);
|
|
293
296
|
}
|
|
294
297
|
topSection.push(profileHelpCenter);
|
|
@@ -314,7 +317,7 @@ export const proProfile = user => {
|
|
|
314
317
|
topSection.push(profileHelpCenter);
|
|
315
318
|
topSection.push(profileFeedback);
|
|
316
319
|
const teamsAdminSection = [];
|
|
317
|
-
if ((user
|
|
320
|
+
if (shouldShowBusinessDashboardLink(user)) {
|
|
318
321
|
teamsAdminSection.push(profileBusinessAccount);
|
|
319
322
|
}
|
|
320
323
|
const middleSection = [];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { addPayment, bootcampCta, businessSolutions,
|
|
1
|
+
import { addPayment, bootcampCta, businessSolutions, 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) => {
|
|
11
11
|
const specialLogo = {
|
|
12
12
|
...logo,
|
|
13
13
|
checkMini: true
|
|
14
14
|
};
|
|
15
|
-
const leftItems = [specialLogo, catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(), ...(hidePricing ? [] : [pricingDropdown]),
|
|
15
|
+
const leftItems = [specialLogo, catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(), ...(hidePricing ? [] : [pricingDropdown]), liveLearningHub, businessSolutions];
|
|
16
16
|
const rightItems = [];
|
|
17
17
|
if (renderLogin) {
|
|
18
18
|
rightItems.push(login);
|
|
@@ -25,7 +25,7 @@ const anonHeaderItems = (renderLogin, renderSignUp, hidePricing, user, isLiveLea
|
|
|
25
25
|
right: rightItems
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
|
-
const anonMobileHeaderItems = (renderLogin, renderSignUp, hidePricing, user
|
|
28
|
+
const anonMobileHeaderItems = (renderLogin, renderSignUp, hidePricing, user) => {
|
|
29
29
|
const specialLogo = {
|
|
30
30
|
...logo,
|
|
31
31
|
checkMini: true
|
|
@@ -38,43 +38,43 @@ const anonMobileHeaderItems = (renderLogin, renderSignUp, hidePricing, user, isL
|
|
|
38
38
|
if (renderSignUp) {
|
|
39
39
|
rightItems.push(signUp);
|
|
40
40
|
}
|
|
41
|
-
const mainMenuItems = [catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(), ...(hidePricing ? [] : [pricingDropdown]),
|
|
41
|
+
const mainMenuItems = [catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(), ...(hidePricing ? [] : [pricingDropdown]), liveLearningHub, 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) => {
|
|
49
|
+
return anonHeaderItems(true, true, hidePricing, user);
|
|
50
50
|
};
|
|
51
|
-
export const anonDefaultMobileHeaderItems = (hidePricing, user
|
|
52
|
-
return anonMobileHeaderItems(true, true, hidePricing, user
|
|
51
|
+
export const anonDefaultMobileHeaderItems = (hidePricing, user) => {
|
|
52
|
+
return anonMobileHeaderItems(true, true, hidePricing, user);
|
|
53
53
|
};
|
|
54
|
-
export const anonLandingHeaderItems = (hidePricing, user
|
|
55
|
-
return anonHeaderItems(true, false, hidePricing, user
|
|
54
|
+
export const anonLandingHeaderItems = (hidePricing, user) => {
|
|
55
|
+
return anonHeaderItems(true, false, hidePricing, user);
|
|
56
56
|
};
|
|
57
|
-
export const anonLandingMobileHeaderItems = (hidePricing, user
|
|
58
|
-
return anonMobileHeaderItems(true, false, hidePricing, user
|
|
57
|
+
export const anonLandingMobileHeaderItems = (hidePricing, user) => {
|
|
58
|
+
return anonMobileHeaderItems(true, false, hidePricing, user);
|
|
59
59
|
};
|
|
60
|
-
export const anonLoginHeaderItems = (hidePricing, user
|
|
61
|
-
return anonHeaderItems(false, true, hidePricing, user
|
|
60
|
+
export const anonLoginHeaderItems = (hidePricing, user) => {
|
|
61
|
+
return anonHeaderItems(false, true, hidePricing, user);
|
|
62
62
|
};
|
|
63
|
-
export const anonLoginMobileHeaderItems = (hidePricing, user
|
|
64
|
-
return anonMobileHeaderItems(false, true, hidePricing, user
|
|
63
|
+
export const anonLoginMobileHeaderItems = (hidePricing, user) => {
|
|
64
|
+
return anonMobileHeaderItems(false, true, hidePricing, user);
|
|
65
65
|
};
|
|
66
|
-
export const anonSignupHeaderItems = (hidePricing, user
|
|
67
|
-
return anonHeaderItems(true, false, hidePricing, user
|
|
66
|
+
export const anonSignupHeaderItems = (hidePricing, user) => {
|
|
67
|
+
return anonHeaderItems(true, false, hidePricing, user);
|
|
68
68
|
};
|
|
69
|
-
export const anonSignupMobileHeaderItems = (hidePricing, user
|
|
70
|
-
return anonMobileHeaderItems(true, false, hidePricing, user
|
|
69
|
+
export const anonSignupMobileHeaderItems = (hidePricing, user) => {
|
|
70
|
+
return anonMobileHeaderItems(true, false, hidePricing, user);
|
|
71
71
|
};
|
|
72
|
-
export const freeHeaderItems = (user, hidePricing
|
|
72
|
+
export const freeHeaderItems = (user, hidePricing) => {
|
|
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]),
|
|
77
|
+
const leftItems = [specialLogo, myHome, catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(), ...(hidePricing ? [] : [pricingDropdown]), liveLearningHub, 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, isLiveLearningHubEnabled) =>
|
|
|
84
84
|
right: rightItems
|
|
85
85
|
};
|
|
86
86
|
};
|
|
87
|
-
export const freeMobileHeaderItems = (user, hidePricing
|
|
87
|
+
export const freeMobileHeaderItems = (user, hidePricing) => {
|
|
88
88
|
const specialLogo = {
|
|
89
89
|
...logo,
|
|
90
90
|
checkMini: true
|
|
@@ -92,7 +92,7 @@ export const freeMobileHeaderItems = (user, hidePricing, isLiveLearningHubEnable
|
|
|
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]),
|
|
95
|
+
const mainMenuItems = [myHome, catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(), ...(hidePricing ? [] : [pricingDropdown]), liveLearningHub, 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 =
|
|
116
|
-
const leftItems = [logo, myHome, catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(), ...(user.isPlusUser ? [upgradePlan] : []),
|
|
115
|
+
export const proHeaderItems = user => {
|
|
116
|
+
const leftItems = [logo, myHome, catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(), ...(user.isPlusUser ? [upgradePlan] : []), liveLearningHub, businessSolutions];
|
|
117
117
|
const rightItems = [];
|
|
118
118
|
rightItems.push(proProfile(user));
|
|
119
119
|
if (user.isPaused) {
|
|
@@ -124,8 +124,8 @@ export const proHeaderItems = (user, isLiveLearningHubEnabled) => {
|
|
|
124
124
|
right: rightItems
|
|
125
125
|
};
|
|
126
126
|
};
|
|
127
|
-
export const teamsHeaderItems =
|
|
128
|
-
const leftItems = [logo, myHome, catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(),
|
|
127
|
+
export const teamsHeaderItems = user => {
|
|
128
|
+
const leftItems = [logo, myHome, catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(), liveLearningHub];
|
|
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 =
|
|
155
|
+
export const proMobileHeaderItems = user => {
|
|
156
156
|
const leftItems = [logo];
|
|
157
157
|
const rightItems = [];
|
|
158
|
-
const mainMenuItems = [myHome, catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(), ...(user.isPlusUser ? [upgradePlan] : []),
|
|
158
|
+
const mainMenuItems = [myHome, catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(), ...(user.isPlusUser ? [upgradePlan] : []), liveLearningHub, businessSolutions, proProfile(user)];
|
|
159
159
|
if (user.isPaused) {
|
|
160
160
|
mainMenuItems.push(unpausePro);
|
|
161
161
|
}
|
|
@@ -165,10 +165,10 @@ export const proMobileHeaderItems = (user, isLiveLearningHubEnabled) => {
|
|
|
165
165
|
mainMenu: mainMenuItems
|
|
166
166
|
};
|
|
167
167
|
};
|
|
168
|
-
export const teamsMobileHeaderItems =
|
|
168
|
+
export const teamsMobileHeaderItems = user => {
|
|
169
169
|
const leftItems = [logo];
|
|
170
170
|
const rightItems = [];
|
|
171
|
-
const mainMenuItems = [myHome, catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(),
|
|
171
|
+
const mainMenuItems = [myHome, catalogDropdown(user?.hideCareerPaths), resourcesDropdown(), communityDropdown(), liveLearningHub, proProfile(user)];
|
|
172
172
|
if (user.isAccountManager && user.inBusinessTrial && !user.hasBusinessSubscription) {
|
|
173
173
|
mainMenuItems.push(addPayment);
|
|
174
174
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Box } from '@codecademy/gamut';
|
|
2
2
|
import { useTheme } from '@emotion/react';
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import { useCallback
|
|
4
|
+
import { useCallback } 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";
|
|
@@ -16,29 +16,28 @@ export const HeaderQuizContext = /*#__PURE__*/React.createContext({
|
|
|
16
16
|
|
|
17
17
|
function getAppHeaderItems(props, mobile) {
|
|
18
18
|
const {
|
|
19
|
-
hidePricing
|
|
20
|
-
isLiveLearningHubEnabled
|
|
19
|
+
hidePricing
|
|
21
20
|
} = props;
|
|
22
21
|
switch (props.type) {
|
|
23
22
|
case 'anon':
|
|
24
23
|
switch (props.variant) {
|
|
25
24
|
case 'landing':
|
|
26
|
-
return mobile ? anonLandingMobileHeaderItems(hidePricing, props.user
|
|
25
|
+
return mobile ? anonLandingMobileHeaderItems(hidePricing, props.user) : anonLandingHeaderItems(hidePricing, props.user);
|
|
27
26
|
case 'login':
|
|
28
|
-
return mobile ? anonLoginMobileHeaderItems(hidePricing, props.user
|
|
27
|
+
return mobile ? anonLoginMobileHeaderItems(hidePricing, props.user) : anonLoginHeaderItems(hidePricing, props.user);
|
|
29
28
|
case 'signup':
|
|
30
|
-
return mobile ? anonSignupMobileHeaderItems(hidePricing, props.user
|
|
29
|
+
return mobile ? anonSignupMobileHeaderItems(hidePricing, props.user) : anonSignupHeaderItems(hidePricing, props.user);
|
|
31
30
|
default:
|
|
32
|
-
return mobile ? anonDefaultMobileHeaderItems(hidePricing, props.user
|
|
31
|
+
return mobile ? anonDefaultMobileHeaderItems(hidePricing, props.user) : anonDefaultHeaderItems(hidePricing, props.user);
|
|
33
32
|
}
|
|
34
33
|
case 'enterprise':
|
|
35
34
|
return mobile ? enterpriseMobileHeaderItems(props.user, props) : enterpriseHeaderItems(props.user, props);
|
|
36
35
|
case 'free':
|
|
37
|
-
return mobile ? freeMobileHeaderItems(props.user, hidePricing
|
|
36
|
+
return mobile ? freeMobileHeaderItems(props.user, hidePricing) : freeHeaderItems(props.user, hidePricing);
|
|
38
37
|
case 'pro':
|
|
39
|
-
return mobile ? proMobileHeaderItems(props.user
|
|
38
|
+
return mobile ? proMobileHeaderItems(props.user) : proHeaderItems(props.user);
|
|
40
39
|
case 'teams':
|
|
41
|
-
return mobile ? teamsMobileHeaderItems(props.user
|
|
40
|
+
return mobile ? teamsMobileHeaderItems(props.user) : teamsHeaderItems(props.user);
|
|
42
41
|
case 'simple':
|
|
43
42
|
return mobile ? simpleMobileHeaderItems : simpleHeaderItems;
|
|
44
43
|
case 'bootcamp':
|
|
@@ -53,10 +52,6 @@ export const GlobalHeader = props => {
|
|
|
53
52
|
onLinkAction
|
|
54
53
|
} = props;
|
|
55
54
|
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;
|
|
60
55
|
const combinedAction = useCallback((event, item) => {
|
|
61
56
|
action(event, item);
|
|
62
57
|
if (isAppHeaderItemWithHref(item)) onLinkAction?.(event, item);
|
|
@@ -69,41 +64,43 @@ export const GlobalHeader = props => {
|
|
|
69
64
|
showOnboardingQuiz,
|
|
70
65
|
showSortingQuiz
|
|
71
66
|
},
|
|
72
|
-
children: /*#__PURE__*/
|
|
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
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
67
|
+
children: /*#__PURE__*/_jsxs(Box, {
|
|
68
|
+
as: "header",
|
|
69
|
+
position: "sticky",
|
|
70
|
+
top: 0,
|
|
71
|
+
zIndex: theme.elements.headerZ,
|
|
72
|
+
overflow: {
|
|
73
|
+
_: 'hidden',
|
|
74
|
+
sm: 'visible'
|
|
75
|
+
} // Prevent tooltip overflow on mobile
|
|
76
|
+
,
|
|
77
|
+
children: [/*#__PURE__*/_jsx(AppHeader, {
|
|
78
|
+
action: combinedAction,
|
|
79
|
+
items: getAppHeaderItems(props, false),
|
|
80
|
+
search: props.search,
|
|
81
|
+
...(props.type === 'anon' ? {
|
|
82
|
+
redirectParam: props.redirectParam
|
|
83
|
+
} : hideNotification ? {} : {
|
|
84
|
+
notifications: props.notifications
|
|
85
|
+
}),
|
|
86
|
+
hideRightButtonDefaults: hideNotification,
|
|
87
|
+
isAnon: props.type === 'anon',
|
|
88
|
+
isTeams: props.type === 'teams',
|
|
89
|
+
type: hideNotification ? 'enterprise' : 'standard'
|
|
90
|
+
}), /*#__PURE__*/_jsx(AppHeaderMobile, {
|
|
91
|
+
action: combinedAction,
|
|
92
|
+
items: getAppHeaderItems(props, true),
|
|
93
|
+
...(props.type === 'anon' || hideNotification ? {} : {
|
|
94
|
+
notifications: props.notifications
|
|
95
|
+
}),
|
|
96
|
+
search: props.search,
|
|
97
|
+
redirectParam: props.type === 'anon' ? props.redirectParam : undefined,
|
|
98
|
+
isEnterprise: props.type === 'enterprise',
|
|
99
|
+
isAnon: props.type === 'anon',
|
|
100
|
+
isSimple: props.type === 'simple',
|
|
101
|
+
hideRightMenuButton: props.type === 'simple' || props.type === 'loading',
|
|
102
|
+
navigationMenuFormattedLabel: props?.localizedLabels?.navigationMenuFormattedLabel
|
|
103
|
+
}), props.children]
|
|
107
104
|
})
|
|
108
105
|
});
|
|
109
106
|
};
|
|
@@ -15,6 +15,7 @@ const rowRenderEach = (items, itemRenderer) => {
|
|
|
15
15
|
},
|
|
16
16
|
as: "ul",
|
|
17
17
|
pl: 0,
|
|
18
|
+
mb: 0,
|
|
18
19
|
gap: {
|
|
19
20
|
sm: 32
|
|
20
21
|
},
|
|
@@ -35,6 +36,7 @@ const gridRenderEach = (maxCols, items, itemRenderer) => {
|
|
|
35
36
|
gap: 32,
|
|
36
37
|
as: "ul",
|
|
37
38
|
pl: 0,
|
|
39
|
+
mb: 0,
|
|
38
40
|
children: items.map(item => /*#__PURE__*/_jsx(Column, {
|
|
39
41
|
size: size,
|
|
40
42
|
as: "li",
|
|
@@ -67,6 +69,7 @@ export const PageFeaturesEnhanced = ({
|
|
|
67
69
|
children: [title && /*#__PURE__*/_jsx(FlexBox, {
|
|
68
70
|
justifyContent: "center",
|
|
69
71
|
textAlign: "center",
|
|
72
|
+
mb: 8,
|
|
70
73
|
children: eyebrow ? /*#__PURE__*/_jsx(TitleWithEyebrow, {
|
|
71
74
|
title: title,
|
|
72
75
|
eyebrow: eyebrow,
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Box, FlexBox, Text } from '@codecademy/gamut';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
4
|
+
export const AssessmentDetail = ({
|
|
5
|
+
isHighestScore,
|
|
6
|
+
score,
|
|
7
|
+
scoreAchievedAt
|
|
8
|
+
}) => {
|
|
9
|
+
const hasPassedAssessment = score && score >= 70;
|
|
10
|
+
return /*#__PURE__*/_jsxs(FlexBox, {
|
|
11
|
+
borderColor: "background-hover",
|
|
12
|
+
borderRight: isHighestScore ? 1 : 'none',
|
|
13
|
+
width: "100%",
|
|
14
|
+
p: 16,
|
|
15
|
+
column: true,
|
|
16
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
17
|
+
fontWeight: 700,
|
|
18
|
+
children: isHighestScore ? 'Highest score' : 'Most recent'
|
|
19
|
+
}), score != null ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
20
|
+
children: [/*#__PURE__*/_jsxs(FlexBox, {
|
|
21
|
+
mt: 8,
|
|
22
|
+
alignItems: "center",
|
|
23
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
24
|
+
variant: "title-sm",
|
|
25
|
+
"data-testid": "score-percent",
|
|
26
|
+
mr: 4,
|
|
27
|
+
color: hasPassedAssessment ? 'green-700' : undefined,
|
|
28
|
+
children: `${score}%`
|
|
29
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
30
|
+
children: !hasPassedAssessment && /*#__PURE__*/_jsx(Box, {
|
|
31
|
+
"data-testid": "failed-assessment-indicator",
|
|
32
|
+
borderRadius: "full",
|
|
33
|
+
dimensions: 16,
|
|
34
|
+
bg: "orange-500",
|
|
35
|
+
mb: 4
|
|
36
|
+
})
|
|
37
|
+
})]
|
|
38
|
+
}), !!scoreAchievedAt && /*#__PURE__*/_jsx(Text, {
|
|
39
|
+
textColor: "text-secondary",
|
|
40
|
+
children: scoreAchievedAt
|
|
41
|
+
})]
|
|
42
|
+
}) : /*#__PURE__*/_jsxs(FlexBox, {
|
|
43
|
+
column: true,
|
|
44
|
+
color: "text-secondary",
|
|
45
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
46
|
+
fontWeight: 700,
|
|
47
|
+
my: 4,
|
|
48
|
+
"aria-hidden": true,
|
|
49
|
+
children: "-"
|
|
50
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
51
|
+
children: "Not tested yet"
|
|
52
|
+
})]
|
|
53
|
+
})]
|
|
54
|
+
});
|
|
55
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { FlexBox } from '@codecademy/gamut';
|
|
2
|
+
import { AssessmentDetail } from './AssessmentDetail';
|
|
3
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
export const LearningOutcomeAssessmentScores = ({
|
|
5
|
+
highestScore,
|
|
6
|
+
highestScoreAchievedAt,
|
|
7
|
+
latestScore,
|
|
8
|
+
latestScoreAchievedAt
|
|
9
|
+
}) => {
|
|
10
|
+
return /*#__PURE__*/_jsxs(FlexBox, {
|
|
11
|
+
borderColor: "background-hover",
|
|
12
|
+
border: 1,
|
|
13
|
+
borderRadius: "md",
|
|
14
|
+
width: "100%",
|
|
15
|
+
children: [/*#__PURE__*/_jsx(AssessmentDetail, {
|
|
16
|
+
isHighestScore: true,
|
|
17
|
+
score: highestScore,
|
|
18
|
+
scoreAchievedAt: highestScoreAchievedAt
|
|
19
|
+
}), /*#__PURE__*/_jsx(AssessmentDetail, {
|
|
20
|
+
score: latestScore,
|
|
21
|
+
scoreAchievedAt: latestScoreAchievedAt
|
|
22
|
+
})]
|
|
23
|
+
});
|
|
24
|
+
};
|