Skip to content

Commit 280daf3

Browse files
committed
Hides FREE promotion when payments enabled
1 parent 7d22258 commit 280daf3

File tree

3 files changed

+24
-16
lines changed

3 files changed

+24
-16
lines changed

src-ts/tools/learn/welcome/tc-certifications/TCCertifications.module.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,12 @@
9393
}
9494
}
9595
}
96+
97+
.aloneTeaseBanner {
98+
margin-bottom: $space-mxx !important;
99+
border-radius: 8px;
100+
101+
@include ltemd {
102+
margin-bottom: $space-xxl !important;
103+
}
104+
}

src-ts/tools/learn/welcome/tc-certifications/TCCertifications.tsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { FC, ReactNode, useCallback, useMemo } from 'react'
33
import classNames from 'classnames'
44

55
import { TCACertification, TCACertificationProgress } from '../../learn-lib'
6+
import { EnvironmentConfig } from '../../../../config'
67

78
import { TCCertCard } from './cert-card'
89
import styles from './TCCertifications.module.scss'
@@ -35,6 +36,8 @@ const TCCertifications: FC<TCCertificationsProps> = (props: TCCertificationsProp
3536

3637
const certificationsCount: number = props.certifications.length
3738

39+
const tcaCertMonetization: boolean = !!EnvironmentConfig.REACT_APP_ENABLE_TCA_CERT_MONETIZATION
40+
3841
return (
3942
<div className={styles.wrap}>
4043
<h2 className='details'>
@@ -43,18 +46,20 @@ const TCCertifications: FC<TCCertificationsProps> = (props: TCCertificationsProp
4346
{certificationsCount}
4447
</span>
4548
</h2>
46-
<div className={styles.teaseBanner}>
49+
<div className={classNames(styles.teaseBanner, tcaCertMonetization ? styles.aloneTeaseBanner : '')}>
4750
<h2>Introducing Topcoder Certifications</h2>
4851
<p>
4952
We are happy to release Topcoder Certifications! Take advantage
5053
of our pilot Certification program. Click on a certification below to learn more.
5154
</p>
5255
</div>
53-
<div className={styles.freeBanner}>
54-
<strong className='body-large-bold'>FREE</strong>
55-
&nbsp;
56-
<span className='body-large'>enrollment ends on April 30th.</span>
57-
</div>
56+
{!tcaCertMonetization && (
57+
<div className={styles.freeBanner}>
58+
<strong className='body-large-bold'>FREE</strong>
59+
&nbsp;
60+
<span className='body-large'>enrollment ends on April 30th.</span>
61+
</div>
62+
)}
5863

5964
<div className={styles.certsList}>
6065
{

src-ts/tools/learn/welcome/tc-certifications/cert-card/TCCertCard.tsx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { FC, memo, ReactNode } from 'react'
22
import classNames from 'classnames'
33

4-
import { Button, ButtonStyle, IconSolid, ProgressBar, useCheckIsMobile } from '../../../../../lib'
4+
import { Button, ButtonStyle, IconSolid, ProgressBar } from '../../../../../lib'
55
import {
66
CertificateBadgeIcon,
77
CompletionTimeRange,
@@ -13,6 +13,7 @@ import {
1313
TCACertificationProviderBase,
1414
} from '../../../learn-lib'
1515
import { getTCACertificateUrl, getTCACertificationPath } from '../../../learn.routes'
16+
import { EnvironmentConfig } from '../../../../../config'
1617

1718
import styles from './TCCertCard.module.scss'
1819

@@ -29,7 +30,6 @@ const getCtaBtn: (style: ButtonStyle, label: string, route: string) => ReactNode
2930
const EXCERPT_TEXT_LEN: number = 165
3031

3132
const TCCertCard: FC<TCCertCardProps> = (props: TCCertCardProps) => {
32-
const isMobile: boolean = useCheckIsMobile()
3333

3434
const desc: string = props.certification.description.slice(0, EXCERPT_TEXT_LEN)
3535

@@ -84,13 +84,6 @@ const TCCertCard: FC<TCCertCardProps> = (props: TCCertCardProps) => {
8484
<CompletionTimeRange range={props.certification.completionTimeRange} />
8585
</span>
8686
</div>
87-
{/* TODO: Uncomment this when paid certs come to prod! */}
88-
{/* <div className={styles.subTitleItem}>
89-
<IconSolid.CurrencyDollarIcon width={16} height={16} />
90-
<span className={classNames('body-small', styles.infoText)}>
91-
{' One time payment'}
92-
</span>
93-
</div> */}
9487
</div>
9588
)
9689
}
@@ -123,7 +116,8 @@ const TCCertCard: FC<TCCertCardProps> = (props: TCCertCardProps) => {
123116

124117
<div className={styles.cardLabels}>
125118
<div className={styles.newLabel}>NEW</div>
126-
<div className={styles.freeLabel}>FREE</div>
119+
{!EnvironmentConfig.REACT_APP_ENABLE_TCA_CERT_MONETIZATION
120+
&& <div className={styles.freeLabel}>FREE</div>}
127121
</div>
128122
</div>
129123
{renderStats()}

0 commit comments

Comments
 (0)