Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 3989def

Browse files
committed
Merge branch 'dev'
Signed-off-by: Rakib Ansary <[email protected]>
2 parents 8b32a61 + fdf1368 commit 3989def

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/components/NavBar/index.jsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Shows global top navigation bar with all apps menu, logo and user menu.
55
*/
6-
import React, {
6+
import React, {
77
useState,
88
useCallback,
99
Fragment,
@@ -51,6 +51,14 @@ const NavBar = ({ hideSwitchTools }) => {
5151
[setActiveApp]
5252
);
5353

54+
const renderTopcoderLogo = hideSwitchTools ? (
55+
<img src={TCLogo} alt="Topcoder Logo" />
56+
) : (
57+
<Link to="/">
58+
<img src={TCLogo} alt="Topcoder Logo" />
59+
</Link>
60+
);
61+
5462
return (
5563
<div className="navbar">
5664
<div className="navbar-left">
@@ -60,9 +68,7 @@ const NavBar = ({ hideSwitchTools }) => {
6068
)
6169
) : (
6270
<Fragment>
63-
<Link to="/">
64-
<img src={TCLogo} alt="Topcoder Logo" />
65-
</Link>
71+
{renderTopcoderLogo}
6672
<div className="navbar-divider"></div>
6773
<div className="navbar-app-title">
6874
{activeApp ? activeApp.title : ""}
@@ -72,13 +78,7 @@ const NavBar = ({ hideSwitchTools }) => {
7278
</div>
7379

7480
<div className="navbar-center">
75-
{isMobile ? (
76-
<Link to="/">
77-
<img src={TCLogo} alt="Topcoder Logo" />
78-
</Link>
79-
) : (
80-
<Fragment></Fragment>
81-
)}
81+
{isMobile ? renderTopcoderLogo : <Fragment></Fragment>}
8282
{process.env.NODE_ENV === "test" && (
8383
<h3 style={{ display: "none" }}>Navbar App Test</h3>
8484
)}

0 commit comments

Comments
 (0)