Skip to content

Commit

Permalink
dialog code connect
Browse files Browse the repository at this point in the history
  • Loading branch information
jake-figma committed Oct 2, 2024
1 parent c4a2034 commit 080563a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
1 change: 1 addition & 0 deletions figma.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"<FIGMA_CARDS_REVIEW_CARD>": "https://figma.com/design/J0KLPKXiONDRssXD1AX9Oi?node-id=2236-16106",
"<FIGMA_CARDS_STATS_CARD>": "https://figma.com/design/J0KLPKXiONDRssXD1AX9Oi?node-id=2236-15082",
"<FIGMA_CARDS_TESTIMONIAL_CARD>": "https://figma.com/design/J0KLPKXiONDRssXD1AX9Oi?node-id=7717-3946",
"<FIGMA_DIALOG_DIALOG>": "https://www.figma.com/design/J0KLPKXiONDRssXD1AX9Oi?node-id=192-31534",
"<FIGMA_DIALOG_DIALOG_BODY>": "https://figma.com/design/J0KLPKXiONDRssXD1AX9Oi?node-id=9762-696",
"<FIGMA_FORMS_FORM_CONTACT>": "https://figma.com/design/J0KLPKXiONDRssXD1AX9Oi?node-id=197:19741",
"<FIGMA_FORMS_FORM_FORGOT_PASSWORD>": "https://figma.com/design/J0KLPKXiONDRssXD1AX9Oi?node-id=197:19744",
Expand Down
24 changes: 21 additions & 3 deletions src/figma/primitives/Dialog.figma.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import figma from "@figma/code-connect";
import { Dialog, Text, TextHeading } from "primitives";
import {
Dialog,
DialogBody,
DialogClose,
DialogModal,
DialogTitle,
} from "primitives";

figma.connect(Dialog, "<FIGMA_DIALOG_DIALOG_BODY>", {
props: {
Expand All @@ -10,9 +16,21 @@ figma.connect(Dialog, "<FIGMA_DIALOG_DIALOG_BODY>", {
},
example: ({ heading, body, buttons, ...props }) => (
<Dialog {...props}>
<TextHeading>{heading}</TextHeading>
<Text>{body}</Text>
<DialogClose onPress={() => {}} />
<DialogTitle>{heading}</DialogTitle>
<DialogBody>{body}</DialogBody>
{buttons}
</Dialog>
),
});

figma.connect(Dialog, "<FIGMA_DIALOG_DIALOG>", {
props: {
children: figma.children("Dialog Body"),
},
example: ({ children }) => (
<DialogModal isDismissable isOpen={true} onOpenChange={() => {}}>
{children}
</DialogModal>
),
});

0 comments on commit 080563a

Please sign in to comment.