R/app_ui.R

Defines functions learn home statics app_ui

#' @import shiny
#'
app_ui <- function() {
  navbarPage(
    title = a(
      span("sqlnstructor"),
      href = "."
    ),
    windowTitle = "Learn R and SQL",
    id = "navbar-nav",
    position = 'fixed-top',
    header = statics(),
    home(),
    learn(),
    # Exercices ----
    navbarMenu(
      title = "Exercices",
      tabPanel(
        title = "[example] mtcars",
        mod_exercise_mtcars_ui(id = "exercise_mtcars")
      )
    ),
   # Contributions
    tabPanel(
      title = "Contribute",
      value = "contribution",
      mod_contrib_ui(id = "contrib")
    ),
    #News ----
    tabPanel(
      title = div(
        "News",
        span(class = "notif")
      ),
      value = "news",
      mod_news_ui(id = "news")
    )
  )
}

#' @import shiny
statics <- function(){
  addResourcePath('www', system.file('app/www', package = 'sqlnstructor'))
  tags$head(
    tags$link(rel = "stylesheet", type = "text/css", href = "www/custom.css"),
    tags$link(rel = "shortcut icon", href = "www/img/favicon.ico"),
    tags$script(src = "www/script.js")
  )
}

#' @import shiny
home <- function() {
  tabPanel(
    title = "Home",
    value = "home",
    mod_home_ui(id = "home")
  )
}

#' @import shiny
learn <- function() {
  navbarMenu(
    title = "Learn",
    tabPanel(
      title = "Introduction",
      value = "learn_intro",
      p("Intro to learn")
    ),
    tabPanel(
      title = "Select data"
    ),
    tabPanel(
      title = "Filter data"
    ),
    tabPanel(
      title = "Aggregate data"
    ),
    tabPanel(
      title = "Join data"
    ),
    tabPanel(
      title = "Request a database"
    )
  )
}
ArthurData/sqlnstructor documentation built on Dec. 17, 2021, 9:44 a.m.