Skip to content

Commit bb7e72e

Browse files
committed
remove mobile buttondropdown components from mdcomponents and create its own file
1 parent cdacf94 commit bb7e72e

File tree

5 files changed

+18
-76
lines changed

5 files changed

+18
-76
lines changed

src/components/MdComponents/MdComponents.stories.tsx

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -68,55 +68,3 @@ export const MdComponents: StoryObj = {
6868
</div>
6969
),
7070
}
71-
72-
// const roadmapDropdownLinks: ButtonDropdownList = {
73-
// text: "nav-roadmap-options",
74-
// ariaLabel: "nav-roadmap-options-alt",
75-
// items: [
76-
// {
77-
// text: "nav-roadmap-home",
78-
// href: "/roadmap/",
79-
// matomo: {
80-
// eventCategory: `Roadmap dropdown`,
81-
// eventAction: `Clicked`,
82-
// eventName: "clicked roadmap home",
83-
// },
84-
// },
85-
// {
86-
// text: "nav-roadmap-security",
87-
// href: "/roadmap/security",
88-
// matomo: {
89-
// eventCategory: `Roadmap security dropdown`,
90-
// eventAction: `Clicked`,
91-
// eventName: "clicked roadmap security",
92-
// },
93-
// },
94-
// {
95-
// text: "nav-roadmap-scaling",
96-
// href: "/roadmap/scaling",
97-
// matomo: {
98-
// eventCategory: `Roadmap scaling dropdown`,
99-
// eventAction: `Clicked`,
100-
// eventName: "clicked roadmap scaling home",
101-
// },
102-
// },
103-
// {
104-
// text: "nav-roadmap-user-experience",
105-
// href: "/roadmap/user-experience/",
106-
// matomo: {
107-
// eventCategory: `Roadmap user experience dropdown`,
108-
// eventAction: `Clicked`,
109-
// eventName: "clicked roadmap user experience home",
110-
// },
111-
// },
112-
// {
113-
// text: "nav-roadmap-future-proofing",
114-
// href: "/roadmap/future-proofing",
115-
// matomo: {
116-
// eventCategory: `Roadmap future-proofing dropdown`,
117-
// eventAction: `Clicked`,
118-
// eventName: "clicked roadmap future-proofing home",
119-
// },
120-
// },
121-
// ],
122-
// }

src/components/MdComponents/index.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -152,15 +152,6 @@ export const ContentContainer = (props: Pick<BoxProps, "id" | "children">) => {
152152
)
153153
}
154154

155-
export const MobileButton = (props: ChildOnlyProp) => {
156-
return (
157-
<div
158-
className="sticky bottom-0 z-sticky w-full bg-background p-8 shadow-md lg:hidden"
159-
{...props}
160-
/>
161-
)
162-
}
163-
164155
// All custom React components
165156
export const reactComponents = {
166157
Badge,
@@ -176,7 +167,6 @@ export const reactComponents = {
176167
FeaturedText,
177168
GlossaryTooltip,
178169
InfoBanner,
179-
MobileButton,
180170
Page,
181171
QuizWidget: StandaloneQuizWidget,
182172
IssuesList,
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import ButtonDropdown, { type ButtonDropdownProps } from "./ButtonDropdown"
2+
3+
const MobileButtonDropdown = (props: ButtonDropdownProps) => {
4+
return (
5+
<div className="sticky bottom-0 z-sticky w-full bg-background p-8 shadow-md lg:hidden">
6+
<ButtonDropdown {...props} className="w-full lg:w-auto" />
7+
</div>
8+
)
9+
}
10+
11+
export default MobileButtonDropdown

src/layouts/ContentLayout.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import type { HTMLAttributes } from "react"
22

3-
import ButtonDropdown from "@/components/ButtonDropdown"
43
import FeedbackCard from "@/components/FeedbackCard"
54
import LeftNavBar, { LeftNavBarProps } from "@/components/LeftNavBar"
6-
import { ContentContainer, MobileButton, Page } from "@/components/MdComponents"
5+
import { ContentContainer, Page } from "@/components/MdComponents"
6+
import MobileButtonDropdown from "@/components/MobileButtonDropdown"
77

88
type ContentLayoutProps = HTMLAttributes<HTMLDivElement> &
99
Pick<LeftNavBarProps, "dropdownLinks" | "tocItems" | "maxDepth"> & {
@@ -36,11 +36,7 @@ export const ContentLayout = ({
3636
<FeedbackCard />
3737
</ContentContainer>
3838

39-
{dropdownLinks && (
40-
<MobileButton>
41-
<ButtonDropdown list={dropdownLinks} className="w-full lg:w-auto" />
42-
</MobileButton>
43-
)}
39+
{dropdownLinks && <MobileButtonDropdown list={dropdownLinks} />}
4440
</Page>
4541
</div>
4642
)

src/pages/staking/index.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,16 @@ import type {
1212
StakingStatsData,
1313
} from "@/lib/types"
1414

15-
import ButtonDropdown, {
16-
List as ButtonDropdownList,
17-
} from "@/components/ButtonDropdown"
15+
import { List as ButtonDropdownList } from "@/components/ButtonDropdown"
1816
import ButtonLink, {
1917
type ButtonLinkProps,
2018
} from "@/components/Buttons/ButtonLink"
2119
import Card from "@/components/Card"
2220
import ExpandableCard from "@/components/ExpandableCard"
2321
import FeedbackCard from "@/components/FeedbackCard"
2422
import LeftNavBar from "@/components/LeftNavBar"
25-
import { ContentContainer, MobileButton, Page } from "@/components/MdComponents"
23+
import { ContentContainer, Page } from "@/components/MdComponents"
24+
import MobileButtonDropdown from "@/components/MobileButtonDropdown"
2625
import PageHero from "@/components/PageHero"
2726
import PageMetadata from "@/components/PageMetadata"
2827
import StakingCommunityCallout from "@/components/Staking/StakingCommunityCallout"
@@ -629,9 +628,7 @@ const StakingPage = ({
629628
</div>
630629
</Flex>
631630
</ContentContainer>
632-
<MobileButton>
633-
<ButtonDropdown list={dropdownLinks} className="w-full lg:w-auto" />
634-
</MobileButton>
631+
<MobileButtonDropdown list={dropdownLinks} />
635632
</Page>
636633
</PageContainer>
637634
)

0 commit comments

Comments
 (0)