Skip to content

Commit

Permalink
missing alt text on images
Browse files Browse the repository at this point in the history
  • Loading branch information
akarras committed Jan 13, 2024
1 parent aa5d0af commit 2bdd4e5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
8 changes: 6 additions & 2 deletions ultros-frontend/ultros-app/src/components/item_icon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@ pub fn ItemIcon(#[prop(into)] item_id: MaybeSignal<i32>, icon_size: IconSize) ->
};
let (failed, set_failed) = create_signal(0);
let failed_item = move || failed() == item_id();
let data = xiv_gen_db::data();
let item_name = move || {
let item = data.items.get(&ItemId(item_id()));
format!("Image for item {}", item.as_ref().map(|i| i.name.as_str()).unwrap_or_default())
};
view! {

<img class=icon_size.get_class()
<img prop:alt=item_name class=icon_size.get_class()
src=move || { if !failed_item() && valid_search_category() {
format!("/static/itemicon/{}?size={}", item_id(), icon_size)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub fn ProfileDisplay() -> impl IntoView {
{move || user.get().map(|user| match user {
Some(auth) => view! {
<A href="/profile">
<img class="avatar" src=&auth.avatar alt=&auth.username/>
<img alt="User profile picture" class="avatar" src=&auth.avatar alt=&auth.username/>
</A>
<a rel="external" class="btn" href="/logout">
"Logout"
Expand Down
1 change: 0 additions & 1 deletion ultros-frontend/ultros-app/src/routes/item_explorer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use crate::CheapestPrices;
use itertools::Itertools;
use leptos::*;
use leptos_icons::*;
use leptos_meta::Title;
use leptos_router::*;
use log::info;
use paginate::Pages;
Expand Down

0 comments on commit 2bdd4e5

Please sign in to comment.