Skip to content

Commit

Permalink
Merge pull request #1055 from liftM/fluent-button-with-confirm
Browse files Browse the repository at this point in the history
Add fluent `WithConfirm` for `ButtonBlockElement`s
  • Loading branch information
kanata2 committed Apr 16, 2022
2 parents 93035c9 + 2473ad3 commit 27b91d9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions block_element.go
Expand Up @@ -167,6 +167,12 @@ func (s *ButtonBlockElement) WithStyle(style Style) *ButtonBlockElement {
return s
}

// WithConfirm adds a confirmation dialogue to the button object and returns the modified ButtonBlockElement
func (s *ButtonBlockElement) WithConfirm(confirm *ConfirmationBlockObject) *ButtonBlockElement {
s.Confirm = confirm
return s
}

// NewButtonBlockElement returns an instance of a new button element to be used within a block
func NewButtonBlockElement(actionID, value string, text *TextBlockObject) *ButtonBlockElement {
return &ButtonBlockElement{
Expand Down

0 comments on commit 27b91d9

Please sign in to comment.