-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathpanel-dialog.tsx
40 lines (35 loc) · 1.02 KB
/
panel-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
39
40
import React, { FC } from 'react'
import classNames from 'classnames'
import { DialogBaseProps, DialogBaseWithState } from '../ebay-dialog-base'
const classPrefix = 'panel-dialog'
type Position = 'start' | 'end'
export interface Props<T = any> extends DialogBaseProps<T> {
open?: boolean;
animated?: boolean;
position?: Position;
onClose?: () => void;
}
const EbayPanelDialog: FC<Props> = ({
open,
animated,
position = 'start',
onClose = () => {},
className,
...rest
}) => (
<DialogBaseWithState
{...rest}
aria-label="Infotip"
classPrefix={classPrefix}
buttonPosition="right"
onCloseBtnClick={onClose}
onBackgroundClick={onClose}
animated={animated}
className={classNames(className, { [`${classPrefix}--mask-fade-slow`]: animated })}
windowClass={classNames(`${classPrefix}__window--slide`, {
[`${classPrefix}__window--end`]: position === 'end'
})}
open={open}
/>
)
export default EbayPanelDialog