Skip to content

Commit e907c15

Browse files
committed
Cleanup
1 parent c33361b commit e907c15

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

src/Dialog/Dialog.tsx

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {get} from '../constants'
77
import {useOnEscapePress, useProvidedRefOrCreate} from '../hooks'
88
import {useFocusTrap} from '../hooks/useFocusTrap'
99
import sx, {SxProp} from '../sx'
10+
import {defaultSxProp} from '../utils/defaultSxProp'
1011
import {XIcon} from '@primer/octicons-react'
1112
import {useFocusZone} from '../hooks/useFocusZone'
1213
import {FocusKeys} from '@primer/behaviors'
@@ -40,23 +41,12 @@ export type DialogButtonProps = Omit<ButtonProps, 'content'> & {
4041
*/
4142
autoFocus?: boolean
4243

43-
/**
44-
* The HTML element to use.
45-
*/
46-
as?: 'button' | 'a'
47-
48-
/**
49-
* The URL to link to if this is a link (a) button.
50-
*/
51-
href?: string
52-
5344
/**
5445
* A reference to the rendered Button’s DOM node, used together with
5546
* `autoFocus` for `focusTrap`’s `initialFocus`.
5647
*/
5748
ref?: React.RefObject<HTMLButtonElement>
58-
} & SxProp &
59-
React.ButtonHTMLAttributes<HTMLButtonElement>
49+
}
6050

6151
/**
6252
* Props to customize the rendering of the Dialog.
@@ -411,12 +401,12 @@ const Buttons: React.FC<React.PropsWithChildren<{buttons: DialogButtonProps[]}>>
411401
return (
412402
<>
413403
{buttons.map((dialogButtonProps, index) => {
414-
const {content, buttonType = 'normal', autoFocus = false, ...buttonProps} = dialogButtonProps
404+
const {content, buttonType = 'normal', autoFocus = false, ...rest} = dialogButtonProps
415405
return (
416406
<Button
417407
key={index}
418408
variant={buttonType === 'normal' ? 'default' : buttonType}
419-
{...buttonProps}
409+
{...rest}
420410
ref={autoFocus && autoFocusCount === 0 ? (autoFocusCount++, autoFocusRef) : null}
421411
>
422412
{content}

0 commit comments

Comments
 (0)