1nwf / Produx-v2

Prefer meaningful alternative text JS-0737
Anti-pattern
Minor
8 months ago2 years old
img elements must have an alt prop, either with meaningful text, or an empty string for decorative images
15                <>
16                  <div className="card w-72 card-bordered card-compact lg:card-normal border-solid border-black bg-white">
17                    <figure>
18                      <img src={obj.images[0]} />19                    </figure>
20                    <div className="card-body">
21                      <h2 className="card-title">{obj.name}</h2>
img elements must have an alt prop, either with meaningful text, or an empty string for decorative images
54        } w-full rounded-box`}
55      >
56        {userInfo.pfp ? (
57          <img58            className={"h-full object-contain w-full"}59            src={URL.createObjectURL(userInfo.pfp)}60          />61        ) : (
62          <p>Add Image</p>
63        )}
img elements must have an alt prop, either with meaningful text, or an empty string for decorative images
28                    className="bg-blue-400 m-2 rounded-box p-5 text-white  flex items-center hover:cursor-pointer"
29                  >
30                    {product.images ? (
31                      <img32                        src={product.images[0]}33                        className="h-16 w-16 rounded-xl"34                      />35                    ) : (
36                      <div className="h-16 w-16 bg-red-500 rounded-xl"></div>
37                    )}
img elements must have an alt prop, either with meaningful text, or an empty string for decorative images
13      <a>
14        <div className="hover:bg-gray-200 rounded-box flex items-center p-2 active:bg-gray-300">
15          {product.images && (
16            <img src={product.images[0]} className="h-16 w-16 object-contain" />17          )}
18          <div className="block ml-2">
19            <h1 className="text-xl ">{product.name}</h1>
img elements must have an alt prop, either with meaningful text, or an empty string for decorative images
 71                  tabIndex={0}
 72                  className="m-1 hover:bg-gray-300 p-0 md:p-2 rounded-box"
 73                >
 74                  <img src="/gearIcon.svg" className="h-5" /> 75                </div>
 76              </div>
 77            </div>