MCPcopy Index your code
hub / github.com/freeCodeCamp/freeCodeCamp / Map

Function Map

client/src/components/Map/index.tsx:88–143  ·  view source on GitHub ↗
({ forLanding = false }: MapProps)

Source from the content-addressed store, hash-verified

86
87// used on /learn and landing page
88function Map({ forLanding = false }: MapProps) {
89 const { t } = useTranslation();
90
91 return (
92 <div className='map-ui' data-test-label='curriculum-map'>
93 {getStageOrder({
94 showUpcomingChanges
95 })
96 // remove legacy superblocks from main maps - shown in archive map only
97 .filter(
98 stage =>
99 stage !== SuperBlockStage.Legacy &&
100 stage !== SuperBlockStage.Catalog
101 )
102 .map(stage => {
103 const superblocks = superBlockStages[stage];
104 if (superblocks.length === 0) {
105 return null;
106 }
107
108 return (
109 <Fragment key={stage}>
110 {
111 /* Show the daily coding challenge before the "English" curriculum */
112 stage === SuperBlockStage.English && (
113 <>
114 <DailyCodingChallengeWidget forLanding={forLanding} />
115 <Spacer size='m' />
116 </>
117 )
118 }
119 <h2 className={forLanding ? 'big-heading' : ''}>
120 {t(superBlockHeadings[stage])}
121 </h2>
122 <ul key={stage}>
123 {superblocks.map(superblock => (
124 <MapLi
125 key={superblock}
126 superBlock={superblock}
127 landing={forLanding}
128 />
129 ))}
130 </ul>
131 <Spacer size='m' />
132 </Fragment>
133 );
134 })}
135 <Spacer size='m' />
136 <p className='archive-link'>
137 <Trans i18nKey='landing.archive-link'>
138 <Link to={'/learn/archive'}>placeholder</Link>
139 </Trans>
140 </p>
141 </div>
142 );
143}
144
145Map.displayName = 'Map';

Callers

nothing calls this directly

Calls 2

useTranslationFunction · 0.90
getStageOrderFunction · 0.90

Tested by

no test coverage detected