mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-05-25 07:34:45 +00:00
Minor changes and fixes to docs
This commit is contained in:
@@ -34,6 +34,7 @@ const TouchableWithoutFeedbackScreen = () =>
|
||||
|
||||
<Section title="Props">
|
||||
<DocItem name="...View props" />
|
||||
|
||||
<DocItem
|
||||
name="delayLongPress"
|
||||
typeInfo="?number"
|
||||
@@ -43,6 +44,7 @@ const TouchableWithoutFeedbackScreen = () =>
|
||||
</AppText>
|
||||
}
|
||||
/>
|
||||
|
||||
<DocItem
|
||||
name="delayPressIn"
|
||||
typeInfo="?number"
|
||||
@@ -52,6 +54,7 @@ const TouchableWithoutFeedbackScreen = () =>
|
||||
</AppText>
|
||||
}
|
||||
/>
|
||||
|
||||
<DocItem
|
||||
name="delayPressOut"
|
||||
typeInfo="?number"
|
||||
@@ -61,6 +64,7 @@ const TouchableWithoutFeedbackScreen = () =>
|
||||
</AppText>
|
||||
}
|
||||
/>
|
||||
|
||||
<DocItem
|
||||
name="disabled"
|
||||
typeInfo="?boolean"
|
||||
@@ -73,14 +77,19 @@ const TouchableWithoutFeedbackScreen = () =>
|
||||
render: () => <TouchableWithoutFeedbackDisabled />
|
||||
}}
|
||||
/>
|
||||
<DocItem name="onLongPress" typeInfo="?function" />,
|
||||
|
||||
<DocItem name="onLongPress" typeInfo="?function" />
|
||||
|
||||
<DocItem
|
||||
name="onPress"
|
||||
typeInfo="?function"
|
||||
description="Called when the touch is released, but not if cancelled (e.g. by a scroll that steals the responder lock)."
|
||||
/>
|
||||
|
||||
<DocItem name="onPressIn" typeInfo="?function" />
|
||||
|
||||
<DocItem name="onPressOut" typeInfo="?function" />
|
||||
|
||||
<DocItem
|
||||
name="pressRetentionOffset"
|
||||
typeInfo="?{top: number, left: number, bottom: number, right: number}"
|
||||
@@ -90,6 +99,7 @@ back and you'll see that the button is once again reactivated! Move it back and
|
||||
forth several times while the scroll view is disabled. Ensure you pass in a
|
||||
constant to reduce memory allocations.`}
|
||||
/>
|
||||
|
||||
<DocItem name="style" typeInfo="?style" />
|
||||
</Section>
|
||||
|
||||
|
||||
@@ -233,9 +233,9 @@ const ViewScreen = () =>
|
||||
<AppText>
|
||||
Controls whether the View can be the target of touch events. The enhanced{' '}
|
||||
<Code>pointerEvents</Code> modes provided are not part of the CSS spec, therefore,{' '}
|
||||
<Code>pointerEvents</Code> is excluded from <Code>style</Code>.
|
||||
<Code>box-none</Code> preserves pointer events on the element's children;{' '}
|
||||
<Code>box-only</Code> disables pointer events on the element's children.
|
||||
<Code>pointerEvents</Code> is excluded from <Code>style</Code>. <Code>box-none</Code>{' '}
|
||||
preserves pointer events on the element's children; <Code>box-only</Code> disables
|
||||
pointer events on the element's children.
|
||||
</AppText>
|
||||
}
|
||||
example={{
|
||||
|
||||
@@ -11,6 +11,19 @@ import { StyleSheet, Text, View } from 'react-native';
|
||||
|
||||
const Divider = () => <View style={styles.verticalDivider} />;
|
||||
|
||||
const createDescription = description => {
|
||||
const nodeList = React.Children.toArray(description);
|
||||
if (nodeList.length === 1) {
|
||||
return (
|
||||
<Text>
|
||||
{nodeList}
|
||||
</Text>
|
||||
);
|
||||
} else {
|
||||
return insertBetween(() => <Divider key={Math.random()} />, nodeList);
|
||||
}
|
||||
};
|
||||
|
||||
const DocItem = ({ description, example = {}, name, typeInfo, label }) =>
|
||||
<View style={styles.example}>
|
||||
{name &&
|
||||
@@ -19,7 +32,7 @@ const DocItem = ({ description, example = {}, name, typeInfo, label }) =>
|
||||
</AppText>}
|
||||
{description &&
|
||||
<View style={styles.description}>
|
||||
{insertBetween(() => <Divider key={Math.random()} />, React.Children.toArray(description))}
|
||||
{createDescription(description)}
|
||||
</View>}
|
||||
{(example.render || example.code) &&
|
||||
<View style={styles.renderBox}>
|
||||
|
||||
Reference in New Issue
Block a user