Skip to content

Commit 86d576f

Browse files
Refactor: optimized internalLinks and enabled mobile logos
1 parent 33d31cd commit 86d576f

1 file changed

Lines changed: 7 additions & 10 deletions

File tree

client/components/header/header.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,12 @@ export default class Header extends React.Component {
109109
};
110110

111111
renderNavLinks = (isMobile = false) => {
112-
const { header, orgSlug, isAuthenticated, userData, language, location } = this.props;
113-
const { links } = header;
114-
const { pathname } = location;
115-
const internalLinks = [`/${orgSlug}/login`, `/${orgSlug}/registration`];
116-
117-
return links?.map((link, index) => {
112+
const { header, orgSlug, isAuthenticated, userData, language, location } = this.props;
113+
const { links } = header;
114+
const { pathname } = location;
115+
const internalLinks = ["/login", "/registration"].map(p => `/${orgSlug}${p}`);
116+
117+
return links?.map((link, index) => {
118118
if (!shouldLinkBeShown(link, isAuthenticated, userData)) return null;
119119

120120
const isInternal = isInternalLink(link.url);
@@ -147,12 +147,10 @@ export default class Header extends React.Component {
147147
<div className="header-row-1">
148148
<div className="header-row-1-inner">
149149
<div className="header-left">{this.renderLogos()}</div>
150-
151150
{/* Desktop Languages */}
152151
<div className="header-right header-desktop-only">
153152
{this.renderLanguageButtons()}
154153
</div>
155-
156154
{/* Mobile Hamburger */}
157155
<div className="header-right header-mobile-only">
158156
<div
@@ -170,16 +168,15 @@ export default class Header extends React.Component {
170168
</div>
171169
</div>
172170
</div>
173-
174171
{/* Row 2: Desktop Navigation */}
175172
<div className="header-row-2 header-desktop-only">
176173
<div className="header-row-2-inner">
177174
{this.renderNavLinks()}
178175
</div>
179176
</div>
180-
181177
{/* Mobile Menu Overlay */}
182178
<div className={`${menu ? "display-flex" : "display-none"} header-mobile-menu header-mobile-only`}>
179+
{this.renderLogos(true)}
183180
{this.renderNavLinks(true)}
184181
<div className="mobile-languages-row">
185182
{this.renderLanguageButtons(true)}

0 commit comments

Comments
 (0)