Skip to content

Commit e5d843c

Browse files
committed
client(LineInput.tsx): add an onError function inside the src tag to hide it when the url throws an error 404
1 parent b2890bc commit e5d843c

File tree

8 files changed

+28
-26
lines changed

8 files changed

+28
-26
lines changed

client/build/asset-manifest.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/build/index.html

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/build/static/css/main.ade749d0.css renamed to client/build/static/css/main.2ae52a35.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/build/static/css/main.ade749d0.css.map renamed to client/build/static/css/main.2ae52a35.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/build/static/js/main.12fff70b.js renamed to client/build/static/js/main.742c82d7.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/build/static/js/main.12fff70b.js.map renamed to client/build/static/js/main.742c82d7.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/src/components/input/LineInput.tsx

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -105,19 +105,21 @@ const LineInput: FC<InputProps> = (props) => {
105105
cursor-pointer border border-solid border-gh-bg-secondary
106106
hover:border-gh-red transition-all duration-150"
107107
>
108-
<div className="text-gh-text-secondary">
109-
<img
110-
className="w-4 h-4"
111-
src={`https://cdn.simpleicons.org/${badge.iconName}/${
112-
badge.color === "auto"
113-
? ""
114-
: badge.color.replace("#", "")
115-
}`}
116-
alt=""
117-
/>
118-
</div>
108+
<img
109+
onError={(e) => {
110+
(e.target as HTMLImageElement).style.display = "none";
111+
}}
112+
className="w-4 h-4"
113+
src={`https://cdn.simpleicons.org/${badge.iconName}/${
114+
badge.color === "auto" ? "" : badge.color.replace("#", "")
115+
}`}
116+
alt=""
117+
/>
119118

120-
<div className="font-semibold text-white font-dejavu text-[.7rem] tracking-wider">
119+
<div
120+
className="font-semibold text-white font-dejavu text-[.7rem]
121+
tracking-wider py-[.145rem]"
122+
>
121123
{badge.label.toUpperCase()}
122124
</div>
123125
</div>

0 commit comments

Comments
 (0)