Skip to content

Commit 22c7d02

Browse files
committed
reuse base modal on the tutorials & docs pages
1 parent 05ce8a7 commit 22c7d02

File tree

3 files changed

+21
-34
lines changed

3 files changed

+21
-34
lines changed

src/components/FileContributors.tsx

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ import {
44
Avatar,
55
Flex,
66
FlexProps,
7-
Heading,
87
ListItem,
9-
ModalBody,
10-
ModalHeader,
118
Skeleton as ChakraSkeleton,
129
SkeletonCircle as ChakraSkeletonCircle,
1310
UnorderedList,
@@ -43,7 +40,7 @@ const SkeletonCircle = (props) => (
4340

4441
const ContributorList = ({ children }: { children: React.ReactNode }) => {
4542
return (
46-
<UnorderedList maxH="2xs" m={0} mt={6} overflowY="scroll">
43+
<UnorderedList m={0} mt={6}>
4744
{children}
4845
</UnorderedList>
4946
)
@@ -102,26 +99,20 @@ const FileContributors = ({
10299

103100
return (
104101
<>
105-
<Modal isOpen={isModalOpen} setIsOpen={setModalOpen}>
106-
<ModalHeader py={0}>
107-
<Heading m={0}>
108-
<Translation id="contributors" />
109-
</Heading>
110-
</ModalHeader>
111-
112-
<ModalBody>
113-
<Translation id="contributors-thanks" />
114-
{contributors ? (
115-
<ContributorList>
116-
{contributors.map((contributor) => (
117-
<Contributor
118-
contributor={contributor}
119-
key={contributor.email}
120-
/>
121-
))}
122-
</ContributorList>
123-
) : null}
124-
</ModalBody>
102+
<Modal
103+
isOpen={isModalOpen}
104+
onClose={() => setModalOpen(false)}
105+
size={{ base: "full", md: "xl" }}
106+
title={<Translation id="contributors" />}
107+
>
108+
<Translation id="contributors-thanks" />
109+
{contributors ? (
110+
<ContributorList>
111+
{contributors.map((contributor) => (
112+
<Contributor contributor={contributor} key={contributor.email} />
113+
))}
114+
</ContributorList>
115+
) : null}
125116
</Modal>
126117

127118
<Flex

src/components/Modal/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414

1515
export type ModalProps = ChakraModalProps & {
1616
children?: React.ReactNode
17-
title?: string
17+
title?: React.ReactNode
1818
actionButtonLabel?: string
1919
contentProps?: ModalContentProps
2020
}

src/pages/developers/tutorials.tsx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -245,12 +245,12 @@ const TutorialPage = ({
245245
<Modal
246246
isOpen={isModalOpen}
247247
onClose={() => setModalOpen(false)}
248-
size="xl"
248+
size={{ base: "full", md: "xl" }}
249249
contentProps={{ dir }}
250-
>
251-
<Heading fontSize="2rem" lineHeight="1.4" mb={4}>
250+
title={
252251
<Translation id="page-developers-tutorials:page-tutorial-submit-btn" />
253-
</Heading>
252+
}
253+
>
254254
<Text>
255255
<Translation id="page-developers-tutorials:page-tutorial-listing-policy-intro" />{" "}
256256
<InlineLink href="/contributing/content-resources/">
@@ -260,11 +260,7 @@ const TutorialPage = ({
260260
<Text>
261261
<Translation id="page-developers-tutorials:page-tutorial-submit-tutorial" />
262262
</Text>
263-
<Flex
264-
flexDirection={{ base: "column", md: "initial" }}
265-
maxH={{ base: 64, md: "initial" }}
266-
overflowY={{ base: "scroll", md: "initial" }}
267-
>
263+
<Flex flexDirection={{ base: "column", md: "initial" }}>
268264
<Flex
269265
borderWidth="1px"
270266
borderStyle="solid"

0 commit comments

Comments
 (0)