Closed bianchenhao closed 1 year ago
The code below works, but page turns ugly.
library(bs4Dash)
library(shiny)
library(firebase)
ui <- fluidPage(
useFirebase(),
useFirebaseUI(),
uiOutput("ui1")
)
server <- function(input, output, session) {
f <- FirebaseUI$
new("session")$ # instantiate
set_providers( # define providers
email = TRUE,
google = TRUE
)$
launch() # launch
output$ui1 <- renderUI({
f$req_sign_in() # require sign in
bs4DashPage(
title = "test",
navbar = bs4DashNavbar(),
sidebar = bs4DashSidebar(
skin = "light",
title = "test"),
controlbar = bs4DashControlbar(),
footer = bs4DashFooter(),
body = bs4DashBody()
)
})
}
shinyApp(ui, server)
Hey,
Did you ever find a solution to this?
I noticed adding a usebs4Dash()
in your second solution brings a better look of the app. See below
`library(bs4Dash)
library(shiny)
library(firebase)
ui <- fluidPage( useBs4Dash(), useFirebase(), useFirebaseUI(), uiOutput("ui1") )
server <- function(input, output, session) { f <- FirebaseUI$ new("session")$ # instantiate set_providers( # define providers email = TRUE, google = TRUE )$ launch() # launch
output$ui1 <- renderUI({ f$req_sign_in() # require sign in bs4DashPage( title = "test", navbar = bs4DashNavbar(), sidebar = bs4DashSidebar( skin = "light", title = "test"), controlbar = bs4DashControlbar(), footer = bs4DashFooter(), body = bs4DashBody() ) })
}
shinyApp(ui, server)`
Do you Find any solution for this problem?
This is not an issue with {firebase}. You can place the firebase UI container in bs4DashBody:
ui <- bs4Dash::bs4DashPage(
title = "test",
header = bs4Dash::bs4DashNavbar(),
sidebar = bs4Dash::bs4DashSidebar(
skin = "light",
title = "test"),
controlbar = bs4Dash::bs4DashControlbar(),
footer = bs4Dash::bs4DashFooter(),
body = bs4Dash::bs4DashBody(
firebase::useFirebase(),
firebase::useFirebaseUI(),
firebase::firebaseUIContainer()
)
)
server <- function(input, output, session) {
f <- firebase::FirebaseUI$
new("session")$ # instantiate
set_providers( # define providers
email = TRUE,
google = TRUE
)$
launch() # launch
}
shiny::shinyApp(ui, server)
I try the code below,but it dosen't work.
I try another way, it dosen't work either.