diff --git a/NAMESPACE b/NAMESPACE index 3cc6fb856..814e6e12f 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -10,6 +10,7 @@ S3method(create_sparklines,logical) S3method(create_sparklines,numeric) export(add_facet_labels) export(get_scatterplotmatrix_stats) +export(landing_popup) export(tm_a_pca) export(tm_a_regression) export(tm_data_table) diff --git a/R/tm_landing_popup.R b/R/tm_landing_popup.R index 267438a26..7219acc33 100644 --- a/R/tm_landing_popup.R +++ b/R/tm_landing_popup.R @@ -92,3 +92,23 @@ srv_landing_popup <- function(id, title, content, buttons) { ui_landing_popup <- function(id, ...) { NULL } + +#' @rdname tm_landing_popup +#' @export +landing_popup <- function(title = NULL, content = NULL, buttons = modalButton("Accept")) { + checkmate::assert_string(title, null.ok = TRUE) + checkmate::assert_multi_class( + content, + classes = c("character", "shiny.tag", "shiny.tag.list", "html"), null.ok = TRUE + ) + checkmate::assert_multi_class(buttons, classes = c("shiny.tag", "shiny.tag.list"), null.ok = TRUE) + + showModal( + modalDialog( + id = "landingpopup", + title = title, + content, + footer = buttons + ) + ) +} diff --git a/man/tm_landing_popup.Rd b/man/tm_landing_popup.Rd index 6530aa0e6..79e9f4565 100644 --- a/man/tm_landing_popup.Rd +++ b/man/tm_landing_popup.Rd @@ -2,6 +2,7 @@ % Please edit documentation in R/tm_landing_popup.R \name{tm_landing_popup} \alias{tm_landing_popup} +\alias{landing_popup} \title{Landing Popup Module} \usage{ tm_landing_popup( @@ -10,6 +11,8 @@ tm_landing_popup( content = NULL, buttons = modalButton("Accept") ) + +landing_popup(title = NULL, content = NULL, buttons = modalButton("Accept")) } \arguments{ \item{label}{(\code{character(1)}) Label shown in the navigation item for the module. Any label possible except