@codecademy/brand 1.18.2-alpha.b1c69a37ff.0 → 1.18.2-alpha.dcb2809f67.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.
@@ -13,5 +13,6 @@ export type CourseCardProps = {
13
13
  headingLevel?: HeadingTags;
14
14
  timeToComplete?: number | null;
15
15
  isProUser?: boolean;
16
+ isInOpenFirstModuleVariant?: boolean;
16
17
  };
17
18
  export declare const CourseCard: React.FC<CourseCardProps>;
@@ -1,10 +1,11 @@
1
1
  import { ContentGroupBaseCard } from '../ContentGroupBaseCard';
2
- import { CertificateComponent, Divider } from '../ContentGroupBaseCard/shared';
2
+ import { CertificateComponent, Divider, FreeModuleComponent } from '../ContentGroupBaseCard/shared';
3
3
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
4
4
  export const CourseCard = _ref => {
5
5
  let {
6
6
  title,
7
7
  lessonCount,
8
+ contentModuleIds,
8
9
  grantsCertificate,
9
10
  shortDescription,
10
11
  difficulty,
@@ -12,12 +13,17 @@ export const CourseCard = _ref => {
12
13
  pro,
13
14
  isFullSize,
14
15
  headingLevel = 'h3',
15
- timeToComplete
16
+ timeToComplete,
17
+ isProUser = false,
18
+ isInOpenFirstModuleVariant = false
16
19
  } = _ref;
17
20
  // only show certificates for pro exclusive courses, since only pro users can do pro courses & only pro users can gain certificates
18
21
  // edge case here: pro users who are logged in wont be able to tell - from the card - that a free course can grant them a cert as well
19
22
  const showCertificate = grantsCertificate && pro;
20
- return /*#__PURE__*/_jsx(ContentGroupBaseCard, {
23
+
24
+ // after the experiment is over we can just use the user pro status and module count
25
+ const showFreeFirstModule = !isProUser && isInOpenFirstModuleVariant && pro && contentModuleIds.length > 1;
26
+ return /*#__PURE__*/_jsxs(ContentGroupBaseCard, {
21
27
  headerBackgroundColor: "green-100",
22
28
  headingLevel: headingLevel,
23
29
  headerText: pro ? 'Course' : 'Free course',
@@ -29,8 +35,10 @@ export const CourseCard = _ref => {
29
35
  imageSrc: "https://static-assets.codecademy.com/Courses/Course-Cards/pillars.svg",
30
36
  enrollmentStatus: enrollmentStatus,
31
37
  timeToComplete: timeToComplete,
32
- children: showCertificate && /*#__PURE__*/_jsxs(_Fragment, {
38
+ children: [showFreeFirstModule && /*#__PURE__*/_jsxs(_Fragment, {
39
+ children: [/*#__PURE__*/_jsx(Divider, {}), /*#__PURE__*/_jsx(FreeModuleComponent, {})]
40
+ }), showCertificate && /*#__PURE__*/_jsxs(_Fragment, {
33
41
  children: [/*#__PURE__*/_jsx(Divider, {}), /*#__PURE__*/_jsx(CertificateComponent, {})]
34
- })
42
+ })]
35
43
  });
36
44
  };
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.18.2-alpha.b1c69a37ff.0",
4
+ "version": "1.18.2-alpha.dcb2809f67.0",
5
5
  "author": "Codecademy Engineering <dev@codecademy.com>",
6
6
  "dependencies": {
7
7
  "@emotion/is-prop-valid": "^1.2.1",