Skip to content

Commit

Permalink
feat: add width and height props to ConfirmModal
Browse files Browse the repository at this point in the history
  • Loading branch information
stropitek authored and targos committed Oct 10, 2022
1 parent a3308fb commit 792cfe7
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/components/ConfirmModal.tsx
Expand Up @@ -5,18 +5,23 @@ import { Button } from '.';
interface ConfirmModalProps {
children: ReactNode;
isOpen: boolean;

onConfirm: () => void;
onCancel: () => void;

saveText?: string;
cancelText?: string;

headerColor: string;
width?: number;
height?: number;
}

export function ConfirmModal(props: ConfirmModalProps) {
const { saveText = 'Save', cancelText = 'Cancel', headerColor } = props;
const {
saveText = 'Save',
cancelText = 'Cancel',
headerColor,
width,
height,
} = props;

if (!props.isOpen) {
return null;
Expand All @@ -37,8 +42,8 @@ export function ConfirmModal(props: ConfirmModalProps) {
<div
style={{
backgroundColor: 'white',
width: '40%',
height: 'max-content',
width: width || '400px',
height: height || 'max-content',
margin: 'auto',
top: 0,
left: 0,
Expand Down

0 comments on commit 792cfe7

Please sign in to comment.