mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
refactor(client, curriculum): consolidate is-FSD checks (#59598)
This commit is contained in:
@@ -18,6 +18,7 @@ import {
|
||||
import { stringifyDonationEvents } from '../utils/analytics-strings';
|
||||
import { stripe } from '../utils/stripe';
|
||||
import { PaymentProvider } from '../../../shared/config/donation-settings';
|
||||
import { chapterBasedSuperBlocks } from '../../../shared/config/curriculum';
|
||||
import {
|
||||
getSessionChallengeData,
|
||||
saveCurrentCount
|
||||
@@ -52,7 +53,7 @@ function* showDonateModalSaga() {
|
||||
if (
|
||||
shouldRequestDonation &&
|
||||
recentlyClaimedBlock &&
|
||||
recentlyClaimedBlock.superBlock === 'full-stack-developer'
|
||||
chapterBasedSuperBlocks.includes(recentlyClaimedBlock.superBlock)
|
||||
) {
|
||||
yield put(preventBlockDonationRequests());
|
||||
} else if (shouldRequestDonation || isModalRecentlyShown) {
|
||||
|
||||
@@ -8,7 +8,10 @@ import { createSelector } from 'reselect';
|
||||
import { Spacer } from '@freecodecamp/ui';
|
||||
|
||||
import { challengeTypes } from '../../../../../shared/config/challenge-types';
|
||||
import { SuperBlocks } from '../../../../../shared/config/curriculum';
|
||||
import {
|
||||
chapterBasedSuperBlocks,
|
||||
SuperBlocks
|
||||
} from '../../../../../shared/config/curriculum';
|
||||
import envData from '../../../../config/env.json';
|
||||
import { isAuditedSuperBlock } from '../../../../../shared/utils/is-audited';
|
||||
import Caret from '../../../assets/icons/caret';
|
||||
@@ -407,7 +410,7 @@ class Block extends Component<BlockProps> {
|
||||
!isEmptyBlock && (
|
||||
<>
|
||||
{layoutToComponent[blockLayout]}
|
||||
{superBlock !== SuperBlocks.FullStackDeveloper && (
|
||||
{!chapterBasedSuperBlocks.includes(superBlock) && (
|
||||
<Spacer size='xs' />
|
||||
)}
|
||||
</>
|
||||
|
||||
@@ -11,7 +11,10 @@ import { bindActionCreators, Dispatch } from 'redux';
|
||||
import { createSelector } from 'reselect';
|
||||
import { Container, Col, Row, Spacer } from '@freecodecamp/ui';
|
||||
|
||||
import { SuperBlocks } from '../../../../shared/config/curriculum';
|
||||
import {
|
||||
chapterBasedSuperBlocks,
|
||||
SuperBlocks
|
||||
} from '../../../../shared/config/curriculum';
|
||||
import DonateModal from '../../components/Donation/donation-modal';
|
||||
import Login from '../../components/Header/components/login';
|
||||
import Map from '../../components/Map';
|
||||
@@ -172,8 +175,6 @@ const SuperBlockIntroductionPage = (props: SuperBlockProps) => {
|
||||
cert => superBlockToCertMap[superBlock] === cert.certSlug
|
||||
);
|
||||
|
||||
const superBlockWithAccordionView = [SuperBlocks.FullStackDeveloper];
|
||||
|
||||
const getInitiallyExpandedBlock = (): string => {
|
||||
// if coming from breadcrumb click
|
||||
if (
|
||||
@@ -258,7 +259,7 @@ const SuperBlockIntroductionPage = (props: SuperBlockProps) => {
|
||||
{t(`intro:misc-text.courses`)}
|
||||
</h2>
|
||||
<Spacer size='m' />
|
||||
{superBlockWithAccordionView.includes(superBlock) ? (
|
||||
{chapterBasedSuperBlocks.includes(superBlock) ? (
|
||||
<SuperBlockAccordion
|
||||
challenges={superBlockChallenges}
|
||||
superBlock={superBlock}
|
||||
|
||||
Reference in New Issue
Block a user