sak1b

stepper

Dec 29th, 2021
1,214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import * as React from 'react';
  2. import {createStyles, makeStyles, Theme, useTheme} from '@material-ui/core/styles';
  3. import MobileStepper from '@material-ui/core/MobileStepper';
  4. import Button from '@material-ui/core/Button';
  5. import KeyboardArrowLeft from '@material-ui/icons/KeyboardArrowLeft';
  6. import KeyboardArrowRight from '@material-ui/icons/KeyboardArrowRight';
  7.  
  8. const useStyles = makeStyles((theme: Theme) =>
  9.   createStyles({
  10.     'MuiMobileStepper-dot': {
  11.       position: 'relative',
  12.       background: 'black',
  13.       zIndex: 12,
  14.     },
  15.   }
  16.   )
  17. );
  18.  
  19. export default function DotsMobileStepper() {
  20.   const theme = useTheme();
  21.   const classes = useStyles();
  22.   const [activeStep, setActiveStep] = React.useState(0);
  23.  
  24.   const handleNext = () => {
  25.     setActiveStep((prevActiveStep) => prevActiveStep + 1);
  26.   };
  27.  
  28.   const handleBack = () => {
  29.     setActiveStep((prevActiveStep) => prevActiveStep - 1);
  30.   };
  31.  
  32.   return (
  33.     <MobileStepper
  34.       variant="dots"
  35.       steps={6}
  36.       position="static"
  37.       activeStep={activeStep}
  38.       className={classes["MuiMobileStepper-dot"]}
  39.       //sx={{ maxWidth: 400, flexGrow: 1 }}
  40.       nextButton={
  41.         <Button size="small" onClick={handleNext} disabled={activeStep === 5}>
  42.           Next
  43.           {theme.direction === 'rtl' ? (
  44.             <KeyboardArrowLeft />
  45.           ) : (
  46.             <KeyboardArrowRight />
  47.           )}
  48.         </Button>
  49.       }
  50.       backButton={
  51.         <Button size="small" onClick={handleBack} disabled={activeStep === 0}>
  52.           {theme.direction === 'rtl' ? (
  53.             <KeyboardArrowRight />
  54.           ) : (
  55.             <KeyboardArrowLeft />
  56.           )}
  57.           Back
  58.         </Button>
  59.       }
  60.     />
  61.   );
  62. }
  63.  
  64. /----/
  65. .video_room__outline {
  66.     /*display: flex;*/
  67.     background: black;
  68.     height: 100vh;
  69. }
Advertisement
Add Comment
Please, Sign In to add comment