Skip to content

Commit 0ecfa69

Browse files
committed
Merge branch 'master' of https://github.com/layer5io/layer5
2 parents 13e39bf + 078efb7 commit 0ecfa69

File tree

3 files changed

+41
-9
lines changed

3 files changed

+41
-9
lines changed
Lines changed: 1 addition & 0 deletions
Loading

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,17 @@ alt="Meshery Catalog" align="left" />
134134
<br /><br /><br />
135135
</p>
136136

137+
<!-- Layer 5 academy -->
138+
<p style="clear:both;">
139+
<h2><a href="https://cloud.layer5.io/academy">Layer5 Academy</a></h2>
140+
<a href="https://cloud.layer5.io/academy">
141+
<img src=".github/assets/images/Layer5Academy/academy.svg" style="margin:10px;" width="125px" alt="Layer5 Academy" align="left" />
142+
</a>
143+
<a href="https://cloud.layer5.io/academy">Layer5 Academy</a> Layer5 Academy is a learning platform built into Layer5 Cloud. It offers structured learning paths, interactive challenges, and professional certifications. Content spans beginner to advanced levels, helping both developers and organizations skill up in cloud native technologies.
144+
<br /><br /><br/>
145+
</p>
146+
<br />
147+
137148
<p style="clear:both;">
138149
<h1><a name="contributing"></a><a name="community"></a> <a href="https://layer5.io/community">Community</a> and <a href="https://layer5.io/community/handbook">Contributions</a></h1>
139150
<p> We warmly welcome all contributors! Our projects are community-built and each welcomes open collaboration. As you get started, please review this project's <a href="https://github.com/layer5io/layer5/blob/master/CONTRIBUTING.md">contributing guidelines</a>. Whether you are a user or code contributor and whether you're opening an <a href="/../../issues">issue</a> or a <a href="/../../pulls">pull request</a>, know that any form of your engagement is considered contribution and is appreciated. Contributors are expected to adhere to the <a href="https://github.com/cncf/foundation/blob/master/code-of-conduct.md">CNCF Code of Conduct</a>.

src/sections/General/Navigation/index.js

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ const Navigation = () => {
168168
const [userData, setUserData] = useState(null);
169169
const dropDownRef = useRef();
170170
const navWrapRef = useRef();
171+
const accountDropdownRef = useRef();
172+
171173
function getCookieValue(cookieName) {
172174
const cookies = document.cookie.split(";");
173175

@@ -254,6 +256,18 @@ const Navigation = () => {
254256
closeDropDown();
255257
};
256258

259+
useEffect(() => {
260+
if (!dropDown) return;
261+
262+
const handleClickOutside = (e) => {
263+
if (!accountDropdownRef.current?.contains(e.target)) {
264+
setDropDown(false);
265+
}
266+
};
267+
268+
document.addEventListener("mousedown", handleClickOutside);
269+
return () => document.removeEventListener("mousedown", handleClickOutside);
270+
}, [dropDown]);
257271
return (
258272
<NavigationWrap
259273
className={`nav-block ${scroll ? "scrolled" : ""}`}
@@ -327,7 +341,11 @@ const Navigation = () => {
327341
changeDropdownState();
328342
closeDropDown();
329343
}}
330-
className={subItems.sepLine ? "mobile-sub-menu-item" : "mobile-nested-menu"}
344+
className={
345+
subItems.sepLine
346+
? "mobile-sub-menu-item"
347+
: "mobile-nested-menu"
348+
}
331349
activeClassName="nav-link-active"
332350
>
333351
{subItems.name}
@@ -337,8 +355,8 @@ const Navigation = () => {
337355
);
338356
})}
339357
{menu.actionItems !== undefined &&
340-
menu.actionItems.map((actionItem, index) => (
341-
(actionItem.actionName === "Join the discussion" ?
358+
menu.actionItems.map((actionItem, index) =>
359+
actionItem.actionName === "Join the discussion" ? (
342360
<a
343361
key={index}
344362
href={actionItem.actionLink}
@@ -351,10 +369,12 @@ const Navigation = () => {
351369
}}
352370
>
353371
<span className="readmore-btn">
354-
{actionItem.actionName} <IoIosArrowRoundForward />
372+
{actionItem.actionName}{" "}
373+
<IoIosArrowRoundForward />
355374
</span>
356375
</a>
357-
: <Link
376+
) : (
377+
<Link
358378
key={index}
359379
to={actionItem.actionLink}
360380
partiallyActive={true}
@@ -365,12 +385,12 @@ const Navigation = () => {
365385
}}
366386
>
367387
<span className="readmore-btn">
368-
{actionItem.actionName} <IoIosArrowRoundForward />
388+
{actionItem.actionName}{" "}
389+
<IoIosArrowRoundForward />
369390
</span>
370391
</Link>
371392
)
372-
))
373-
}
393+
)}
374394
</ul>
375395
</li>
376396
))}
@@ -412,7 +432,7 @@ const Navigation = () => {
412432
</div>
413433
<div className="meshery-cta">
414434
{userData ? (
415-
<div className="dropDown">
435+
<div className="dropDown" ref={accountDropdownRef}>
416436
<button
417437
className="avatar-container"
418438
style={{

0 commit comments

Comments
 (0)