gatsby-core-theme 44.1.7 → 44.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/package.json +1 -1
- package/src/hooks/lazy-image/index.js +8 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
## [44.1.8](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.1.7...v44.1.8) (2025-06-09)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* load defaultImg if there is no src ([34ed7d7](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/34ed7d77139f27b55e7ae05ea256c024b664727a))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
* Merge branch 'tm-5506-load-deafult-img' into 'master' ([f65e038](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/f65e038d2e307cc87775f01478807d0ed3df4e99))
|
|
10
|
+
|
|
1
11
|
## [44.1.7](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.1.6...v44.1.7) (2025-06-09)
|
|
2
12
|
|
|
3
13
|
|
package/package.json
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import React from
|
|
1
|
+
import React from "react";
|
|
2
2
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
3
|
-
import PropTypes from
|
|
4
|
-
|
|
3
|
+
import PropTypes from "prop-types";
|
|
5
4
|
|
|
6
5
|
export default function LazyImage({
|
|
7
6
|
height,
|
|
8
7
|
width,
|
|
9
8
|
style = {},
|
|
10
9
|
className,
|
|
11
|
-
src =
|
|
12
|
-
alt =
|
|
10
|
+
src = "#",
|
|
11
|
+
alt = "",
|
|
13
12
|
defaultImg,
|
|
14
|
-
loading =
|
|
13
|
+
loading = "lazy",
|
|
15
14
|
}) {
|
|
16
|
-
if (defaultImg && !src) {
|
|
15
|
+
if (defaultImg && (!src || src === "#")) {
|
|
17
16
|
return defaultImg;
|
|
18
17
|
}
|
|
19
18
|
|
|
@@ -21,10 +20,10 @@ export default function LazyImage({
|
|
|
21
20
|
<img
|
|
22
21
|
src={src}
|
|
23
22
|
loading={loading}
|
|
24
|
-
className={className ||
|
|
23
|
+
className={className || ""}
|
|
25
24
|
height={height}
|
|
26
25
|
width={width}
|
|
27
|
-
alt={alt ===
|
|
26
|
+
alt={alt === "null" ? "" : alt}
|
|
28
27
|
style={style}
|
|
29
28
|
/>
|
|
30
29
|
);
|