Skip to content

Commit 43ea060

Browse files
committed
Removed some unnecessary code
1 parent d3b5213 commit 43ea060

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

src/ui/Dialog/index.js

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,6 @@ export function Dialog ({ isOpen, title, className, persistent, width, height, d
4949
}
5050
})
5151

52-
const dialogStyle = useMemo(() => {
53-
const _s = {}
54-
if (!draggable) {
55-
_s.width = width || '100%'
56-
_s.height = height || '100%'
57-
} else {
58-
_s.width = '100%'
59-
_s.height = '100%'
60-
}
61-
62-
return _s
63-
}, [draggable, width, height])
64-
6552
const dialogClasses = useMemo(() => {
6653
let classes = 'dialog'
6754
if (isDragging) classes += ' dialog-no-select'
@@ -109,10 +96,10 @@ export function Dialog ({ isOpen, title, className, persistent, width, height, d
10996
aria-label='dialog'
11097
aria-modal='true'
11198
role='dialog'
112-
style={dialogStyle}
99+
style={style}
113100
onMouseDown={() => { setClickStartedInsideDialog(true) }}
114101
>
115-
<div className='dialog-drag-area' onMouseDown={() => setIsDragging(true)} />
102+
{ draggable && <div className='dialog-drag-area' onMouseDown={() => setIsDragging(true)} /> }
116103
{!persistent && showCloseButton &&
117104
<button className='dialog-close-btn' onClick={(e) => { handleCloseBtnClick(); e.preventDefault() }} aria-label='Lukk'>
118105
<CloseIcon alt='' />

0 commit comments

Comments
 (0)