R/mod_aboutTab.R

Defines functions mod_aboutTab_server mod_aboutTab_ui

#' aboutTab UI Function
#'
#' @description About Module, showing details why and how to use this app.
#'
#' @param id,input,output,session Internal parameters for {shiny}.
#'
#' @noRd
#'
#' @importFrom shiny NS tagList
mod_aboutTab_ui <- function(id) {
  ns <- NS(id)

  bs4TabItem(
    tabName = "about",
    br(),

    accordion(
      id = ns("intro"),
      accordionItem(
        title = "Brief introduction",
        status = "gray",
        collapsed = FALSE,
        h1("Welcome to the Easy IVD Shiny App"),
        actionButton(inputId = ns("reload"), label = "Reload")
      ),

      accordionItem(
        title = "Shiny App User Guide",
        status = "info",
        collapsed = TRUE,
        h1("User Guide PDF PAGE")
      ),

      accordionItem(
        title = "Help workflow",
        status = "olive",
        collapsed = TRUE,
        h1("Help workflow!")
      )
    )


    # fluidRow(
    #   column(
    #     width = 8,
    #     h1("Welcome to the Easy IVD Shiny App"),
    #     actionButton(inputId = ns("reload"), label = "Reload")
    #   ),
    #   column(
    #     width = 3, offset = 1,
    #     imageOutput(outputId = ns("hex"))
    #   )
    # )
  )
}

#' aboutTab Server Functions
#'
#' @noRd
mod_aboutTab_server <- function(id) {
  moduleServer(id, function(input, output, session) {
    ns <- session$ns

    output$hex <- renderImage(
      {
        list(
          src = system.file("app/www/images.png", package = "EasyIVD"), width = "60%"
        )
      },
      deleteFile = FALSE
    )

    # fake reload
    observeEvent(input$reload, {
      session$reload()
    })
  })
}

## To be copied in the UI
# mod_aboutTab_ui("aboutTab_ui_1")

## To be copied in the server
# mod_aboutTab_server("aboutTab_ui_1")
kaigu1990/EasyIVD documentation built on Dec. 21, 2021, 5:15 a.m.