R/app_ui.R

Defines functions golem_add_external_resources app_ui

#' @import shiny
#' @import shinydashboard
app_ui <- function() {
  tagList(
    # Leave this function for adding external resources
    golem_add_external_resources(),
    # List the first level UI elements here
    dashboardPage(skin = "green", title = "quizin",
      dashboardHeader(title = span(tagList(icon("graduation-cap"), "quizin"))),
      dashboardSidebar(
        sidebarMenu(
          menuItem("Convertir des questions", tabName = "tab_import", icon = icon("file-upload")),
          menuItem("Instructions", tabName = "tab_regles", icon = icon("edit")),
          menuItem("Exemples", tabName = "tab_examples", icon = icon("file-alt"))
        )
      ),
      dashboardBody(
        tabItems(
          tabItem(tabName = "tab_import",
                  mod_file_imports_ui("file_imports_ui_1")
                  ),
          
          tabItem(tabName = "tab_regles",
                  mod_rules_ui("rules_ui_1")
                  ),

          tabItem(tabName = "tab_examples",
                  mod_examples_ui("examples_ui_1")
                  )
        )
      )
    )
  )
}

#' @import shiny
golem_add_external_resources <- function(){
  
  addResourcePath(
    'www', system.file('app/www', package = 'quizin')
  )
 
  tags$head(
    golem::activate_js(),
    golem::favicon(),
    # Add here all the external resources
    # If you have a custom.css in the inst/app/www
    # Or for example, you can add shinyalert::useShinyalert() here
    tags$link(rel="stylesheet", type="text/css", href="www/custom.css")
  )
}
MarieEtienne/quizin documentation built on Dec. 17, 2021, 3:11 a.m.