* Started with Channel Post List * Added markdown hashtag * Added TouchableWithFeedback component * Added utils/bottom_sheet * Removed BottomSheet in favor of future SlideUpPanel * Added markdown_block_quote * Added markdown_list_item * Added markdown_list * Added MarkDownTableCell component * Markdown_table - in progress - need to verify TS * Added markdown_table * Update Podfile.lock * Added deep_linking constant * Added utils/draft * Update config to include ExperimentalNormalizeMarkdownLinks * Added markdown_link * Added markdown_table_row * Added ProgressiveImage and RetriableImage components and images utils * Converted Retriable component to functional component * Added type definition for commonmark * Continuing with markdown TS * Markdown - Typing props [ in progress ] * Fix boolean flag with mardown block quote * Adding observable config to markdown_link * TS Fixes [ in progress ] * TS fixes * TS fixes - TextStyles * Update markdown.tsx * TS fixes on markdown * TS Fixes - AtMention component * AtMention [ IN PROGRESS ] * Add markdown support * Fix emoji and jumboEmoji on iOS * Fix handleMyTeam operator * Fix navigation style based on theme * Fix iOS MattermostManaged deleteDatabse return error type * wrap setNavigationStackStyles under a requestAnimationFrame * Add preventDoubleTap to channel mention * Increase double tap to 750ms * Fix handleReceivedPostsInChannel chunk query * Set initial navigation theme * Swizzle FastImage on iOS * fix preventDoubleTap test Co-authored-by: Avinash Lingaloo <> Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
44 lines
1.3 KiB
TypeScript
44 lines
1.3 KiB
TypeScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import React from 'react';
|
|
import {Animated, StyleProp, StyleSheet} from 'react-native';
|
|
import FastImage, {ImageStyle, Source} from 'react-native-fast-image';
|
|
|
|
const AnimatedFastImage = Animated.createAnimatedComponent(FastImage);
|
|
|
|
type ThumbnailProps = {
|
|
onError: () => void;
|
|
opacity?: number | Animated.AnimatedInterpolation | Animated.AnimatedValue;
|
|
source?: Source;
|
|
style: StyleProp<ImageStyle>;
|
|
}
|
|
|
|
const Thumbnail = ({onError, opacity, style, source}: ThumbnailProps) => {
|
|
if (source?.uri) {
|
|
return (
|
|
<AnimatedFastImage
|
|
onError={onError}
|
|
resizeMode='cover'
|
|
source={source}
|
|
style={style}
|
|
testID='progressive_image.miniPreview'
|
|
/>
|
|
);
|
|
}
|
|
|
|
const tintColor = StyleSheet.flatten(style).tintColor;
|
|
|
|
return (
|
|
<AnimatedFastImage
|
|
resizeMode='contain'
|
|
onError={onError}
|
|
source={require('@assets/images/thumb.png')}
|
|
style={[style, {opacity}]}
|
|
testID='progressive_image.thumbnail'
|
|
tintColor={tintColor}
|
|
/>
|
|
);
|
|
};
|
|
|
|
export default Thumbnail;
|