Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-2211: Onboarding - Status Bar #641

Merged
merged 10 commits into from Dec 7, 2020

Update propTypes and add comments

  • Loading branch information
benstrumeyer committed Dec 7, 2020
commit d711569609cb3e1c7294242cdfaa27d2caa50617
@@ -15,37 +15,33 @@ import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
import { NavLink } from 'react-router-dom';

// Refactor to pass in as props
// TODO: Change routes
const steps = [
{
label: t('sign_in'),
route: 'onboarding-step-1'
route: 'LINK_TO_STEP_1'
},
{
label: t('hub_onboarding_privacy'),
route: 'onboarding-step-2'
route: 'LINK_TO_STEP_2'
},
{
label: t('hub_onboarding_search'),
route: 'onboarding-step-3'
route: 'LINK_TO_STEP_3'
},
{
label: t('hub_onboarding_plan'),
route: 'onboarding-step-4'
route: 'LINK_TO_STEP_4'
}
];

/** Example of usage:
* <StepProgressBar currentStep={2} steps={steps} />
*/

/**
* A React function component for rendering the Step Progress bar
* @return {JSX} JSX for rendering the Step Progress bar of the ghostery-browser-intro-hub app
* @memberof HubComponents
*/
const StepProgressBar = (props) => {
const { currentStep } = props; // Add in steps as prop
const { currentStep } = props;
const totalSteps = steps.length;

const renderCompletedStep = step => (
@@ -113,10 +109,6 @@ const StepProgressBar = (props) => {
};
// PropTypes ensure we pass required props of the correct type
StepProgressBar.propTypes = {
steps: PropTypes.shape({
label: PropTypes.string.isRequired,
route: PropTypes.string.isRequired,
}).isRequired,
currentStep: PropTypes.number.isRequired,
};

ProTip! Use n and p to navigate between commits in a pull request.