Skip to content

Commit 6671ddb

Browse files
authored
Add support for custom links on Navi menu logo
1 parent 794e8f2 commit 6671ddb

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/components/TopNav/index.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ const TopNav = ({
7272
setOpenMore,
7373
openMore,
7474
loggedIn,
75-
profileHandle
75+
profileHandle,
76+
logoLink
7677
}) => {
7778
useEffect(() => {
7879
const orientationchange = () => {
@@ -183,7 +184,11 @@ const TopNav = ({
183184

184185
const handleClickLogo = (e) => {
185186
e.preventDefault()
186-
window.location = loggedIn ? config.URL.HOME : config.URL.BASE
187+
if (logoLink) {
188+
window.location = logoLink
189+
} else {
190+
window.location = loggedIn ? config.URL.HOME : config.URL.BASE
191+
}
187192
}
188193

189194
const expandMenu = (menuId, menu2Id) => {
@@ -594,7 +599,9 @@ TopNav.propTypes = {
594599

595600
loggedIn: PropTypes.bool,
596601

597-
profileHandle: PropTypes.string
602+
profileHandle: PropTypes.string,
603+
604+
logoLink: PropTypes.string
598605
}
599606

600607
export default TopNav

0 commit comments

Comments
 (0)