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

Refactor labels

  • Loading branch information
benstrumeyer committed Dec 7, 2020
commit eab6428e5f7b6b01e156a5c0710d81e767b626c4
@@ -1734,6 +1734,15 @@
"hub_create_account_toast_error": {
"message": "That email address is already in use. Please choose another."
},
"hub_onboarding_privacy": {
"message": "Privacy"
},
"hub_onboarding_search": {
"message": "Search"
},
"hub_onboarding_plan": {
"message": "Plan"
},
"enable_when_paused": {
"message": "To use this function, Resume Ghostery."
},
@@ -18,7 +18,7 @@ import { NavLink } from 'react-router-dom';
import QueryString from 'query-string';
import globals from '../../../../src/classes/Globals';

const stepLabels = ['Sign In', 'Privacy', 'Search', 'Plan'];
const stepLabels = [t('sign_in'), t('hub_onboarding_privacy'), t('hub_onboarding_search'), t('hub_onboarding_plan')];

/**
* A React function component for rendering the Step Progress bar
@@ -29,20 +29,6 @@ const StepProgressBar = (props) => {
const currentStep = 2;
const totalSteps = stepLabels.length;

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>
@@ -68,13 +54,13 @@ const StepProgressBar = (props) => {
stepLabels.map((value, index) => (
<div key={value}>
{(index + 1 < currentStep) && (
renderCompletedStep(getStepLabel(index + 1), index + 1)
renderCompletedStep(stepLabels[index])
)}
{(index + 1 === currentStep) && (
renderCurrentStep(value, index + 1)
renderCurrentStep(stepLabels[index], index + 1)
)}
{(index + 1 > currentStep) && (
renderIncompleteStep(value, index + 1)
renderIncompleteStep(stepLabels[index], index + 1)
)}
</div>
))
ProTip! Use n and p to navigate between commits in a pull request.