@codecademy/brand 5.1.0 → 5.2.0-alpha.c39277950.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.
@@ -1,9 +1,10 @@
1
- import { Anchor, Box } from '@codecademy/gamut';
1
+ import { Anchor, Box, GridBox, Text } from '@codecademy/gamut';
2
2
  import React from 'react';
3
- import { useGlobalHeaderItemClick } from '../../../GlobalHeader/context';
3
+ import { useGlobalHeaderDynamicDataContext, useGlobalHeaderItemClick } from '../../../GlobalHeader/context';
4
4
  import { useAppHeaderSectionContext } from '../AppHeaderSection/AppHeaderSectionContext';
5
5
  import { PanelLayout } from '../AppHeaderSection/PanelLayout';
6
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
+ import { SkillTile } from '../AppHeaderSkillTile';
7
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
7
8
  const makeCta = (id, href, text, trackingTarget) => ({
8
9
  id,
9
10
  href,
@@ -18,17 +19,22 @@ export const BootcampsPanel = () => {
18
19
  const {
19
20
  globalHeaderItemClick
20
21
  } = useGlobalHeaderItemClick();
22
+ const {
23
+ globalHeaderDynamicData
24
+ } = useGlobalHeaderDynamicDataContext();
21
25
  const privateBootcampFormUrl = 'https://forms.office.com/r/qqjDwRmkqA';
26
+ const upcomingBootcamps = globalHeaderDynamicData?.liveCoursesDropdown?.upcomingBootcamps ?? [];
22
27
  const description = /*#__PURE__*/_jsxs(Box, {
23
28
  mb: 8,
24
- children: ["Join live virtual bootcamps that span multiple weeks and help you build real-world, in-demand skills. Led by experts, each bootcamp includes instructor support, community, and comes with Codecademy Pro access.", /*#__PURE__*/_jsx("br", {}), "Looking for a private bootcamp?", ' ', /*#__PURE__*/_jsx(Anchor, {
29
+ children: ["Join live virtual bootcamps that span multiple weeks and help you build real-world, in-demand skills. Led by experts, each bootcamp includes instructor support, community, professional mentorship\u2014and comes with Codecademy Pro access.", /*#__PURE__*/_jsx("br", {}), "Looking for a private bootcamp?", ' ', /*#__PURE__*/_jsx(Anchor, {
25
30
  tabIndex: tabIndex,
26
31
  href: privateBootcampFormUrl,
27
32
  onClick: event => globalHeaderItemClick(event, {
28
33
  type: 'link',
29
34
  href: privateBootcampFormUrl,
30
35
  text: 'Get in touch',
31
- id: 'private-bootcamp-contact'
36
+ id: 'private-bootcamp-contact',
37
+ trackingTarget: 'topnav_live_courses_private_bootcamp_contact'
32
38
  }),
33
39
  children: "Get in touch"
34
40
  })]
@@ -36,7 +42,33 @@ export const BootcampsPanel = () => {
36
42
  return /*#__PURE__*/_jsx(PanelLayout, {
37
43
  heading: "Bootcamps",
38
44
  description: description,
39
- linkItem: makeCta('bootcamps', '/bootcamps', 'Explore Bootcamps', 'topnav_live_courses_bootcamps')
45
+ linkItem: makeCta('bootcamps', '/bootcamps', 'Explore all Bootcamps', 'topnav_live_courses_bootcamps'),
46
+ children: upcomingBootcamps.length > 0 && /*#__PURE__*/_jsxs(_Fragment, {
47
+ children: [/*#__PURE__*/_jsx(Text, {
48
+ variant: "p-large",
49
+ fontWeight: 700,
50
+ as: "h3",
51
+ children: "Upcoming bootcamps"
52
+ }), /*#__PURE__*/_jsx(GridBox, {
53
+ gridTemplateColumns: {
54
+ _: '1fr',
55
+ xs: '1fr 1fr'
56
+ },
57
+ gap: 8,
58
+ pl: 0,
59
+ as: "ul",
60
+ listStyle: "none",
61
+ mb: 24,
62
+ children: upcomingBootcamps.map(bootcamp => /*#__PURE__*/_jsx("li", {
63
+ children: /*#__PURE__*/_jsx(SkillTile, {
64
+ item: {
65
+ ...bootcamp,
66
+ type: 'link'
67
+ }
68
+ })
69
+ }, bootcamp.id))
70
+ })]
71
+ })
40
72
  });
41
73
  };
42
74
  export const CoachingPanel = () => {
@@ -98,6 +98,15 @@ export type PromotedPath = {
98
98
  difficulty: CourseDifficulty | null;
99
99
  durationHours: number | null;
100
100
  };
101
+ export type UpcomingLiveCoursesNavItem = {
102
+ id: string;
103
+ href: string;
104
+ text: string;
105
+ trackingTarget: string;
106
+ };
107
+ export type LiveCoursesDropdownData = {
108
+ upcomingBootcamps: UpcomingLiveCoursesNavItem[];
109
+ };
101
110
  export type GlobalHeaderDynamicData = {
102
111
  catalogDropdown: {
103
112
  banner: {
@@ -116,5 +125,6 @@ export type GlobalHeaderDynamicData = {
116
125
  totalCertificationPathCount: number;
117
126
  };
118
127
  };
128
+ liveCoursesDropdown: LiveCoursesDropdownData;
119
129
  };
120
130
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codecademy/brand",
3
- "version": "5.1.0",
3
+ "version": "5.2.0-alpha.c39277950.0",
4
4
  "description": "Brand component library for Codecademy",
5
5
  "license": "MIT",
6
6
  "repository": "git@github.com:codecademy-engineering/mono.git",