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

Add labels

  • Loading branch information
benstrumeyer committed Dec 7, 2020
commit 48633b03967713a0fa19fbf925ab20c070f8d585
@@ -29,29 +29,52 @@ const StepProgressBar = (props) => {
const currentStep = 2;
const totalSteps = stepLabels.length;

const renderCompletedStep = value => (
<div className="StepProgressBar__Step step-completed" />
const getStepLabel = (step) => {
switch (step) {
case 1:
return t('sign_in');
case 2:
return t('privacy');
case 3:
return t('search');
case 4:
return t('plan');
default: return '';
}
};

const renderCompletedStep = label => (
<div className="StepProgressBar__column">
<div className="StepProgressBar__label">{label}</div>
<div className="StepProgressBar__Step step-completed" />
</div>
);

const renderCurrentStep = value => (
<div className={`StepProgressBar__Step step-${value} current`} />
const renderCurrentStep = (label, value) => (
<div className="StepProgressBar__column">
<div className="StepProgressBar__label">{label}</div>
<div className={`StepProgressBar__Step step-${value} current`} />
</div>
);

const renderIncompleteStep = value => (
<div className={`StepProgressBar__Step step-${value} incomplete`} />
const renderIncompleteStep = (label, value) => (
<div className="StepProgressBar__column">
<div className="StepProgressBar__label">{label}</div>
<div className={`StepProgressBar__Step step-${value} incomplete`} />
</div>
);

const renderProgressBar = () => (
stepLabels.map((value, index) => (
<div key={value}>
{(index + 1 < currentStep) && (
renderCompletedStep(index + 1)
renderCompletedStep(getStepLabel(index + 1), index + 1)
)}
{(index + 1 === currentStep) && (
renderCurrentStep(index + 1)
renderCurrentStep(value, index + 1)
)}
{(index + 1 > currentStep) && (
renderIncompleteStep(index + 1)
renderIncompleteStep(value, index + 1)
)}
</div>
))
@@ -15,7 +15,6 @@
display: flex;
justify-content: space-around;
}

.StepProgressBar__Step {
height: 34px;
width: 32px;
@@ -60,3 +59,13 @@
background-repeat: no-repeat;
}
}
.StepProgressBar__column {
display: flex;
flex-direction: column;
align-items: center;
}
.StepProgressBar__label {
margin-bottom: 14px;
font-size: 12px;
color: $tundora;
}
ProTip! Use n and p to navigate between commits in a pull request.