Skip to content

Commit 0c77123

Browse files
authored
Merge pull request #771 from wickathou/bugfix/registration-responsiveness
Bugfix - Fixed bottom bar registration responsiveness
2 parents 70dd0b0 + 0cdf406 commit 0c77123

4 files changed

Lines changed: 29 additions & 22 deletions

File tree

frontend/src/components/navbars/GlobalNavBar/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,12 @@ const useStyles = makeStyles(theme => ({
3535
export default () => {
3636
const classes = useStyles()
3737
return (
38-
<div className='tw-w-full tw-py-2 tw-bg-wave-pattern ' >
38+
<div
39+
id="global-navbar"
40+
className="tw-w-full tw-py-2 tw-bg-wave-pattern "
41+
>
3942
<div className={classes.wrapper}>
4043
<div className={classes.inner}>
41-
4244
<a href="/home">
4345
<img
4446
src={PlatformLogo}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const useStyles = makeStyles(theme => ({
4747
},
4848
sectionsNum: {
4949
color: 'white',
50-
fontWeight: 'bold'
50+
fontWeight: 'bold',
5151
},
5252
buttonIcon: {
5353
marginLeft: theme.spacing(1),

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

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

50-
export default ({ section, sectionsInfo, onNext, nextLabel, onPrev, prevLabel, data }) => {
50+
export default ({
51+
section,
52+
sectionsInfo,
53+
onNext,
54+
nextLabel,
55+
onPrev,
56+
prevLabel,
57+
data,
58+
}) => {
5159
const classes = useStyles()
5260
const { registration } = useContext(EventDetailContext)
5361
console.log('section', section)
@@ -159,15 +167,6 @@ export default ({ section, sectionsInfo, onNext, nextLabel, onPrev, prevLabel, d
159167
key={question.name}
160168
className={classes.question}
161169
>
162-
{/* <div className={classes.questionInner}>
163-
<FastField
164-
autoFocus={index === 0}
165-
name={question.name}
166-
component={RegistrationQuestion}
167-
config={question}
168-
isCustom={true}
169-
/>
170-
</div> */}
171170
<div className={classes.questionInner}>
172171
<FastField name={question.name}>
173172
{props => (

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

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,14 @@ export default RequiresPermission(() => {
146146
finishRegistration,
147147
} = useContext(EventDetailContext)
148148
const userProfile = useSelector(UserSelectors.userProfile)
149-
150149
const [loading, setLoading] = useState(false)
151150
const [formData, setFormData] = useState({})
152151
const [activeStep, setActiveStep] = useState(0)
153152
const [eventNewsLetterHidden, setEventNewsLetterHidden] = useState(true)
153+
154+
const globalNavbarElement = document.getElementById('global-navbar')
155+
globalNavbarElement.style.display = 'none'
156+
154157
useEffect(() => {
155158
setTimeout(function () {
156159
window.scrollTo({ top: 0, left: 0, behavior: 'smooth' })
@@ -235,6 +238,13 @@ export default RequiresPermission(() => {
235238
return sorted.concat(event?.customQuestions ?? [])
236239
}, [event])
237240

241+
const sectionsInfo = (sections, index) => {
242+
return {
243+
sections: sections.length,
244+
activeSection: index + 1,
245+
}
246+
}
247+
238248
const setNextStep = useCallback(
239249
(nextStep, values, path) => {
240250
const newFormData = path
@@ -287,7 +297,9 @@ export default RequiresPermission(() => {
287297
}
288298
AnalyticsService.events.COMPLETE_REGISTRATION(slug)
289299
setActiveStep(sections.length + 1)
300+
globalNavbarElement.style.display = 'block'
290301
} catch (e) {
302+
globalNavbarElement.style.display = 'none'
291303
dispatch(
292304
SnackbarActions.error(
293305
'Oops, something went wrong... Please try again',
@@ -332,10 +344,7 @@ export default RequiresPermission(() => {
332344
isActive={activeStep === index}
333345
section={section}
334346
data={formData}
335-
sectionsInfo={{
336-
sections: sections.length,
337-
activeSection: index + 1,
338-
}}
347+
sectionsInfo={sectionsInfo(sections, index)}
339348
onPrev={setPrevStep}
340349
prevLabel={prevStep ? prevStep.label : null}
341350
onNext={(values, path) => {
@@ -347,10 +356,7 @@ export default RequiresPermission(() => {
347356
<RegistrationSection
348357
isActive={activeStep === index}
349358
data={formData}
350-
sectionsInfo={{
351-
sections: sections.length,
352-
activeSection: index + 1,
353-
}}
359+
sectionsInfo={sectionsInfo(sections, index)}
354360
label={section.label}
355361
fields={section.fields}
356362
onPrev={setPrevStep}

0 commit comments

Comments
 (0)