Skip to content

Commit b303f04

Browse files
committed
Navigating to home page in react way to avoid page reloading during offline
1 parent 892adbc commit b303f04

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

forms-flow-nav/src/sidenav/Sidebar.jsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,10 +239,11 @@ const Sidebar = React.memo(({ props, sidenavHeight="100%" }) => {
239239

240240
return (
241241
<div className="sidenav" style={{ height: sidenavHeight }}>
242-
<a
243-
href={`/${window?._env_?.REACT_APP_BASE_ROUTE || ""}`}
242+
<div
243+
onClick={() => history.push(`/${window?._env_?.REACT_APP_BASE_ROUTE || ""}`)}
244244
className="logo-container"
245245
aria-label="Go to homepage"
246+
style={{ cursor: 'pointer' }}
246247
>
247248
{APPLICATION_NAME === "roadsafety" ? (
248249
<img
@@ -254,7 +255,7 @@ const Sidebar = React.memo(({ props, sidenavHeight="100%" }) => {
254255
) : (
255256
<ApplicationLogo data-testid="application-logo" />
256257
)}
257-
</a>
258+
</div>
258259
<div className="options-container" data-testid="options-container">
259260
<Accordion activeKey={activeKey} onSelect={(key) => setActiveKey(key)}>
260261
{ENABLE_FORMS_MODULE &&

0 commit comments

Comments
 (0)