Skip to content

Commit

Permalink
chore: update banner props to take all button props
Browse files Browse the repository at this point in the history
  • Loading branch information
drewlyton committed Sep 26, 2024
1 parent fa20161 commit f09b0dc
Showing 1 changed file with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
import {type ButtonMode, type ButtonTone, Card, type CardTone, Flex, Text} from '@sanity/ui'
import {Card, type CardTone, Flex, Text} from '@sanity/ui'
import {type ComponentType, type ElementType, type JSX, type ReactNode} from 'react'

import {Button} from '../../../../../ui-components'
import {Button, type ButtonProps} from '../../../../../ui-components'

interface BannerProps {
action?: {
as?: ElementType | keyof JSX.IntrinsicElements
icon?: ComponentType
onClick?: () => void
text: string
tone?: ButtonTone
mode?: ButtonMode
}
} & ButtonProps
content: ReactNode
icon?: ComponentType
tone?: CardTone
Expand All @@ -35,13 +33,7 @@ export function Banner(props: BannerProps) {
</Flex>

{action && (
<Button
as={action?.as}
mode={action.mode || 'ghost'}
onClick={action?.onClick}
text={action.text}
tone={action.tone || 'default'}
/>
<Button {...action} mode={action.mode || 'ghost'} tone={action.tone || 'default'} />
)}
</Flex>
</Card>
Expand Down

0 comments on commit f09b0dc

Please sign in to comment.