From f91f16a0f87cba54087887931adee1c3c48df707 Mon Sep 17 00:00:00 2001 From: joffrey-bion Date: Sun, 29 Nov 2020 15:39:42 +0100 Subject: Add support for Icon intent in bpDialog --- sw-ui/src/main/kotlin/com/palantir/blueprintjs/BpDialog.kt | 2 +- .../src/main/kotlin/com/palantir/blueprintjs/blueprintjsHelpers.kt | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'sw-ui/src/main/kotlin/com/palantir/blueprintjs') diff --git a/sw-ui/src/main/kotlin/com/palantir/blueprintjs/BpDialog.kt b/sw-ui/src/main/kotlin/com/palantir/blueprintjs/BpDialog.kt index ed95b8ab..1db018dd 100644 --- a/sw-ui/src/main/kotlin/com/palantir/blueprintjs/BpDialog.kt +++ b/sw-ui/src/main/kotlin/com/palantir/blueprintjs/BpDialog.kt @@ -17,7 +17,7 @@ external interface IDialogProps : IOverlayableProps, IBackdropProps, IProps { * dialog's header. Note that the header will only be rendered if `title` is * provided. */ - var icon: IconName? + var icon: dynamic /* IconName? | ReactElement? */ /** * Whether to show the close button in the dialog's header. * Note that the header will only be rendered if `title` is provided. diff --git a/sw-ui/src/main/kotlin/com/palantir/blueprintjs/blueprintjsHelpers.kt b/sw-ui/src/main/kotlin/com/palantir/blueprintjs/blueprintjsHelpers.kt index 0bd126fd..347e2170 100644 --- a/sw-ui/src/main/kotlin/com/palantir/blueprintjs/blueprintjsHelpers.kt +++ b/sw-ui/src/main/kotlin/com/palantir/blueprintjs/blueprintjsHelpers.kt @@ -158,7 +158,7 @@ fun RBuilder.bpOverlay( fun RBuilder.bpDialog( isOpen: Boolean, title: ReactElement? = null, - icon: IconName? = null, + icon: ReactElement? = null, autoFocus: Boolean = true, enforceFocus: Boolean = true, usePortal: Boolean = true, @@ -195,8 +195,9 @@ fun RBuilder.bpDialog( fun RBuilder.bpDialog( isOpen: Boolean, - title: String? = null, + title: String?, icon: IconName? = null, + iconIntent: Intent = Intent.NONE, autoFocus: Boolean = true, enforceFocus: Boolean = true, usePortal: Boolean = true, @@ -210,7 +211,7 @@ fun RBuilder.bpDialog( ): ReactElement = bpDialog( isOpen = isOpen, title = title?.let { buildElement { +title } }, - icon = icon, + icon = icon?.let { buildElement { bpIcon(name = icon, intent = iconIntent) } }, autoFocus = autoFocus, enforceFocus = enforceFocus, usePortal = usePortal, -- cgit