Skip to content

Commit 4b05663

Browse files
authored
Merge pull request #7978 from Master7130/section-nav-refactor
SectionNav refactor to ChakraUI
2 parents c8a2d4f + 2cd0aba commit 4b05663

File tree

1 file changed

+27
-37
lines changed

1 file changed

+27
-37
lines changed

src/components/SectionNav.tsx

Lines changed: 27 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,40 @@
11
import React from "react"
2-
import styled from "@emotion/styled"
3-
4-
import Emoji from "./OldEmoji"
2+
import { Flex, Heading } from "@chakra-ui/react"
3+
import Emoji from "./Emoji"
54
import Translation from "./Translation"
65

7-
const Card = styled.div`
8-
display: flex;
9-
flex-direction: column;
10-
color: ${(props) => props.theme.colors.textTableOfContents};
11-
margin-top: 3rem;
12-
justify-content: space-between;
13-
background: ${(props) => props.theme.colors.searchBackground};
14-
border-radius: 4px;
15-
border: 1px solid ${(props) => props.theme.colors.lightBorder};
16-
padding: 1.5rem;
17-
padding-bottom: 0rem;
18-
`
19-
20-
const Title = styled.h2`
21-
font-size: 1rem;
22-
line-height: 140%;
23-
letter-spacing: 0.04em;
24-
margin-left: 1.5rem;
25-
text-transform: uppercase;
26-
color: ${(props) => props.theme.colors.textTableOfContents};
27-
`
28-
29-
const TopContent = styled.div`
30-
display: flex;
31-
align-items: flex-start;
32-
`
33-
346
export interface IProps {
357
children?: React.ReactNode
368
}
379

3810
const SectionNav: React.FC<IProps> = ({ children }) => (
39-
<Card>
40-
<TopContent>
41-
<Emoji text=":point_right:" mb={`1em`} />
42-
<Title>
11+
<Flex
12+
direction="column"
13+
color="textTableOfContents"
14+
marginTop={12}
15+
justify="space-between"
16+
background="searchBackground"
17+
borderRadius="base"
18+
border="1px solid"
19+
borderColor="lightBorder"
20+
padding={6}
21+
paddingBottom={0}
22+
>
23+
<Flex align="flex-start">
24+
<Emoji text=":point_right:" mb={4} />
25+
<Heading
26+
as="h2"
27+
fontSize="md"
28+
lineHeight={7 / 5}
29+
letterSpacing="wider"
30+
marginLeft={6}
31+
textTransform="uppercase"
32+
>
4333
<Translation id="in-this-section" />
44-
</Title>
45-
</TopContent>
34+
</Heading>
35+
</Flex>
4636
{children}
47-
</Card>
37+
</Flex>
4838
)
4939

5040
export default SectionNav

0 commit comments

Comments
 (0)