@storybook/react-native-ui-common 10.0.1 → 10.0.2-alpha.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/index.js +1 -1
- package/package.json +3 -3
- package/src/LayoutProvider.tsx +2 -4
package/dist/index.js
CHANGED
|
@@ -220,7 +220,7 @@ var LayoutContext = (0, import_react3.createContext)({
|
|
|
220
220
|
});
|
|
221
221
|
var LayoutProvider = ({ children }) => {
|
|
222
222
|
const { width } = (0, import_react_native.useWindowDimensions)();
|
|
223
|
-
const isDesktop = width >= BREAKPOINT;
|
|
223
|
+
const isDesktop = import_react_native.Platform.OS === "macos" || import_react_native.Platform.OS === "windows" || width >= BREAKPOINT;
|
|
224
224
|
const isMobile = !isDesktop;
|
|
225
225
|
const contextValue = (0, import_react3.useMemo)(
|
|
226
226
|
() => ({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/react-native-ui-common",
|
|
3
|
-
"version": "10.0.1",
|
|
3
|
+
"version": "10.0.2-alpha.1",
|
|
4
4
|
"description": "common ui components for react native storybook",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@storybook/react": "^10.0.1",
|
|
61
|
-
"@storybook/react-native-theming": "^10.0.1",
|
|
61
|
+
"@storybook/react-native-theming": "^10.0.2-alpha.1",
|
|
62
62
|
"es-toolkit": "^1.41.0",
|
|
63
63
|
"fuse.js": "^7.1.0",
|
|
64
64
|
"memoizerific": "^1.11.3",
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"publishConfig": {
|
|
76
76
|
"access": "public"
|
|
77
77
|
},
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "14fb007dc99d435fd405054b84bedb38b96ab8c5"
|
|
79
79
|
}
|
package/src/LayoutProvider.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FC, PropsWithChildren } from 'react';
|
|
2
2
|
import { createContext, useContext, useMemo } from 'react';
|
|
3
|
-
import { useWindowDimensions } from 'react-native';
|
|
3
|
+
import { Platform, useWindowDimensions } from 'react-native';
|
|
4
4
|
import { BREAKPOINT } from './constants';
|
|
5
5
|
|
|
6
6
|
type LayoutContextType = {
|
|
@@ -15,11 +15,9 @@ const LayoutContext = createContext<LayoutContextType>({
|
|
|
15
15
|
|
|
16
16
|
export const LayoutProvider: FC<PropsWithChildren> = ({ children }) => {
|
|
17
17
|
const { width } = useWindowDimensions();
|
|
18
|
-
const isDesktop = width >= BREAKPOINT;
|
|
18
|
+
const isDesktop = Platform.OS === 'macos' || Platform.OS === 'windows' || width >= BREAKPOINT;
|
|
19
19
|
const isMobile = !isDesktop;
|
|
20
20
|
|
|
21
|
-
// console.log({ isDesktop, isMobile, breakpoint: BREAKPOINT, width });
|
|
22
|
-
|
|
23
21
|
const contextValue = useMemo(
|
|
24
22
|
() => ({
|
|
25
23
|
isDesktop,
|