Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions R/helper_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,23 @@ in_line_nav_link <- function(link_text, target_link) {
"</a>"
))
}


# left nav ====================================================================
dfe_contents_links <- function(links_list) {
# Function to create a sidebar link with an ID
create_sidelink <- function(link_text) {
link_id <- links_list[[link_text]] %||% tolower(link_text)
tags$li("—", actionLink(link_id, link_text, class = "contents_link"))
}

# The HTML div to be returned
tags$div(
style = "position: sticky; top: 0.5rem; padding: 0.25rem; padding-left: 2rem;",
h2("Contents"),
tags$ol(
style = "list-style-type: none; padding-left: 0; font-size: 1rem;",
lapply(names(links_list), create_sidelink)
)
)
}
4 changes: 2 additions & 2 deletions R/ui_panels/example_tab_1.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
example_tab_1_panel <- function() {
tabPanel(
"Example tab 1",
bslib::nav_panel(
"example_tab_1",
gov_main_layout(
gov_row(
column(
Expand Down
4 changes: 2 additions & 2 deletions R/ui_panels/user_guide.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
user_guide_panel <- function() {
tabPanel(
"User guide",
bslib::nav_panel(
"user_guide",
gov_main_layout(
gov_row(
column(
Expand Down
11,111 changes: 5,104 additions & 6,007 deletions renv.lock

Large diffs are not rendered by default.

Loading
Loading