Skip to content

Commit 9c9e832

Browse files
authored
Merge pull request #11903 from ethereum/nx-rm-show-hide
Refactor Show/Hide component usage in layouts
2 parents e7b9117 + 28a429f commit 9c9e832

File tree

6 files changed

+21
-37
lines changed

6 files changed

+21
-37
lines changed

src/components/MdComponents.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ export const MobileButton = (props: ChildOnlyProp) => {
234234
const borderColor = useToken("colors", "border")
235235
return (
236236
<Box
237+
hideFrom="lg"
237238
bg="background.base"
238239
boxShadow={`0 -1px 0 ${borderColor}`}
239240
position="sticky"

src/layouts/Roadmap.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import {
22
Box,
33
Center,
44
Flex,
5-
Show,
65
SimpleGrid,
76
useToken,
87
Wrap,
@@ -199,11 +198,9 @@ export const RoadmapLayout: React.FC<IProps> = ({
199198
{children}
200199
<FeedbackCard />
201200
</ContentContainer>
202-
<Show below="lg">
203-
<MobileButton>
204-
<MobileButtonDropdown list={dropdownLinks} />
205-
</MobileButton>
206-
</Show>
201+
<MobileButton>
202+
<MobileButtonDropdown list={dropdownLinks} />
203+
</MobileButton>
207204
</Page>
208205
</Box>
209206
)

src/layouts/Staking.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
Flex,
77
Grid,
88
type HeadingProps,
9-
Show,
109
SimpleGrid,
1110
Text,
1211
UnorderedList,
@@ -292,12 +291,9 @@ export const StakingLayout: React.FC<IProps> = ({
292291
<StakingCommunityCallout my={16} />
293292
<FeedbackCard />
294293
</ContentContainer>
295-
{/* // TODO: Switch to `above="lg"` after completion of Chakra Migration */}
296-
<Show below={lgBp}>
297-
<MobileButton>
298-
<MobileButtonDropdown list={dropdownLinks} />
299-
</MobileButton>
300-
</Show>
294+
<MobileButton>
295+
<MobileButtonDropdown list={dropdownLinks} />
296+
</MobileButton>
301297
</Page>
302298
</Box>
303299
)

src/layouts/Upgrade.tsx

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
Icon,
99
List,
1010
ListItem,
11-
Show,
1211
Text,
1312
useToken,
1413
} from "@chakra-ui/react"
@@ -75,6 +74,7 @@ const HeroContainer = (props: ChildOnlyProp) => (
7574

7675
const MoreContent = (props: ChildOnlyProp & { to: string }) => (
7776
<Flex
77+
hideBelow="lg"
7878
as={BaseLink}
7979
bg="ednBackground"
8080
justify="center"
@@ -205,11 +205,9 @@ export const UpgradeLayout: React.FC<IProps> = ({
205205
/>
206206
)}
207207
</HeroContainer>
208-
<Show above={lgBreakpoint}>
209-
<MoreContent to={"#" + MAIN_CONTENT_ID}>
210-
<Icon as={MdExpandMore} fontSize="2xl" color="secondary" />
211-
</MoreContent>
212-
</Show>
208+
<MoreContent to={"#" + MAIN_CONTENT_ID}>
209+
<Icon as={MdExpandMore} fontSize="2xl" color="secondary" />
210+
</MoreContent>
213211
<Page>
214212
{/* TODO: Switch to `above="lg"` after completion of Chakra Migration */}
215213
<LeftNavBar
@@ -222,11 +220,9 @@ export const UpgradeLayout: React.FC<IProps> = ({
222220
{children}
223221
<FeedbackCard />
224222
</ContentContainer>
225-
<Show below={lgBreakpoint}>
226-
<MobileButton>
227-
<MobileButtonDropdown list={dropdownLinks} />
228-
</MobileButton>
229-
</Show>
223+
<MobileButton>
224+
<MobileButtonDropdown list={dropdownLinks} />
225+
</MobileButton>
230226
</Page>
231227
</Container>
232228
)

src/layouts/UseCases.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { MdExpandMore } from "react-icons/md"
44
import {
55
Box,
66
Flex,
7-
Hide,
87
Icon,
98
ListItem,
109
Text,
@@ -256,11 +255,9 @@ export const UseCasesLayout: React.FC<IProps> = ({
256255
{children}
257256
<FeedbackCard />
258257
</ContentContainer>
259-
<Hide above={lgBp}>
260-
<MobileButton>
261-
<MobileButtonDropdown list={dropdownLinks} />
262-
</MobileButton>
263-
</Hide>
258+
<MobileButton>
259+
<MobileButtonDropdown list={dropdownLinks} />
260+
</MobileButton>
264261
</Page>
265262
</Box>
266263
)

src/pages/staking/index.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ReactNode } from "react"
22
import { GetStaticProps, InferGetStaticPropsType } from "next"
33
import { useTranslation } from "next-i18next"
44
import { serverSideTranslations } from "next-i18next/serverSideTranslations"
5-
import { Box, Flex, Grid, HeadingProps, Show, useToken } from "@chakra-ui/react"
5+
import { Box, Flex, Grid, HeadingProps, useToken } from "@chakra-ui/react"
66

77
import type {
88
BasePageProps,
@@ -742,12 +742,9 @@ const StakingPage = ({
742742
</Box>
743743
</Flex>
744744
</ContentContainer>
745-
{/* // TODO: Switch to `above="lg"` after completion of Chakra Migration */}
746-
<Show below={lgBp}>
747-
<MobileButton>
748-
<MobileButtonDropdown list={dropdownLinks} />
749-
</MobileButton>
750-
</Show>
745+
<MobileButton>
746+
<MobileButtonDropdown list={dropdownLinks} />
747+
</MobileButton>
751748
</Page>
752749
</PageContainer>
753750
)

0 commit comments

Comments
 (0)