diff --git a/src/__tests__/widgets/menu.test.tsx b/src/__tests__/widgets/menu.test.tsx index a40e34136..71d234c1d 100644 --- a/src/__tests__/widgets/menu.test.tsx +++ b/src/__tests__/widgets/menu.test.tsx @@ -273,7 +273,7 @@ it("renders correctly", () => {
{ class="sc-pFZIQ kJqcph" >
{
{
{
{
diff --git a/src/__tests__/widgets/walletModal.test.tsx b/src/__tests__/widgets/walletModal.test.tsx index 27929ddb1..5cf5f8f3c 100644 --- a/src/__tests__/widgets/walletModal.test.tsx +++ b/src/__tests__/widgets/walletModal.test.tsx @@ -335,7 +335,7 @@ it("renders ConnectModal correctly", () => { + (isOpen && isPushed ? "rgba(133, 133, 133, 0.1)" : "transparent")}; border-style: solid; - border-width: 1px; + border-width: 1px 0; `; const Accordion: React.FC = ({ @@ -37,6 +38,7 @@ const Accordion: React.FC = ({ initialOpenState = false, children, className, + isActive, }) => { const [isOpen, setIsOpen] = useState(initialOpenState); @@ -51,7 +53,7 @@ const Accordion: React.FC = ({ return ( - + {icon} {label} {isOpen ? : } diff --git a/src/widgets/Menu/components/PanelBody.tsx b/src/widgets/Menu/components/PanelBody.tsx index 9f268c836..aeedb1930 100644 --- a/src/widgets/Menu/components/PanelBody.tsx +++ b/src/widgets/Menu/components/PanelBody.tsx @@ -48,6 +48,7 @@ const PanelBody: React.FC = ({ isPushed, pushNav, isMobile, links }) => { label={entry.label} initialOpenState={initialOpenState} className={calloutClass} + isActive={entry.items.some((item) => item.href === location.pathname)} > {isPushed && entry.items.map((item) => ( diff --git a/src/widgets/Menu/config.ts b/src/widgets/Menu/config.ts index 703517018..fa7231bae 100644 --- a/src/widgets/Menu/config.ts +++ b/src/widgets/Menu/config.ts @@ -44,7 +44,7 @@ export const links = [ items: [ { label: "Leaderboard", - href: "/", + href: "/teams", }, { label: "YourProfile", diff --git a/src/widgets/Menu/index.stories.tsx b/src/widgets/Menu/index.stories.tsx index eecf849b5..af9a0168a 100644 --- a/src/widgets/Menu/index.stories.tsx +++ b/src/widgets/Menu/index.stories.tsx @@ -1,6 +1,6 @@ import React, { useEffect, useState } from "react"; import noop from "lodash/noop"; -import { BrowserRouter } from "react-router-dom"; +import { BrowserRouter, MemoryRouter } from "react-router-dom"; import Flex from "../../components/Box/Flex"; import Heading from "../../components/Heading/Heading"; import Text from "../../components/Text/Text"; @@ -211,3 +211,34 @@ export const MenuEntryComponent: React.FC = () => { ); }; + +export const WithSubmenuSelected: React.FC = () => { + return ( + + +
+ + Submenu leaderboard selected + +
+
+
+ ); +};