## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(
  collapse = TRUE,
  comment  = "#>",
  eval     = FALSE
)

## ----setup--------------------------------------------------------------------
# library(bs4Dashkit)

## -----------------------------------------------------------------------------
# rightUi <- tagList(
#   dash_nav_status_item("Ready", status = "success", icon = icon("circle-check")),
#   dash_nav_refresh_item("refresh"),
#   dash_nav_help_item("help")
# )
# 
# validate_bs4dash_navbar(rightUi)

## -----------------------------------------------------------------------------
# rightUi <- tagList(
#   dash_nav_item(actionButton("custom", "Custom"))
# )

## -----------------------------------------------------------------------------
# rightUi <- tagList(
#   dash_nav_refresh_item("refresh"),
#   tags$li(class = "nav-item", "Missing dropdown class")
# )
# 
# validate_bs4dash_navbar(rightUi)
# #> Error: Navbar item 2 is an <li> but is missing class "dropdown".
# #> Wrap it with dash_nav_item().

## -----------------------------------------------------------------------------
# dash_nav_refresh_item("refresh")                      # complete navbar item
# dash_nav_refresh_item("refresh", label = "Reload")    # custom label
# dash_nav_refresh_item("refresh", label = "")          # icon only
# dash_nav_refresh_item("refresh", icon = "arrows-rotate")

## -----------------------------------------------------------------------------
# observeEvent(input$refresh, {
#   session$reload()
# })

## -----------------------------------------------------------------------------
# dash_nav_help_item("help")                     # complete navbar item
# dash_nav_help_item("help", label = "Support")  # custom label
# dash_nav_help_item("help", label = "")         # icon only
# dash_nav_help_item("help", icon = "circle-info")

## -----------------------------------------------------------------------------
# observeEvent(input$help, {
#   showModal(modalDialog(
#     title     = "Help",
#     "Add your instructions here.",
#     easyClose = TRUE,
#     footer    = modalButton("Close")
#   ))
# })

## -----------------------------------------------------------------------------
# observeEvent(input$help, {
#   showModal(modalDialog(
#     title = "Help & Documentation",
#     tagList(
#       h4("Getting started"),
#       p("Describe the dashboard purpose here."),
#       h4("Data sources"),
#       p("Describe where data comes from."),
#       h4("Contact"),
#       p("Email: support@yourorg.gov")
#     ),
#     size      = "l",
#     easyClose = TRUE,
#     footer    = modalButton("Close")
#   ))
# })

## -----------------------------------------------------------------------------
# dash_nav_status_item("Ready", status = "success", icon = icon("circle-check"))
# dash_nav_status_item("Syncing", status = "info", icon = icon("rotate"))
# dash_nav_status_item("Review", status = "warning", icon = icon("triangle-exclamation"))

## -----------------------------------------------------------------------------
# dash_nav_title(
#   title    = "DASHBOARDS",
#   subtitle = "Critical & Main",
#   icon     = icon("shield-halved"),
#   align    = "center"                    # "center" | "left" | "right"
# )

## -----------------------------------------------------------------------------
# rightUi <- tagList(
#   dash_nav_title(
#     "DASHBOARDS", "Critical & Main",
#     icon  = icon("shield-halved"),
#     align = "center"
#   ),
#   dash_nav_status_item("Ready", status = "success", icon = icon("circle-check")),
#   dash_nav_refresh_item("refresh"),
#   dash_nav_help_item("help")
# )

## -----------------------------------------------------------------------------
# rightUi <- tagList(
#   dash_nav_refresh_item("refresh"),
#   dash_nav_help_item("help"),
#   dash_nav_title(
#     "DASHBOARDS", "Critical & Main",
#     icon  = icon("shield-halved"),
#     align = "right"
#   )
# )

## -----------------------------------------------------------------------------
# rightUi <- tagList(
#   dash_nav_title(
#     "DASHBOARDS", "Critical & Main",
#     icon  = icon("shield-halved"),
#     align = "left"
#   ),
#   dash_nav_refresh_item("refresh"),
#   dash_nav_help_item("help")
# )

## -----------------------------------------------------------------------------
# dash_user_menu(
#   dropdownMenu(
#     type = "notifications",
#     notificationItem("Profile"),
#     notificationItem("Logout")
#   )
# )

## -----------------------------------------------------------------------------
# dash_user_menu(
#   dropdownMenu(
#     type = "notifications",
#     notificationItem("Profile"),
#     notificationItem("Logout")
#   )
# )

## -----------------------------------------------------------------------------
# rightUi <- tagList(
#   dash_nav_title(
#     "DASHBOARDS",
#     "Critical & Main",
#     icon  = icon("shield-halved"),
#     align = "center"
#   ),
#   dash_nav_status_item("Ready", status = "success", icon = icon("circle-check")),
#   dash_nav_refresh_item("refresh"),
#   dash_nav_help_item("help"),
#   dash_user_menu(
#     dropdownMenu(
#       type = "notifications",
#       notificationItem("Profile"),
#       notificationItem("Sign out")
#     )
#   )
# )
# 
# validate_bs4dash_navbar(rightUi)
# 
# bs4DashNavbar(
#   title = ttl$brand,
#   skin  = "light",
#   rightUi = rightUi
# )

## -----------------------------------------------------------------------------
# server <- function(input, output, session) {
#   observeEvent(input$refresh, session$reload())
# 
#   observeEvent(input$help, {
#     showModal(modalDialog("Help content.", easyClose = TRUE))
#   })
# }

