Skip to content

Commit

Permalink
refactor(sanity): simplify IntentButton prop types
Browse files Browse the repository at this point in the history
  • Loading branch information
mariuslundgard committed Oct 4, 2022
1 parent b751525 commit f8ed855
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions packages/sanity/src/core/components/IntentButton.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import React, {ComponentProps} from 'react'
import {Button} from '@sanity/ui'
import {IntentLink} from '../../router'
import {Button, ButtonProps} from '@sanity/ui'
import React, {HTMLProps} from 'react'
import {IntentLink, IntentLinkProps} from '../../router'

/**
* @beta
*/
export function IntentButton(
props: Omit<ComponentProps<typeof Button> & ComponentProps<typeof IntentLink>, 'as' | 'href'> & {
intent: string
params: Record<string, unknown> | [Record<string, unknown>, Record<string, unknown>]
}
props: IntentLinkProps & ButtonProps & Omit<HTMLProps<HTMLButtonElement>, 'as' | 'href' | 'ref'>
) {
return props.disabled ? (
<Button {...props} as="a" role="link" aria-disabled="true" />
Expand Down

0 comments on commit f8ed855

Please sign in to comment.