Skip to content

Commit

Permalink
poke info instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
DivadNojnarg committed Sep 7, 2023
1 parent cb87be9 commit 0da0c32
Showing 1 changed file with 12 additions and 37 deletions.
49 changes: 12 additions & 37 deletions R/mod_poke_info.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,43 +25,18 @@ mod_poke_info_server <- function(id, selected, is_shiny) {

pokemon <- selected()

tagList(
fluidRow(
tablerCard(
tablerProfileCard(
title = selected()$name,
subtitle = tagList(
pokemon$description,
tablerTagList(
align = "center",
tablerTag(name = pokemon$shape, rounded = TRUE, color = "default"),
tablerTag(name = pokemon$habitat, rounded = TRUE, color = pokemon$color)
)
),
background = "https://images.pexels.com/photos/355748/pexels-photo-355748.jpeg",
src = if (!is_shiny()) {
pokemon$sprites$front_default
} else {
pokemon$sprites$front_shiny
},
socials = tablerSocialLinks(
tablerSocialLink(
name = "pokeApi",
href = paste0("https://pokeapi.co/api/v2/pokemon/", tolower(selected())),
icon = "at"
),
tablerSocialLink(
name = "Bulbapedia",
href = paste0("https://bulbapedia.bulbagarden.net/wiki/", selected(), "_(Pok\u00e9mon)"),
icon = "address-card"
)
),
width = 4
)
)
),
br()
)
# WORKSHOP TODO
# Add the UI containing general information
# about the selected Pokemon.
# Note (optional): sprites data have 2 entries so you may want
# to check if the pokemon is under its Shiny form like
# below:
# if (!is_shiny()) {
# pokemon$sprites$front_default
# } else {
# pokemon$sprites$front_shiny
# }

})
})
}

0 comments on commit 0da0c32

Please sign in to comment.