// import { Link } from 'react-router-dom'; import React,{useState // ,useEffect } from 'react'; // material-ui import { Stepper, Step, StepButton, // Grid, Stack, Typography, Button, } from '@mui/material'; import VisibilityIcon from '@mui/icons-material/Visibility'; // project import import Loadable from 'components/Loadable'; import { lazy } from 'react'; const CustomFormWizard = Loadable(lazy(() => import('./auth-forms/CustomFormWizard'))); const AuthWrapper = Loadable(lazy(() => import('./AuthWrapperCustom'))); // ================================|| REGISTER ||================================ // const stepStyle = { width:"40%", boxShadow: 1, backgroundColor: "#FFFFFF", padding: 2, "& .Mui-active": { "&.MuiStepIcon-root": { color: "warning.main", fontSize: "2rem", }, "& .MuiStepConnector-line": { borderColor: "warning.main" } }, "& .Mui-completed": { "&.MuiStepIcon-root": { color: "secondary.main", fontSize: "2rem", }, "& .MuiStepConnector-line": { borderColor: "secondary.main" } } } const steps = ['個人資料', '預覽', '完成提交']; const Register = () => { const [activeStep, setActiveStep] = useState(0); const [completed, setCompleted] = useState([false]); const [updateValid, setUpdateValid] = useState(false); const totalSteps = () => { return steps.length; }; const completedSteps = () => { return Object.keys(completed).length; }; const isLastStep = () => { return activeStep === totalSteps() - 1; }; const allStepsCompleted = () => { return completedSteps() === totalSteps(); }; const handleNext = () => { const newActiveStep = isLastStep() && !allStepsCompleted() ? // It's the last step, but not all steps have been completed, // find the first step that has been completed steps.findIndex((step, i) => !(i in completed)) : activeStep + 1; setActiveStep(newActiveStep); scrollToTop(); }; const handleBack = () => { scrollToTop(); setActiveStep((prevActiveStep) => prevActiveStep - 1); }; const scrollToTop = () => { window.scrollTo(0,0); }; const handleReset = () => { setActiveStep(0); setCompleted({}); }; return( // {steps.map((label, index) => ( { index < 2 ? ( {label} ) : (} // onClick={handleStep(index)} > {label} ) } ))} {allStepsCompleted() ? ( All steps completed - you're finished ) : ( {/* */} { activeStep === 2|| activeStep === 0? ( ):( ) } {activeStep === totalSteps() - 2 ? ( ) : ( activeStep === totalSteps() - 1 ? ( ): ( // ) )} {/* {activeStep !== steps.length && (completed[activeStep] ? ( Step {activeStep + 1} already completed ) : ( ))} */} )} // ); }; export default Register;