You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.4 KiB

  1. import { Box, useTheme } from '@mui/material';
  2. /** Darker green for completed register steps (matches PAY button hover). */
  3. export const REGISTER_STEP_COMPLETED_COLOR = '#488F52';
  4. export const registerStepStyle = {
  5. width: { lg: '40%', md: '70%', xs: '100%' },
  6. boxShadow: 1,
  7. backgroundColor: '#FFFFFF',
  8. padding: 2,
  9. '& .MuiStepLabel-label': { color: '#424242' },
  10. '& .MuiStepConnector-line': { borderColor: '#9E9E9E' },
  11. '& .MuiStepConnector-root.Mui-completed .MuiStepConnector-line': {
  12. borderColor: REGISTER_STEP_COMPLETED_COLOR,
  13. },
  14. '& .MuiStepConnector-root.Mui-active .MuiStepConnector-line': {
  15. borderColor: 'warning.main',
  16. },
  17. };
  18. const RegisterStepIcon = ({ active, completed, className, icon }) => {
  19. const theme = useTheme();
  20. let circleColor = '#757575';
  21. let textColor = '#FFFFFF';
  22. if (completed) {
  23. circleColor = REGISTER_STEP_COMPLETED_COLOR;
  24. } else if (active) {
  25. circleColor = theme.palette.warning.main;
  26. textColor = '#1A1A1A';
  27. }
  28. return (
  29. <Box
  30. className={className}
  31. sx={{
  32. width: '2rem',
  33. height: '2rem',
  34. borderRadius: '50%',
  35. backgroundColor: circleColor,
  36. display: 'flex',
  37. alignItems: 'center',
  38. justifyContent: 'center',
  39. color: textColor,
  40. fontSize: '1rem',
  41. fontWeight: 600,
  42. lineHeight: 1,
  43. }}
  44. >
  45. {icon}
  46. </Box>
  47. );
  48. };
  49. export default RegisterStepIcon;