Skip to content

Commit

Permalink
replace setDarkMode again due to issues in tab layout
Browse files Browse the repository at this point in the history
  • Loading branch information
hypebright committed Apr 28, 2024
1 parent db8d0c7 commit 6c60dd1
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 6 deletions.
47 changes: 46 additions & 1 deletion inst/examples/gallery/app.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,24 @@ shinyApp(
f7Panel(
title = "Right Panel",
side = "right",
"Blabla",
f7Radio(
inputId = "theme",
label = "Theme",
choices = c("md", "ios"),
selected = "md"
),
f7Radio(
inputId = "dark",
label = "Mode",
choices = c("dark", "light"),
selected = "dark"
),
f7Radio(
inputId = "color",
label = "Color",
choices = getF7Colors(),
selected = "primary"
),
effect = "floating",
options = list(swipe = TRUE)
)
Expand Down Expand Up @@ -124,6 +141,34 @@ shinyApp(
)
),
server = function(input, output, session) {

# update theme
observeEvent(input$theme, ignoreInit = TRUE, {
updateF7App(
options = list(
theme = input$theme
)
)
})

# update mode
observeEvent(input$dark, ignoreInit = TRUE, {
updateF7App(
options = list(
dark = ifelse(input$dark == "dark", TRUE, FALSE)
)
)
})

# update color
observeEvent(input$color, ignoreInit = TRUE, {
updateF7App(
options = list(
color = input$color
)
)
})

# input validation
observe({
validateF7Input(inputId = "text", info = "Whatever")
Expand Down
2 changes: 1 addition & 1 deletion inst/shinyMobile-2.0.0/dist/shinyMobile.min.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inst/shinyMobile-2.0.0/dist/shinyMobile.min.js

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

Loading

0 comments on commit 6c60dd1

Please sign in to comment.