fix: show subtitles

This commit is contained in:
RadoslavDimchev 2024-01-18 18:21:24 +02:00
parent 6be6caf89b
commit c40c15b70f

View File

@ -20,6 +20,7 @@ type FormStepperProps = {
} }
const FormStepper = ({ activeStep, windowWidth }: FormStepperProps) => { const FormStepper = ({ activeStep, windowWidth }: FormStepperProps) => {
const dispatch = useDispatch()
const isStepVisible = (index: number) => { const isStepVisible = (index: number) => {
if (windowWidth < 740) { if (windowWidth < 740) {
const start = Math.max(0, activeStep - 1) const start = Math.max(0, activeStep - 1)
@ -30,8 +31,6 @@ const FormStepper = ({ activeStep, windowWidth }: FormStepperProps) => {
} }
} }
const dispatch = useDispatch()
const changeStepOnClickHandler = (index: number) => { const changeStepOnClickHandler = (index: number) => {
if (activeStep > index) { if (activeStep > index) {
dispatch(setActiveStep(index)) dispatch(setActiveStep(index))
@ -39,6 +38,7 @@ const FormStepper = ({ activeStep, windowWidth }: FormStepperProps) => {
} }
const visibleSteps = steps.filter((_, index) => isStepVisible(index)) const visibleSteps = steps.filter((_, index) => isStepVisible(index))
return ( return (
<Stepper <Stepper
activeStep={activeStep} activeStep={activeStep}
@ -52,7 +52,6 @@ const FormStepper = ({ activeStep, windowWidth }: FormStepperProps) => {
height: 'fit-content', height: 'fit-content',
padding: 0, padding: 0,
marginBottom: '3rem', marginBottom: '3rem',
overflow: 'hidden',
}} }}
> >
{visibleSteps.map(step => { {visibleSteps.map(step => {