How do I change user picture in shinydahsboardPlus?

Viewed 71

How do I change the profile picture here? Ideally I want the user to be able to hover over the picture and a text will show "Change picture", and after the user clicks - he/she can change the picture.

When inspecting the HTML the picture has a class, but no ID - so I cant really use shinyjs out of the box. Any suggestions on how to achieve this?

The code is shown below,

if (interactive()) {
    library(shiny)
    library(shinyWidgets)
    library(shinydashboard)
    library(shinydashboardPlus)
    
    shinyApp(
        ui = dashboardPage(
            header = dashboardHeader(userOutput("user")),
            sidebar = dashboardSidebar(),
            body = dashboardBody(),
            title = "DashboardPage"
        ),
        server = function(input, output) {
            output$user <- renderUser({
                dashboardUser(
                    name = "Divad Nojnarg", 
                    image = "https://adminlte.io/themes/AdminLTE/dist/img/user2-160x160.jpg", 
                    title = "shinydashboardPlus",
                    subtitle = "Author", 
                    footer = p("The footer", class = "text-center"),
                    fluidRow(
                        dashboardUserItem(
                            width = 6,
                            socialButton(
                                href = "https://dropbox.com",
                                icon = icon("dropbox")
                            )
                        ),
                        dashboardUserItem(
                            width = 6,
                            socialButton(
                                href = "https://github.com",
                                icon = icon("github")
                            )
                        )
                    )
                )
            })
        }
    )
}
0 Answers
Related