R/logout_ui.R

Defines functions logout_ui

Documented in logout_ui

#' Logout Shiny Module UI
#'
#' Return a UI with a logout button and information about user logged.
#' By default is hidden and is show with reactive element from logoutServer
#'
#' @param id character
#' @param textbutton character
#' @param classbutton character
#' @examples
#' logout_ui("test")
#' @import shiny
#' @rawNamespace import(shinyjs, except = runExample)
#' @return Shiny UI
#' @export
logout_ui <- function(id, textbutton = "Log out", classbutton = "btn-logout btn-danger") {
  ns <- NS(id)
  fluidRow(
    uiOutput(ns("who"),inline = TRUE),
    shinyjs::hidden(
      actionButton(ns("logout"),
                   textbutton,
                   class = classbutton,
                   style = "color: white;")
    ),
    style = "margin:8px 0; float:right; display:inline; width:100%; text-align:right; font-size:12px",
    class = "user-logged",
  )
}

Try the cognitoR package in your browser

Any scripts or data that you put into this service are public.

cognitoR documentation built on Sept. 14, 2023, 1:07 a.m.