1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-27 12:56:01 +01:00
metamask-extension/ui/components/app/step-progress-bar/step-progress-bar.js
dragana8 d01a2ad7e5
Overall CSS #13441 (#13902)
* styling updates

Co-authored-by: Alex Donesky <adonesky@gmail.com>
Co-authored-by: George Marshall <george.marshall@consensys.net>
Co-authored-by: David Walsh <davidwalsh83@gmail.com>
2022-05-16 13:38:04 -05:00

91 lines
2.1 KiB
JavaScript

import React from 'react';
import classnames from 'classnames';
import PropTypes from 'prop-types';
import { capitalize } from 'lodash';
import { useI18nContext } from '../../../hooks/useI18nContext';
import Box from '../../ui/box';
import { BLOCK_SIZES } from '../../../helpers/constants/design-system';
export const threeStepStages = {
PASSWORD_CREATE: 1,
RECOVERY_PHRASE_VIDEO: 2,
RECOVERY_PHRASE_REVIEW: 3,
RECOVERY_PHRASE_CONFIRM: 4,
ONBOARDING_COMPLETE: 5,
};
export const twoStepStages = {
RECOVERY_PHRASE_CONFIRM: 1,
PASSWORD_CREATE: 2,
};
export function ThreeStepProgressBar({ stage, ...boxProps }) {
const t = useI18nContext();
return (
<Box {...boxProps}>
<ul className="progressbar">
<li
className={classnames({
active: stage >= 1,
complete: stage > 1,
})}
>
{capitalize(t('createPassword'))}
</li>
<li
className={classnames({
active: stage >= 2,
complete: stage > 3,
})}
>
{capitalize(t('secureWallet'))}
</li>
<li
className={classnames({
active: stage >= 4,
complete: stage > 5,
})}
>
{capitalize(t('confirmRecoveryPhrase'))}
</li>
</ul>
</Box>
);
}
export function TwoStepProgressBar({ stage, ...boxProps }) {
const t = useI18nContext();
return (
<Box width={BLOCK_SIZES.FULL} {...boxProps}>
<ul className="progressbar two-steps">
<li
className={classnames({
active: stage >= 1,
complete: stage > 1,
})}
>
{capitalize(t('confirmRecoveryPhrase'))}
</li>
<li
className={classnames('two-steps', {
active: stage >= 2,
complete: stage > 2,
})}
>
{capitalize(t('createPassword'))}
</li>
</ul>
</Box>
);
}
ThreeStepProgressBar.propTypes = {
stage: PropTypes.number,
...Box.propTypes,
};
TwoStepProgressBar.propTypes = {
stage: PropTypes.number,
...Box.propTypes,
};