Skip to content

Commit 70dd0b0

Browse files
authored
Merge pull request #769 from nikkxll/STAG
Added info about registration pages numeration
2 parents 2bb6f41 + 8694d6e commit 70dd0b0

4 files changed

Lines changed: 23 additions & 3 deletions

File tree

frontend/src/pages/_events/slug/register/RegistrationBottomBar/index.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useEffect, useState } from 'react'
22

3-
import { Box } from '@material-ui/core'
3+
import { Box, Typography } from '@material-ui/core'
44
import { makeStyles } from '@material-ui/core/styles'
55

66
import ArrowBackIcon from '@material-ui/icons/ArrowBack'
@@ -45,6 +45,10 @@ const useStyles = makeStyles(theme => ({
4545
display: 'none',
4646
},
4747
},
48+
sectionsNum: {
49+
color: 'white',
50+
fontWeight: 'bold'
51+
},
4852
buttonIcon: {
4953
marginLeft: theme.spacing(1),
5054
marginRight: theme.spacing(1),
@@ -58,6 +62,7 @@ const RegistrationBottomBar = ({
5862
onNext,
5963
errors,
6064
dirty,
65+
sectionsInfo,
6166
}) => {
6267
const classes = useStyles()
6368
const [enabled, setEnabled] = useState(false)
@@ -77,6 +82,11 @@ const RegistrationBottomBar = ({
7782
</Button>
7883
)}
7984
<Box className={classes.right}>
85+
{sectionsInfo && (
86+
<Typography className={classes.sectionsNum}>
87+
{`${sectionsInfo.activeSection}/${sectionsInfo.sections}`}
88+
</Typography>
89+
)}
8090
<ErrorDisplay errors={errors} />
8191
<Button
8292
className={classes.nextButton}

frontend/src/pages/_events/slug/register/RegistrationSection/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const useStyles = makeStyles(theme => ({
3838
}))
3939

4040
export default props => {
41-
const { fields, onNext, nextLabel, prevLabel, onPrev, data, isActive } =
41+
const { sectionsInfo, fields, onNext, nextLabel, prevLabel, onPrev, data, isActive } =
4242
props
4343
const { event, registration } = useContext(EventDetailContext)
4444
const userProfile = useSelector(UserSelectors.userProfile)
@@ -131,6 +131,7 @@ export default props => {
131131
onNext={handleSubmit}
132132
errors={errors}
133133
dirty={dirty}
134+
sectionsInfo={sectionsInfo}
134135
/>,
135136
document.body,
136137
)}

frontend/src/pages/_events/slug/register/RegistrationSectionCustom/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const useStyles = makeStyles(theme => ({
4747
},
4848
}))
4949

50-
export default ({ section, onNext, nextLabel, onPrev, prevLabel, data }) => {
50+
export default ({ section, sectionsInfo, onNext, nextLabel, onPrev, prevLabel, data }) => {
5151
const classes = useStyles()
5252
const { registration } = useContext(EventDetailContext)
5353
console.log('section', section)
@@ -194,6 +194,7 @@ export default ({ section, onNext, nextLabel, onPrev, prevLabel, data }) => {
194194
onNext={handleSubmit}
195195
errors={errors}
196196
dirty={dirty}
197+
sectionsInfo={sectionsInfo}
197198
/>,
198199
document.body,
199200
)}

frontend/src/pages/_events/slug/register/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,10 @@ export default RequiresPermission(() => {
332332
isActive={activeStep === index}
333333
section={section}
334334
data={formData}
335+
sectionsInfo={{
336+
sections: sections.length,
337+
activeSection: index + 1,
338+
}}
335339
onPrev={setPrevStep}
336340
prevLabel={prevStep ? prevStep.label : null}
337341
onNext={(values, path) => {
@@ -343,6 +347,10 @@ export default RequiresPermission(() => {
343347
<RegistrationSection
344348
isActive={activeStep === index}
345349
data={formData}
350+
sectionsInfo={{
351+
sections: sections.length,
352+
activeSection: index + 1,
353+
}}
346354
label={section.label}
347355
fields={section.fields}
348356
onPrev={setPrevStep}

0 commit comments

Comments
 (0)