Skip to content

Commit

Permalink
chore: doc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vedhav committed Jan 17, 2025
1 parent d50f579 commit 489a28c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 91 deletions.
5 changes: 1 addition & 4 deletions R/init.R
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,7 @@
#' `Iris Sepal.Length histogram` = "new_iris Species",
#' global_filters = "new_mtcars cyl"
#' )
#' ),
#' title = "App title",
#' header = tags$h1("Sample App"),
#' footer = tags$p("Sample footer")
#' )
#' )
#' if (interactive()) {
#' shinyApp(app$ui, app$server)
Expand Down
51 changes: 10 additions & 41 deletions R/landing_popup_module.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#' Landing popup module
#'
#' @description Creates a landing welcome popup for `teal` applications.
#' @description `r lifecycle::badge("deprecated")` Creates a landing welcome popup for `teal` applications.
#'
#' This module is used to display a popup dialog when the application starts.
#' The dialog blocks access to the application and must be closed with a button before the application can be viewed.
#' This function is deprecated, please use `add_landing_modal()` on the teal app object instead.
#'
#' @param label (`character(1)`) Label of the module.
#' @param title (`character(1)`) Text to be displayed as popup title.
Expand All @@ -13,51 +14,19 @@
#'
#' @return A `teal_module` (extended with `teal_landing_module` class) to be used in `teal` applications.
#'
#' @examples
#' app1 <- init(
#' data = teal_data(iris = iris),
#' modules = modules(
#' example_module(),
#' landing_popup_module(
#' content = "A place for the welcome message or a disclaimer statement.",
#' buttons = modalButton("Proceed")
#' )
#' )
#' )
#' if (interactive()) {
#' shinyApp(app1$ui, app1$server)
#' }
#'
#' app2 <- init(
#' data = teal_data(iris = iris),
#' modules = modules(
#' example_module(),
#' landing_popup_module(
#' title = "Welcome",
#' content = tags$b(
#' "A place for the welcome message or a disclaimer statement.",
#' style = "color: red;"
#' ),
#' buttons = tagList(
#' modalButton("Proceed"),
#' actionButton("read", "Read more",
#' onclick = "window.open('http://google.com', '_blank')"
#' ),
#' actionButton("close", "Reject", onclick = "window.close()")
#' )
#' )
#' )
#' )
#'
#' if (interactive()) {
#' shinyApp(app2$ui, app2$server)
#' }
#'
#' @export
landing_popup_module <- function(label = "Landing Popup",
title = NULL,
content = NULL,
buttons = modalButton("Accept")) {
lifecycle::deprecate_soft(
when = "0.15.3",
what = "landing_popup_module()",
details = paste(
"landing_popup_module() is deprecated.",
"Use add_landing_modal() on the teal app object instead."
)
)
checkmate::assert_string(label)
checkmate::assert_string(title, null.ok = TRUE)
checkmate::assert_multi_class(
Expand Down
5 changes: 1 addition & 4 deletions man/init.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 2 additions & 42 deletions man/landing_popup_module.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 489a28c

Please sign in to comment.