diff --git a/src/components/RegisterStepIcon.js b/src/components/RegisterStepIcon.js
new file mode 100644
index 0000000..e143959
--- /dev/null
+++ b/src/components/RegisterStepIcon.js
@@ -0,0 +1,55 @@
+import { Box, useTheme } from '@mui/material';
+
+/** Darker green for completed register steps (matches PAY button hover). */
+export const REGISTER_STEP_COMPLETED_COLOR = '#488F52';
+
+export const registerStepStyle = {
+ width: { lg: '40%', md: '70%', xs: '100%' },
+ boxShadow: 1,
+ backgroundColor: '#FFFFFF',
+ padding: 2,
+ '& .MuiStepLabel-label': { color: '#424242' },
+ '& .MuiStepConnector-line': { borderColor: '#9E9E9E' },
+ '& .MuiStepConnector-root.Mui-completed .MuiStepConnector-line': {
+ borderColor: REGISTER_STEP_COMPLETED_COLOR,
+ },
+ '& .MuiStepConnector-root.Mui-active .MuiStepConnector-line': {
+ borderColor: 'warning.main',
+ },
+};
+
+const RegisterStepIcon = ({ active, completed, className, icon }) => {
+ const theme = useTheme();
+ let circleColor = '#757575';
+ let textColor = '#FFFFFF';
+
+ if (completed) {
+ circleColor = REGISTER_STEP_COMPLETED_COLOR;
+ } else if (active) {
+ circleColor = theme.palette.warning.main;
+ textColor = '#1A1A1A';
+ }
+
+ return (
+
+ {icon}
+
+ );
+};
+
+export default RegisterStepIcon;
diff --git a/src/pages/authentication/BusRegister.js b/src/pages/authentication/BusRegister.js
index 741b8e2..6e9accf 100644
--- a/src/pages/authentication/BusRegister.js
+++ b/src/pages/authentication/BusRegister.js
@@ -12,7 +12,8 @@ import {
Button, StepLabel,
CircularProgress,
} from '@mui/material';
-import VisibilityIcon from '@mui/icons-material/Visibility';
+import { POST_USERNAME, POST_VERIFY_CAPTCHA } from "utils/ApiPathConst";
+import RegisterStepIcon, { registerStepStyle } from 'components/RegisterStepIcon';
// project import
import Loadable from 'components/Loadable';
@@ -21,7 +22,6 @@ import { notifyActionError } from 'utils/CommonFunction';
const CustomFormWizard = Loadable(lazy(() => import('./auth-forms/BusCustomFormWizard')));
const AuthWrapper = Loadable(lazy(() => import('./AuthWrapperCustom')));
import axios from "axios";
-import { POST_USERNAME, POST_VERIFY_CAPTCHA } from "utils/ApiPathConst";
import {FormattedMessage, useIntl} from "react-intl";
import { PRIMARY_CONTAINED_BUTTON_SX } from "themes/colorConst";
// import CustomFormWizard from './auth-forms/BusCustomFormWizard';
@@ -38,6 +38,7 @@ const BusRegister = () => {
const [base64Url, setBase64Url] = useState("")
const [checkCode, setCheckCode] = useState("")
const [isNextBusy, setIsNextBusy] = useState(false);
+ const [registrationComplete, setRegistrationComplete] = useState(false);
const intl = useIntl();
const steps = [
intl.formatMessage({id: 'personalInformation'}),
@@ -45,30 +46,6 @@ const BusRegister = () => {
intl.formatMessage({id: 'finishSubmission'})
];
- const stepStyle = {
- width: { lg: "40%", md: "70%", xs: "100%" },
- boxShadow: 1,
- backgroundColor: "#FFFFFF",
- padding: 2,
-
- /* Inactive (default) */
- "& .MuiStepIcon-root": { color: "#757575", fontSize: "2rem" }, // darker grey
- "& .MuiStepLabel-label": { color: "#424242" }, // label darker
- "& .MuiStepConnector-line": { borderColor: "#9E9E9E" }, // connector darker
-
- /* Active */
- "& .Mui-active": {
- "&.MuiStepIcon-root": { color: "warning.main", fontSize: "2rem" },
- "& .MuiStepConnector-line": { borderColor: "warning.main" }
- },
-
- /* Completed */
- "& .Mui-completed": {
- "&.MuiStepIcon-root": { color: "#1976d2", fontSize: "2rem" }, // use your strong blue
- "& .MuiStepConnector-line": { borderColor: "#1976d2" }
- }
- };
-
const totalSteps = () => {
return steps.length;
};
@@ -148,51 +125,30 @@ const BusRegister = () => {
const handleReset = () => {
setActiveStep(0);
setCompleted({});
+ setRegistrationComplete(false);
};
+ const isStepCompleted = (index) => index < activeStep || registrationComplete;
+
return (
//
-
+
{steps.map((label, index) => (
-
- {index < 2 ? (
-
-
- {label}
-
-
- ) : (
- }
- // onClick={handleStep(index)}
+
+
+
-
- {label}
-
-
- )}
+ {label}
+
+
))}
@@ -216,6 +172,7 @@ const BusRegister = () => {
setUsername={setUsername}
setBase64Url={setBase64Url}
setCheckCode={setCheckCode}
+ onRegistrationComplete={() => setRegistrationComplete(true)}
/>
{/* */}
diff --git a/src/pages/authentication/IAmSmartRegister.js b/src/pages/authentication/IAmSmartRegister.js
index 3fd578b..45edd96 100644
--- a/src/pages/authentication/IAmSmartRegister.js
+++ b/src/pages/authentication/IAmSmartRegister.js
@@ -13,10 +13,11 @@ import {
Stack,
Typography,
Button,
+ StepLabel,
CircularProgress,
} from '@mui/material';
-import VisibilityIcon from '@mui/icons-material/Visibility';
import { GET_ID, POST_VERIFY_CAPTCHA } from "utils/ApiPathConst";
+import RegisterStepIcon, { registerStepStyle } from 'components/RegisterStepIcon';
// project import
import Loadable from 'components/Loadable';
@@ -24,32 +25,10 @@ import { lazy } from 'react';
import { notifyActionError } from 'utils/CommonFunction';
import axios from "axios";
import {FormattedMessage, useIntl} from "react-intl";
+import { PRIMARY_CONTAINED_BUTTON_SX } from "themes/colorConst";
const CustomFormWizard = Loadable(lazy(() => import('./auth-forms/IAmSmartFormWizard')));
const AuthWrapper = Loadable(lazy(() => import('./AuthWrapperCustom')));
// ================================|| REGISTER ||================================ //
- const stepStyle = {
- width: { lg: "40%", md: "70%", xs: "100%" },
- boxShadow: 1,
- backgroundColor: "#FFFFFF",
- padding: 2,
-
- /* Inactive (default) */
- "& .MuiStepIcon-root": { color: "#757575", fontSize: "2rem" }, // darker grey
- "& .MuiStepLabel-label": { color: "#424242" }, // label darker
- "& .MuiStepConnector-line": { borderColor: "#9E9E9E" }, // connector darker
-
- /* Active */
- "& .Mui-active": {
- "&.MuiStepIcon-root": { color: "warning.main", fontSize: "2rem" },
- "& .MuiStepConnector-line": { borderColor: "warning.main" }
- },
-
- /* Completed */
- "& .Mui-completed": {
- "&.MuiStepIcon-root": { color: "#1976d2", fontSize: "2rem" }, // use your strong blue
- "& .MuiStepConnector-line": { borderColor: "#1976d2" }
- }
- };
const Register = () => {
const [activeStep, setActiveStep] = useState(0);
@@ -61,6 +40,7 @@ const Register = () => {
const [checkCode, setCheckCode] = useState("")
const [idNo, setIdNo] = useState("");
const [isNextBusy, setIsNextBusy] = useState(false);
+ const [registrationComplete, setRegistrationComplete] = useState(false);
const intl = useIntl();
const steps = [
intl.formatMessage({id: 'personalInformation'}),
@@ -152,37 +132,30 @@ const Register = () => {
const handleReset = () => {
setActiveStep(0);
setCompleted({});
+ setRegistrationComplete(false);
};
+ const isStepCompleted = (index) => index < activeStep || registrationComplete;
+
return (
//
-
+
{steps.map((label, index) => (
-
- {index < 2 ? (
-
- {label}
-
- ) : (
- }
- // onClick={handleStep(index)}
+
+
+
{label}
-
- )}
+
+
))}
@@ -207,6 +180,7 @@ const Register = () => {
setIdNo={setIdNo}
setBase64Url={setBase64Url}
setCheckCode={setCheckCode}
+ onRegistrationComplete={() => setRegistrationComplete(true)}
/>
{/* */}
@@ -239,33 +213,33 @@ const Register = () => {
{activeStep === totalSteps() - 2 ?
(
) : (activeStep === totalSteps() - 1 ?
(
-