Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add size classname prop for modal #3674

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/ui/Modal/Modal.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React, { ReactElement } from 'react'
import ReactModal from 'react-modal'

import { cn } from 'shared/utils/cn'

import BaseModal from './BaseModal'

const modalSizes = Object.freeze({
Expand All @@ -16,6 +18,7 @@ export interface ModalProps {
hasCloseButton?: boolean
onClose: () => void
size?: 'medium' | 'small'
sizeClassname?: string
subtitle?: ReactElement | string
title: ReactElement | string
}
Expand All @@ -28,6 +31,7 @@ const Modal: React.FC<ModalProps> = ({
isOpen,
onClose,
size = 'medium',
sizeClassname,
subtitle,
title,
...rest
Expand All @@ -42,7 +46,7 @@ const Modal: React.FC<ModalProps> = ({
overlayClassName="fixed inset-0 bg-gray-900 bg-opacity-75 z-30"
{...rest}
>
<div className={modalSizes[size]}>
<div className={cn(modalSizes[size], sizeClassname)}>
<BaseModal
body={body}
customHeaderClassname={customHeaderClassname}
Expand Down
Loading