({ forLanding = false }: MapProps)
| 86 | |
| 87 | // used on /learn and landing page |
| 88 | function 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 | |
| 145 | Map.displayName = 'Map'; |
nothing calls this directly
no test coverage detected