Skip to content

Commit

Permalink
added a div to the if statement in the feedback section to make sure …
Browse files Browse the repository at this point in the history
…that everything shows up as intended

updated documentation
  • Loading branch information
mzayeddfe committed Oct 17, 2024
1 parent 3245e33 commit 4f7d5ce
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 39 deletions.
71 changes: 37 additions & 34 deletions R/support_panel.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,12 @@
#' @param form_url URL for a feedback form for the dashboard
#' @param feedback_custom_text A single vector or a combined vector wrapped in
#' `shiny::tagList()` instead of c() for custom text to go under the "Give us
#' feedback" heading.It will be a separate paragraph beneath the existing text template.
#' feedback" heading.
#' @param info_custom_text A single vector or a combined vector wrapped in
#' `shiny::tagList()` instead of c() for custom text to go under the
#' "Find out more information on the data" heading.
#' It will be a separate paragraph beneath the existing text template.
#' @param contact_custom_text A single vector or a combined vector wrapped in
#' `shiny::tagList()` instead of c() for custom text to go under the "Contact us" heading.
#' It will be a separate paragraph beneath the existing text template.
#'
#' @param extra_text Add extra paragraphs to the page before the "Contact us" section.
#' Use `dfeshiny::html_paragraph_tags()` to specify the heading and body.
#' Look at examples to see how to add one or multiple sections.
Expand Down Expand Up @@ -224,46 +221,50 @@ support_panel <- function(
shiny::tags$div(
shiny::tags$h1("Support and feedback"),
shiny::tags$h2("Give us feedback"),
# if feedback_custom_text is provided, use html_paragraph to get tag list for custom text
# if feedback_custom_text is provided, use html_paragraph_tags
# to get tag list for custom text
if (!is.null(feedback_custom_text)) {
html_paragraph_tags(body = feedback_custom_text)
# if feedback_custom_text is not provided, run code as usual
} else {
if (!is.null(form_url)) {
shiny::tags$p(
"This dashboard is a new service that we are developing. If you
shiny::tags$div(
if (!is.null(form_url)) {
shiny::tags$p(
"This dashboard is a new service that we are developing. If you
have any feedback or suggestions for improvements, please submit
them using our ",
dfeshiny::external_link(
href = form_url,
link_text = "feedback form"
),
"."
)
} else {
dfeshiny::external_link(
href = form_url,
link_text = "feedback form"
),
"."
)
} else {
shiny::tags$p(
"This dashboard is a new service that we are developing."
)
},
shiny::tags$p(
"This dashboard is a new service that we are developing."
)
}
shiny::tags$p(
paste0(
ifelse(
!is.null(form_url),
"Alternatively, i",
"I"
),
"f you spot any errors or bugs while using this dashboard, please
paste0(
ifelse(
!is.null(form_url),
"Alternatively, i",
"I"
),
"f you spot any errors or bugs while using this dashboard, please
screenshot and email them to "
),
dfeshiny::external_link(
href = paste0("mailto:", team_email),
link_text = team_email,
add_warning = FALSE
), "."
),
dfeshiny::external_link(
href = paste0("mailto:", team_email),
link_text = team_email,
add_warning = FALSE
), "."
)
)
},
shiny::tags$h2("Find more information on the data"),
# if info_custom_text is provided, use html_paragraph to get tag list for custom text
# if info_custom_text is provided, use html_paragraph_tags
# to get tag list for custom text
if (!is.null(info_custom_text)) {
html_paragraph_tags(body = info_custom_text)
# if info_custom_text is not provided, run code as usual
Expand Down Expand Up @@ -315,9 +316,11 @@ support_panel <- function(
)
}
},
# to add extra sections before the contact us section
extra_text,
shiny::tags$h2("Contact us"),
# if contact_custom_text is provided, use html_paragraph to get tag list for custom text
# if contact_custom_text is provided, use html_paragraph_tags
# to get tag list for custom text
if (!is.null(contact_custom_text)) {
html_paragraph_tags(body = contact_custom_text)
} else {
Expand Down
8 changes: 3 additions & 5 deletions man/support_panel.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4f7d5ce

Please sign in to comment.