Skip to content

Commit 902f28c

Browse files
refactor(pages/developers/tutorials): migrate to dialog-modal
1 parent 66a0516 commit 902f28c

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/pages/developers/tutorials.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ import Emoji from "@/components/Emoji"
2121
import FeedbackCard from "@/components/FeedbackCard"
2222
import InlineLink, { BaseLink } from "@/components/Link"
2323
import MainArticle from "@/components/MainArticle"
24-
import Modal from "@/components/Modal"
2524
import OldHeading from "@/components/OldHeading"
2625
import Text from "@/components/OldText"
2726
import PageMetadata from "@/components/PageMetadata"
2827
import Translation from "@/components/Translation"
2928
import { getSkillTranslationId, Skill } from "@/components/TutorialMetadata"
3029
import TutorialTags from "@/components/TutorialTags"
30+
import Modal from "@/components/ui/dialog-modal"
3131

3232
import { existsNamespace } from "@/lib/utils/existsNamespace"
3333
import { getLastDeployDate } from "@/lib/utils/getLastDeployDate"
@@ -42,6 +42,7 @@ import {
4242

4343
import externalTutorials from "@/data/externalTutorials.json"
4444

45+
import { useBreakpointValue } from "@/hooks/useBreakpointValue"
4546
import { useRtlFlip } from "@/hooks/useRtlFlip"
4647

4748
const FilterTag = forwardRef<{ isActive: boolean; name: string }, "button">(
@@ -205,6 +206,8 @@ const TutorialPage = ({
205206
}
206207

207208
const dir = contentNotTranslated ? "ltr" : "unset"
209+
210+
const modalSize = useBreakpointValue({ base: "xl", md: "md" } as const)
208211
return (
209212
<Flex
210213
as={MainArticle}
@@ -248,9 +251,9 @@ const TutorialPage = ({
248251
</Text>
249252

250253
<Modal
251-
isOpen={isModalOpen}
252-
onClose={() => setModalOpen(false)}
253-
size={{ base: "full", md: "xl" }}
254+
open={isModalOpen}
255+
onOpenChange={(open) => setModalOpen(open)}
256+
size={modalSize}
254257
contentProps={{ dir }}
255258
title={
256259
<Translation id="page-developers-tutorials:page-tutorial-submit-btn" />

0 commit comments

Comments
 (0)