diff --git a/R/tm_landing_popup.R b/R/tm_landing_popup.R index e73d9ba6db..aced5f0c21 100644 --- a/R/tm_landing_popup.R +++ b/R/tm_landing_popup.R @@ -54,6 +54,29 @@ #' shinyApp(app2$ui, app2$server) #' } #' +#' app3 <- teal::init( +#' data = teal.data::dataset("iris", iris), +#' modules = teal::modules( +#' teal::tm_landing_popup( +#' title = "Welcome", +#' content = "App will close, once you click the rejection button!", +#' buttons = tagList( +#' modalButton("Proceed"), +#' actionButton("close", "Reject", onclick = "window.close()") +#' ) +#' ), +#' module( +#' label = "example module", +#' server = function(input, output, session, data) {}, +#' ui = function(id, ...) div(p("Example text")) +#' ) +#' ) +#' ) +#' +#' if (interactive()) { +#' shinyApp(app3$ui, app3$server, options = list(launch.browser = TRUE)) +#' } +#' #' @export tm_landing_popup <- function(label = "Landing Popup", diff --git a/man/tm_landing_popup.Rd b/man/tm_landing_popup.Rd index 1379ee441c..33befd92d9 100644 --- a/man/tm_landing_popup.Rd +++ b/man/tm_landing_popup.Rd @@ -72,4 +72,27 @@ if (interactive()) { shinyApp(app2$ui, app2$server) } +app3 <- teal::init( + data = teal.data::dataset("iris", iris), + modules = teal::modules( + teal::tm_landing_popup( + title = "Welcome", + content = "App will close, once you click the rejection button!", + buttons = tagList( + modalButton("Proceed"), + actionButton("close", "Reject", onclick = "window.close()") + ) + ), + module( + label = "example module", + server = function(input, output, session, data) {}, + ui = function(id, ...) div(p("Example text")) + ) + ) +) + +if (interactive()) { + shinyApp(app3$ui, app3$server, options = list(launch.browser = TRUE)) +} + }