@artsy/palette-mobile 17.29.0 → 17.30.0
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/README.md +1 -1
- package/dist/elements/Screen/Body.d.ts +13 -2
- package/dist/elements/Screen/Body.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ Artsy's Design System on Mobile
|
|
|
6
6
|
|
|
7
7
|
## Meta
|
|
8
8
|
|
|
9
|
-
- Point People: [@
|
|
9
|
+
- Point People: [@araujobarret](https://github.com/araujobarret) [@MrSltun](https://github.com/MrSltun)
|
|
10
10
|
- Palette for Web: [palette](https://github.com/artsy/palette)
|
|
11
11
|
|
|
12
12
|
## What is Palette?
|
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { type ScrollViewProps } from "react-native";
|
|
2
3
|
import { FlexProps } from "../Flex";
|
|
3
|
-
|
|
4
|
+
interface BodyBaseProps extends FlexProps {
|
|
4
5
|
fullwidth?: boolean;
|
|
5
|
-
scroll?: boolean;
|
|
6
6
|
disableKeyboardAvoidance?: boolean;
|
|
7
|
+
children?: React.ReactNode;
|
|
7
8
|
}
|
|
9
|
+
interface BodyScrollableProps extends BodyBaseProps {
|
|
10
|
+
scroll: true;
|
|
11
|
+
scrollViewProps?: ScrollViewProps;
|
|
12
|
+
}
|
|
13
|
+
interface BodyNonScrollableProps extends BodyBaseProps {
|
|
14
|
+
scroll?: false | undefined;
|
|
15
|
+
scrollViewProps?: never;
|
|
16
|
+
}
|
|
17
|
+
export type BodyProps = BodyScrollableProps | BodyNonScrollableProps;
|
|
8
18
|
export declare const Body: React.FC<BodyProps>;
|
|
19
|
+
export {};
|
|
@@ -3,9 +3,9 @@ import { Fragment } from "react";
|
|
|
3
3
|
import { KeyboardAvoidingView, Platform, ScrollView } from "react-native";
|
|
4
4
|
import { SCREEN_HORIZONTAL_PADDING } from "./constants";
|
|
5
5
|
import { Flex } from "../Flex";
|
|
6
|
-
export const Body = ({ children, fullwidth, scroll, disableKeyboardAvoidance = false, ...flexProps }) => {
|
|
6
|
+
export const Body = ({ children, fullwidth, scroll, disableKeyboardAvoidance = false, scrollViewProps, ...flexProps }) => {
|
|
7
7
|
const Wrapper = disableKeyboardAvoidance ? Fragment : KeyboardAvoidingView;
|
|
8
8
|
return (_jsx(Wrapper, { ...(disableKeyboardAvoidance
|
|
9
9
|
? {}
|
|
10
|
-
: { style: { flex: 1 }, behavior: Platform.OS === "ios" ? "padding" : "height" }), children: _jsx(Flex, { flex: 1, ...flexProps, children: _jsx(Flex, { flex: 1, px: fullwidth ? undefined : SCREEN_HORIZONTAL_PADDING, children: scroll ? _jsx(ScrollView, { children: children }) : children }) }) }));
|
|
10
|
+
: { style: { flex: 1 }, behavior: Platform.OS === "ios" ? "padding" : "height" }), children: _jsx(Flex, { flex: 1, ...flexProps, children: _jsx(Flex, { flex: 1, px: fullwidth ? undefined : SCREEN_HORIZONTAL_PADDING, children: scroll ? _jsx(ScrollView, { ...scrollViewProps, children: children }) : children }) }) }));
|
|
11
11
|
};
|
package/package.json
CHANGED