-
Notifications
You must be signed in to change notification settings - Fork 28
/
lightbox-dialog.tsx
38 lines (33 loc) · 997 Bytes
/
lightbox-dialog.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import React, { FC } from 'react'
import classNames from 'classnames'
import { DialogBaseProps, DialogBaseWithState } from '../ebay-dialog-base'
const classPrefix = 'lightbox-dialog'
type Mode = 'default' | 'mini'
type Size = 'wide' | 'narrow'
export type Props<T = any> = Omit<DialogBaseProps<T>, 'size'> & {
open?: boolean;
mode?: Mode;
size?: Size;
onClose?: () => void;
}
const EbayLightboxDialog: FC<Props> = ({
open,
mode,
size,
onClose = () => {},
...rest
}) => (
<DialogBaseWithState
buttonPosition="right"
{...rest}
classPrefix={classPrefix}
onCloseBtnClick={onClose}
onBackgroundClick={onClose}
className={classNames(rest.className, `${classPrefix}--mask-fade`, size && `${classPrefix}--${size}`)}
windowClass={classNames('lightbox-dialog__window--fade', {
[`${classPrefix}__window--mini`]: mode === 'mini'
})}
open={open}
/>
)
export default EbayLightboxDialog