Closed eblondel closed 6 months ago
Author: Emmanuel Blondel @eblondel Date of creation: 2022-01-01T12:10:42.793+0000 Last update: 2022-01-01T12:10:42.793+0000
[~brian.ojok] please discuss this with [~alexandre.bennici@fao.org] Indeed there was somewhere (in vessel_utils.R I think) some custom function with the same spirit, but we should make it generic and flexible enough. so the above proposal with classes args and style, is probably the right way to move forward.
Author: Brian Ojok @brianandy Date of creation: 2022-01-01T13:36:50.112+0000 Last update: 2022-01-01T13:36:50.112+0000
[~emmanuel.blondel] alright
One limitation of
infoBox
is its lack of flexibility to manage css classes and style property. In our case, it prevents us from applying different stylings to infoBoxes depending on the module. the only way is to modify the CSS classes at app level, but then the styles are applied in the same way to all info boxes.The purpose of this task is to create a
calipseoInfoBox
function in _uiutils.R that re-writes the shinydashboardinfoBox
.Looking at the infoBox function:
{code:java} infoBox function (title, value = NULL, subtitle = NULL, icon = shiny::icon("bar-chart"), color = "aqua", width = 4, href = NULL, fill = FALSE) { validateColor(color) tagAssert(icon, type = "i") colorClass <- paste0("bg-", color) boxContent <- div(class = "info-box", class = if (fill) colorClass, span(class = "info-box-icon", class = if (!fill) colorClass, icon), div(class = "info-box-content", span(class = "info-box-text", title), if (!is.null(value)) span(class = "info-box-number", value), if (!is.null(subtitle)) p(subtitle))) if (!is.null(href)) boxContent <- a(href = href, boxContent) div(class = if (!is.null(width)) paste0("col-sm-", width), boxContent) } <bytecode: 0x000001c0a0b7fff8>