diff --git a/client/src/assets/icons/completion-ribbon.tsx b/client/src/assets/icons/completion-ribbon.tsx new file mode 100644 index 00000000000..e3862542fdd --- /dev/null +++ b/client/src/assets/icons/completion-ribbon.tsx @@ -0,0 +1,97 @@ +import React from 'react'; + +interface RibbonProps { + value: number; + isClaimed: boolean; + isCompleted: boolean; +} + +export const Arrow = () => ( + +); + +export const RibbonIcon = ({ + value, + isCompleted: completed, + isClaimed +}: RibbonProps): JSX.Element => { + const properClassName = completed ? 'completeIcon' : 'incompleteIcon'; + const fillColor = completed ? 'black' : 'gray'; + return ( + + ); +}; + +RibbonIcon.displayName = 'RibbonIcon'; diff --git a/client/src/components/Map/index.tsx b/client/src/components/Map/index.tsx index aea3957d9d9..2b0e7b1d8e5 100644 --- a/client/src/components/Map/index.tsx +++ b/client/src/components/Map/index.tsx @@ -1,6 +1,7 @@ import React from 'react'; import { useTranslation } from 'react-i18next'; - +import { connect } from 'react-redux'; +import { createSelector } from 'reselect'; import { SuperBlockStages, SuperBlocks, @@ -14,8 +15,24 @@ import { showUpcomingChanges } from '../../../config/env.json'; import './map.css'; +import { + isSignedInSelector, + currentCertsSelector +} from '../../redux/selectors'; + +import { RibbonIcon, Arrow } from '../../assets/icons/completion-ribbon'; + +import { CurrentCert, ClaimedCertifications } from '../../redux/prop-types'; +import { + certSlugTypeMap, + superBlockCertTypeMap +} from '../../../../shared/config/certification-settings'; + interface MapProps { forLanding?: boolean; + isSignedIn: boolean; + currentCerts: CurrentCert[]; + claimedCertifications?: ClaimedCertifications; } const linkSpacingStyle = { @@ -31,12 +48,31 @@ const coreCurriculum = [ ...superBlockOrder[SuperBlockStages.Python] ]; +const mapStateToProps = createSelector( + isSignedInSelector, + currentCertsSelector, + (isSignedIn: boolean, currentCerts) => ({ + isSignedIn, + currentCerts + }) +); + function MapLi({ superBlock, - landing = false + landing = false, + last = false, + trackProgress, + completed, + claimed, + index }: { superBlock: SuperBlocks; landing: boolean; + last?: boolean; + trackProgress: boolean; + completed: boolean; + claimed: boolean; + index: number; }) { return ( <> @@ -44,6 +80,19 @@ function MapLi({ data-test-label='curriculum-map-button' data-playwright-test-label='curriculum-map-button' > + {trackProgress && ( + <> +