Skip to content

Commit

Permalink
feat: show three different tabs types for different module depths
Browse files Browse the repository at this point in the history
  • Loading branch information
vedhav committed Sep 26, 2024
1 parent 20bb0f0 commit 2c36c7b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion R/module_nested_tabs.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,13 @@ ui_teal_module.default <- function(id, modules, depth = 0L) {
#' @export
ui_teal_module.teal_modules <- function(id, modules, depth = 0L) {
ns <- NS(id)
first_level_modules <- sapply(modules$children, \(x) x$label)
do.call(
ifelse(modules$label == "root", navset_card_pill, navset_card_underline),
switch(as.character(depth),
"0" = navset_card_pill,
"1" = navset_card_tab,
navset_card_underline
),
c(
# by giving an id, we can reactively respond to tab changes
list(
Expand Down

0 comments on commit 2c36c7b

Please sign in to comment.