Skip to content

Commit

Permalink
fix navbar bug (#1123)
Browse files Browse the repository at this point in the history
Co-authored-by: Ndibe Raymond Olisaemeka <rolisaemeka-ctr@wikimedia.org>
  • Loading branch information
NdibeRaymond and Ndibe Raymond Olisaemeka authored Mar 4, 2024
1 parent 1930012 commit e1c4774
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions zubhub_frontend/zubhub/src/views/PageWrapper.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,14 @@ function PageWrapper(props) {
// useLocation in every component that needs them.
// React.cloneElement makes our code brittle: see https://react.dev/reference/react/cloneElement
const childrenRenderer = () =>
React.Children.map(props.children, child => React.cloneElement(child, { ...routeProps, ...props }));
React.Children.map(props.children, child => React.cloneElement(child, { ...props, ...routeProps }));
return (
<>
<ToastContainer />
<CssBaseline />

<Toolbar ref={backToTopEl} className={classes.marginBottom} />
<Navbar {...props} />
<Navbar {...props} {...routeProps} />

<Container className={classes.childrenContainer} maxWidth="lg">
{props.auth?.token ? <DashboardLayout>{loading ? <LoadingPage /> : childrenRenderer()}</DashboardLayout> : null}
Expand Down

0 comments on commit e1c4774

Please sign in to comment.