From 2a21226f8268589b9b323243234c5f6a7ddf44a8 Mon Sep 17 00:00:00 2001 From: Vineeth Asok Kumar Date: Sun, 22 Oct 2023 15:58:46 +0200 Subject: [PATCH] Add Dialog to components (#185) * Add Dialog to components * Add option to showOverlay --- src/components/Dialog/Dialog.tsx | 14 ++++++-------- src/components/index.ts | 1 + src/components/types.ts | 2 ++ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/components/Dialog/Dialog.tsx b/src/components/Dialog/Dialog.tsx index eb8c36b7..aef487de 100644 --- a/src/components/Dialog/Dialog.tsx +++ b/src/components/Dialog/Dialog.tsx @@ -1,4 +1,4 @@ -import React, { ReactNode } from "react"; +import { ReactNode } from "react"; import * as RadixDialog from "@radix-ui/react-dialog"; import styled, { keyframes } from "styled-components"; import { Button, Icon, Spacer, Title } from "@/components"; @@ -16,11 +16,7 @@ const Trigger = styled(RadixDialog.Trigger)` cursor: pointer; `; -interface DialogTriggerProps extends RadixDialog.DialogTriggerProps { - children: React.ReactNode; -} - -const DialogTrigger = ({ children, ...props }: DialogTriggerProps) => { +const DialogTrigger = ({ children, ...props }: RadixDialog.DialogTriggerProps) => { return {children}; }; @@ -100,13 +96,14 @@ const CloseButton = ({ onClose }: { onClose?: () => void }) => ( ); -interface DialogContentProps extends RadixDialog.DialogContentProps { +export interface DialogContentProps extends RadixDialog.DialogContentProps { title: string; showClose?: boolean; forceMount?: true; container?: HTMLElement | null; children: ReactNode; onClose?: () => void; + showOverlay?: boolean; } const DialogContent = ({ @@ -116,13 +113,14 @@ const DialogContent = ({ onClose, forceMount, container, + showOverlay = true, }: DialogContentProps) => { return ( - + {showOverlay && }