@jobber/components 4.48.0 → 4.48.1
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/dist/DataList/index.js +13 -0
- package/package.json +2 -2
package/dist/DataList/index.js
CHANGED
|
@@ -101,6 +101,19 @@ function useDataListContext() {
|
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
function useMediaQuery(CSSMediaQuery) {
|
|
104
|
+
/**
|
|
105
|
+
* matchMedia have had full support for browsers since 2012 but jest, being a
|
|
106
|
+
* lite version of a DOM, doesn't support it.
|
|
107
|
+
*
|
|
108
|
+
* Instead of the consumers mocking matchMedia on every usage of DataList,
|
|
109
|
+
* we can just return true to mimic the largest screen we support.
|
|
110
|
+
*
|
|
111
|
+
* In the event that the consumer wants to test the DataList on different
|
|
112
|
+
* screen sizes, they can use the `mockViewportWidth` function from
|
|
113
|
+
* `@jobber/components/useBreakpoints`.
|
|
114
|
+
*/
|
|
115
|
+
if (window.matchMedia === undefined)
|
|
116
|
+
return true;
|
|
104
117
|
const [matches, setMatches] = React.useState(window.matchMedia(CSSMediaQuery).matches);
|
|
105
118
|
React.useEffect(() => {
|
|
106
119
|
const media = window.matchMedia(CSSMediaQuery);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components",
|
|
3
|
-
"version": "4.48.
|
|
3
|
+
"version": "4.48.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"> 1%",
|
|
85
85
|
"IE 10"
|
|
86
86
|
],
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "d02107aa8aedd77eec1afd0ba33adea7c278e9b4"
|
|
88
88
|
}
|