Skip to content

Commit

Permalink
add several modals for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
mauromiguelm committed Mar 20, 2024
1 parent 0402dc0 commit 048a7e0
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions inst/app/app-dev.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ ui <- fluidPage(
theme = bslib::bs_theme(version = 5L),
# add button
actionButton("show_wizard", "Show wizard"),
shiny::actionButton("run_shinyalert", "shinyalert"),
shiny::actionButton("run_shinywidgets", "shinywidgets"),
shiny::actionButton("run_modaldialog", "shiny::modaldialog"),
shiny::actionButton("run_bsutils", "bsutils"),
bsutils::modal("bsutils_modal", plotly_widget),
wizard(
modal = TRUE,
lock_start = TRUE,
Expand All @@ -25,6 +30,7 @@ ui <- fluidPage(
# add lock button
shiny::actionButton("lock_wizard", "Lock"),
shiny::actionButton("unlock_wizard", "unLock")

),
wizard_step(
step_title = "Numeric input",
Expand Down Expand Up @@ -106,6 +112,29 @@ server <- function(input, output, session) {
print("reset wizard")
wizardR::reset("my_modal")
})

observeEvent(input$run_shinyalert, {
shinyalert::shinyalert("Hello", "This is a shinyalert")
})

observeEvent(input$run_modaldialog, {
showModal(modalDialog(
title = "Important message",
"This is an important message!"
))
})

observeEvent(input$run_bsutils, {
bsutils::modal_show("bsutils_modal")
})

observeEvent(input$run_shinywidgets, {
shinyWidgets::show_alert(
title = "Success !!",
text = "All in order",
type = "success"
)
})
}

shinyApp(ui, server)

0 comments on commit 048a7e0

Please sign in to comment.