add alt to avatar img elements

pull/69/head
Dario Piotrowicz 2023-01-11 10:00:49 +00:00
rodzic 86e8ea218c
commit 4aa6263c2d
3 zmienionych plików z 5 dodań i 4 usunięć

Wyświetl plik

@ -26,7 +26,7 @@ export default component$((props: Props) => {
<div onClick$={handleContentClick}>
<div class="flex justify-between mb-3">
<div class="flex">
<Avatar src={status.account.avatar} />
<Avatar accountDisplayName={status.account.display_name} src={status.account.avatar} />
<div class="flex-col ml-3">
<div>
{/* TODO: this should either have an href or not being an `a` element (also consider using QwikCity's `Link` instead) */}

Wyświetl plik

@ -2,8 +2,9 @@ import { component$ } from '@builder.io/qwik'
type Props = {
src: string
accountDisplayName: string
}
export const Avatar = component$<Props>(({ src }) => {
return <img class="rounded h-12 w-12" src={src} />
export const Avatar = component$<Props>(({ src, accountDisplayName }) => {
return <img class="rounded h-12 w-12" src={src} alt={`Avatar of ${accountDisplayName}`} />
})

Wyświetl plik

@ -36,7 +36,7 @@ export default component$(() => {
<div class="bg-wildebeest-700 p-4">
{/* Account Card */}
<div class="flex">
<Avatar src={status.account.avatar} />
<Avatar accountDisplayName={status.account.display_name} src={status.account.avatar} />
<div class="flex flex-col">
<div class="p-1">
{/* TODO: this should either have an href or not being an `a` element (also consider using QwikCity's `Link` instead) */}