Skip to content

Commit

Permalink
feat: use card template to remove repeated code
Browse files Browse the repository at this point in the history
  • Loading branch information
averissimo committed Sep 28, 2023
1 parent 75e9086 commit f34e342
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions R/tm_t_shift_by_arm.R
Original file line number Diff line number Diff line change
Expand Up @@ -529,14 +529,12 @@ srv_shift_by_arm <- function(id,
### REPORTER
if (with_reporter) {
card_fun <- function(comment, label) {
card <- teal::TealReportCard$new()
title <- "Shift by Arm Table"
title <- ifelse(label == "", title, label)
card$set_name(title)
card$append_text(title, "header2")
if (with_filter) {
card$append_fs(filter_panel_api$get_filter_state())
}
card <- card_template(
title = "Shift by Arm Table",
label = label,
description = NULL,
with_filter = with_filter
)
card$append_text("Table", "header3")
card$append_table(table_r())
if (!comment == "") {
Expand Down

0 comments on commit f34e342

Please sign in to comment.