forked from Ivasoft/mattermost-mobile
* Fix search bar style * MM-42983 Align mention badge on channel list item * MM-42985 polish channel intro UI * MM-42984 update fonts on 'Show' bottom sheet * MM-42982 Increase tap area of back button on channel view * Set StatusBar style based on theme sidebarBg * Reconnect other WS after 20 seconds insted of 5 * Only fetch missing profiles for DM/GMs * Database prepare records optimization * Do not use fallbackUsername for storing GM/DM in the database * fix filter for fetching missing dm/gm * remove use of indexOf inside another loop * remove use of includes inside another loop * remove use of find inside another loop * Add missing translations * disable Flipper on iOS * Remove Flipper code from AppDelegate * feedback review * trim DM display name to make sure is not empty * fixing missing direct channels display name * UI/UX feedback * fix WS channel viewed and mark as unread * Remove duplicate emojis from reaction bar
58 lines
1.8 KiB
TypeScript
58 lines
1.8 KiB
TypeScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
/* eslint-disable new-cap */
|
|
|
|
import React, {memo} from 'react';
|
|
import {Touchable, TouchableOpacity, TouchableNativeFeedback, TouchableWithoutFeedback, View, StyleProp, ViewStyle} from 'react-native';
|
|
|
|
type TouchableProps = Touchable & {
|
|
children: React.ReactNode | React.ReactNode[];
|
|
borderlessRipple?: boolean;
|
|
rippleRadius?: number;
|
|
style?: StyleProp<ViewStyle>;
|
|
testID: string;
|
|
type: 'native' | 'opacity' | 'none';
|
|
underlayColor: string;
|
|
}
|
|
|
|
const TouchableWithFeedbackAndroid = ({borderlessRipple = false, children, rippleRadius, testID, type = 'native', underlayColor, ...props}: TouchableProps) => {
|
|
switch (type) {
|
|
case 'native':
|
|
return (
|
|
<TouchableNativeFeedback
|
|
testID={testID}
|
|
{...props}
|
|
style={[props.style]}
|
|
background={TouchableNativeFeedback.Ripple(underlayColor || '#fff', borderlessRipple, rippleRadius)}
|
|
>
|
|
<View>
|
|
{children}
|
|
</View>
|
|
</TouchableNativeFeedback>
|
|
);
|
|
case 'opacity':
|
|
return (
|
|
<TouchableOpacity
|
|
testID={testID}
|
|
{...props}
|
|
>
|
|
{children}
|
|
</TouchableOpacity>
|
|
);
|
|
case 'none':
|
|
return (
|
|
<TouchableWithoutFeedback
|
|
testID={testID}
|
|
{...props}
|
|
>
|
|
{children}
|
|
</TouchableWithoutFeedback>
|
|
);
|
|
}
|
|
|
|
return null;
|
|
};
|
|
|
|
export default memo(TouchableWithFeedbackAndroid);
|