R/app_ui.R

Defines functions golem_add_external_resources app_ui

#' The application User-Interface
#' 
#' @param request Internal parameter for `{shiny}`. 
#'     DO NOT REMOVE.
#' @import shiny
#' @noRd
app_ui <- function(request) {
  tagList(
    # Leave this function for adding external resources
    golem_add_external_resources(),
    # List the first level UI elements here 
    
    dashboardPage(
      dashboardHeader(),
      dashboardSidebar(),
      dashboardBody()
    )
    
    # shinydashboard::dashboardPage(
    #   header <- shinydashboard::dashboardHeader(
    #     title="BasketCase - crazy good eCommerce analytics"
    #     enable_rightsidebar = F
    #   ),
    #   sidebar <- shinydashboard::dashboardSidebar(
    #     shinydashboard::sidebarMenu(
    #       id='tabs',
    #       shinydashboard::menuItem('Sales', tabName='sales', icon=icon('user'),
    #                                shinydashboard::menuItem('Explore', tabName='sales-explore', icon=icon('search'))
    #                                # shinydashboard::menuItem('Forecast', tabName='sales-forecast', icon=icon('chart-line'))
    #                                )
    #       # shinydashboard::menuItem('Customer', tabName='customer', icon=icon('user'),
    #       #                          shinydashboard::menuItem('Overview', tabName='customer-overview', icon=icon('tachometer-average')),
    #       #                          shinydashboard::menuItem('Profiles', tabName='customer-profiles', icon=icon('user')),
    #       #                          shinydashboard::menuItem('Forecast', tabName='customer-forecast', icon=icon('braille')),
    #       #                          )
    #     )
    #   ),
    # 
    #   body <- shinydashboard::dashboardBody(
    #     shinydashboard::tabItems(
    #       shinydashboard::tabItem('sales-explore', mod_sales_explore_ui("sales_explore_ui_1")),
    #     ),
    #     rightsidebar=NULL,
    #     title="BasketCase - crazy good eCommerce analytics"
    #   )
    # )
  )
}

#' Add external Resources to the Application
#' 
#' This function is internally used to add external 
#' resources inside the Shiny application. 
#' 
#' @import shiny
#' @importFrom golem add_resource_path activate_js favicon bundle_resources
#' @noRd
golem_add_external_resources <- function(){
  
  add_resource_path(
    'www', app_sys('app/www')
  )
 
  tags$head(
    favicon(),
    bundle_resources(
      path = app_sys('app/www'),
      app_title = 'BasketCase'
    )
    # Add here other external resources
    # for example, you can add shinyalert::useShinyalert() 
  )
}
errcHuang/BasketCase documentation built on Aug. 31, 2020, 12:46 a.m.