R/mod_card_staff.R

Defines functions mod_card_staff_server mod_card_staff_ui

#' UI Card Staff
#' 
#' @param id The namespace identifier.
#' @noRd
#' 
mod_card_staff_ui <- function(id) {
  
  ns <- shiny::NS(id)
  
  shiny::uiOutput(ns("staff"))
  
}

#' Server Card Staff
#'
#' @param id The namespace identifier.
#' @param company Data about the company.
#' @noRd
#' 
mod_card_staff_server <- function(id, company) {
  
  shiny::moduleServer(
    id,
    function(input, output, session) {
    
    output$staff <-
      shiny::renderUI(
        bs4Dash::box(
          width = 12,
          title = "Staff",
          collapsible = FALSE,
          closable = FALSE,
          shiny::p(
            stringr::str_c("Founder", company$founder, sep = " : ")
          ),
          shiny::p(
            stringr::str_c("CEO", company$ceo, sep = " : ")
          ),
          shiny::p(
            stringr::str_c("CTO", company$cto, sep = " : ")
          ),
          shiny::p(
            stringr::str_c("COO", company$coo, sep = " : ")
          ),
          shiny::p(
            stringr::str_c(
              "CTO Propulsion",
              company$cto_propulsion,
              sep = " : "
            )
          )
        )
      )
    
    }
  )
  
}
James-G-Hill/SpaceX-R-Shiny-Application documentation built on Nov. 11, 2021, 11:26 p.m.