Skip to content

Commit 3dfa4c9

Browse files
committed
Added ID to global navbar to target it from other components
Global navbar display switch to none when the user visits /register, which fixes issue with action bar not being responsive Applied lint rules to some files and deleted some commented code
1 parent 8694d6e commit 3dfa4c9

4 files changed

Lines changed: 21 additions & 15 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: 7 additions & 2 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' })
@@ -287,7 +290,9 @@ export default RequiresPermission(() => {
287290
}
288291
AnalyticsService.events.COMPLETE_REGISTRATION(slug)
289292
setActiveStep(sections.length + 1)
293+
globalNavbarElement.style.display = 'block'
290294
} catch (e) {
295+
globalNavbarElement.style.display = 'none'
291296
dispatch(
292297
SnackbarActions.error(
293298
'Oops, something went wrong... Please try again',
@@ -350,7 +355,7 @@ export default RequiresPermission(() => {
350355
sectionsInfo={{
351356
sections: sections.length,
352357
activeSection: index + 1,
353-
}}
358+
}}
354359
label={section.label}
355360
fields={section.fields}
356361
onPrev={setPrevStep}

0 commit comments

Comments
 (0)