mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-08-15 18:45:06 +00:00
Update prettier and linter
This commit is contained in:
@@ -376,9 +376,10 @@ const TouchableMixin = {
|
||||
this.state.touchable.touchState = States.NOT_RESPONDER;
|
||||
this.state.touchable.responderID = dispatchID;
|
||||
this._receiveSignal(Signals.RESPONDER_GRANT, e);
|
||||
let delayMS = this.touchableGetHighlightDelayMS !== undefined
|
||||
? Math.max(this.touchableGetHighlightDelayMS(), 0)
|
||||
: HIGHLIGHT_DELAY_MS;
|
||||
let delayMS =
|
||||
this.touchableGetHighlightDelayMS !== undefined
|
||||
? Math.max(this.touchableGetHighlightDelayMS(), 0)
|
||||
: HIGHLIGHT_DELAY_MS;
|
||||
delayMS = isNaN(delayMS) ? HIGHLIGHT_DELAY_MS : delayMS;
|
||||
if (delayMS !== 0) {
|
||||
this.touchableDelayTimeout = setTimeout(this._handleDelay.bind(this, e), delayMS);
|
||||
@@ -386,9 +387,10 @@ const TouchableMixin = {
|
||||
this._handleDelay(e);
|
||||
}
|
||||
|
||||
let longDelayMS = this.touchableGetLongPressDelayMS !== undefined
|
||||
? Math.max(this.touchableGetLongPressDelayMS(), 10)
|
||||
: LONG_PRESS_DELAY_MS;
|
||||
let longDelayMS =
|
||||
this.touchableGetLongPressDelayMS !== undefined
|
||||
? Math.max(this.touchableGetLongPressDelayMS(), 10)
|
||||
: LONG_PRESS_DELAY_MS;
|
||||
longDelayMS = isNaN(longDelayMS) ? LONG_PRESS_DELAY_MS : longDelayMS;
|
||||
this.longPressDelayTimeout = setTimeout(
|
||||
this._handleLongDelay.bind(this, e),
|
||||
|
||||
@@ -180,9 +180,10 @@ const TouchableWithoutFeedback = createReactClass({
|
||||
children = React.Children.toArray(children);
|
||||
children.push(Touchable.renderDebugView({ color: 'red', hitSlop: this.props.hitSlop }));
|
||||
}
|
||||
const style = Touchable.TOUCH_TARGET_DEBUG && child.type && child.type.displayName === 'Text'
|
||||
? [styles.root, this.props.disabled && styles.disabled, child.props.style, { color: 'red' }]
|
||||
: [styles.root, this.props.disabled && styles.disabled, child.props.style];
|
||||
const style =
|
||||
Touchable.TOUCH_TARGET_DEBUG && child.type && child.type.displayName === 'Text'
|
||||
? [styles.root, this.props.disabled && styles.disabled, child.props.style, { color: 'red' }]
|
||||
: [styles.root, this.props.disabled && styles.disabled, child.props.style];
|
||||
return (React: any).cloneElement(child, {
|
||||
...other,
|
||||
accessible: this.props.accessible !== false,
|
||||
|
||||
@@ -38,12 +38,13 @@ class UnimplementedView extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
const unimplementedViewStyles = process.env.NODE_ENV !== 'production'
|
||||
? {
|
||||
alignSelf: 'flex-start',
|
||||
borderColor: 'red',
|
||||
borderWidth: 1
|
||||
}
|
||||
: {};
|
||||
const unimplementedViewStyles =
|
||||
process.env.NODE_ENV !== 'production'
|
||||
? {
|
||||
alignSelf: 'flex-start',
|
||||
borderColor: 'red',
|
||||
borderWidth: 1
|
||||
}
|
||||
: {};
|
||||
|
||||
export default UnimplementedView;
|
||||
|
||||
@@ -14,7 +14,11 @@ describe('components/View', () => {
|
||||
|
||||
test('prop "children"', () => {
|
||||
const children = <View testID="1" />;
|
||||
const component = shallow(<View>{children}</View>);
|
||||
const component = shallow(
|
||||
<View>
|
||||
{children}
|
||||
</View>
|
||||
);
|
||||
expect(component.contains(children)).toEqual(true);
|
||||
});
|
||||
|
||||
|
||||
Vendored
+10
-8
@@ -22,17 +22,19 @@ var TouchHistoryMath = {
|
||||
var total = 0;
|
||||
var count = 0;
|
||||
|
||||
var oneTouchData = touchHistory.numberActiveTouches === 1
|
||||
? touchHistory.touchBank[touchHistory.indexOfSingleActiveTouch]
|
||||
: null;
|
||||
var oneTouchData =
|
||||
touchHistory.numberActiveTouches === 1
|
||||
? touchHistory.touchBank[touchHistory.indexOfSingleActiveTouch]
|
||||
: null;
|
||||
|
||||
if (oneTouchData !== null) {
|
||||
if (oneTouchData.touchActive && oneTouchData.currentTimeStamp > touchesChangedAfter) {
|
||||
total += ofCurrent && isXAxis
|
||||
? oneTouchData.currentPageX
|
||||
: ofCurrent && !isXAxis
|
||||
? oneTouchData.currentPageY
|
||||
: !ofCurrent && isXAxis ? oneTouchData.previousPageX : oneTouchData.previousPageY;
|
||||
total +=
|
||||
ofCurrent && isXAxis
|
||||
? oneTouchData.currentPageX
|
||||
: ofCurrent && !isXAxis
|
||||
? oneTouchData.currentPageY
|
||||
: !ofCurrent && isXAxis ? oneTouchData.previousPageX : oneTouchData.previousPageY;
|
||||
count = 1;
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user