set the blur as always dark and add the possibility to overlay

This commit is contained in:
Reinaldo Neto 2023-07-04 12:31:59 -03:00
parent 53ed61df39
commit c85f98955c
5 changed files with 22 additions and 11 deletions

View File

@ -11,24 +11,22 @@ const BlurComponent = ({
loading = false, loading = false,
style = {}, style = {},
iconName, iconName,
blurAmount = 2 showOverlay = false
}: { }: {
loading: boolean; loading: boolean;
style: StyleProp<ViewStyle>; style: StyleProp<ViewStyle>;
iconName: TIconsName; iconName: TIconsName;
blurAmount?: number; showOverlay?: boolean;
}) => { }) => {
const { colors } = useTheme(); const { colors } = useTheme();
// const { theme, colors } = useTheme();
return ( return (
<> <>
<BlurView {!showOverlay ? (
style={[style, styles.blurView]} <BlurView style={[style, styles.blurView]} blurType={'dark'} blurAmount={2} />
blurType={'dark'} ) : (
// blurType={theme === 'light' ? 'light' : 'dark'} <View style={[style, styles.blurView, { backgroundColor: colors.overlayColor }]} />
blurAmount={blurAmount} )}
/>
<View style={[style, styles.blurIndicator]}> <View style={[style, styles.blurIndicator]}>
{loading ? <RCActivityIndicator size={54} /> : <CustomIcon color={colors.buttonText} name={iconName} size={54} />} {loading ? <RCActivityIndicator size={54} /> : <CustomIcon color={colors.buttonText} name={iconName} size={54} />}
</View> </View>

View File

@ -54,7 +54,9 @@ export const MessageImage = React.memo(({ imgUri, cached, loading }: { imgUri: s
source={{ uri: encodeURI(imgUri) }} source={{ uri: encodeURI(imgUri) }}
resizeMode={FastImage.resizeMode.cover} resizeMode={FastImage.resizeMode.cover}
/> />
{!cached ? <BlurComponent loading={loading} style={styles.image} iconName='arrow-down-circle' /> : null} {!cached ? (
<BlurComponent loading={loading} style={[styles.image, styles.imageBlurContainer]} iconName='arrow-down-circle' />
) : null}
</> </>
); );
}); });

View File

@ -88,7 +88,12 @@ const Thumbnail = ({ loading, video, cached }: { loading: boolean; video: string
return ( return (
<> <>
{thumbnailImage ? <FastImage style={styles.thumbnailImage} source={{ uri: thumbnailImage }} /> : null} {thumbnailImage ? <FastImage style={styles.thumbnailImage} source={{ uri: thumbnailImage }} /> : null}
<BlurComponent iconName={cached ? 'play-filled' : 'arrow-down-circle'} loading={loading} style={styles.button} /> <BlurComponent
iconName={cached ? 'play-filled' : 'arrow-down-circle'}
loading={loading}
style={styles.button}
showOverlay={cached}
/>
{loading ? <CancelIndicator /> : null} {loading ? <CancelIndicator /> : null}
</> </>
); );

View File

@ -105,6 +105,9 @@ export default StyleSheet.create({
borderWidth: 1, borderWidth: 1,
overflow: 'hidden' overflow: 'hidden'
}, },
imageBlurContainer: {
height: '100%'
},
imagePressed: { imagePressed: {
opacity: 0.5 opacity: 0.5
}, },

View File

@ -89,6 +89,7 @@ export const colors = {
conferenceCallEnabledIconBackground: '#156FF5', conferenceCallEnabledIconBackground: '#156FF5',
conferenceCallPhotoBackground: '#E4E7EA', conferenceCallPhotoBackground: '#E4E7EA',
textInputSecondaryBackground: '#E4E7EA', textInputSecondaryBackground: '#E4E7EA',
overlayColor: '#1F2329B2',
...mentions ...mentions
}, },
dark: { dark: {
@ -159,6 +160,7 @@ export const colors = {
conferenceCallEnabledIconBackground: '#156FF5', conferenceCallEnabledIconBackground: '#156FF5',
conferenceCallPhotoBackground: '#E4E7EA', conferenceCallPhotoBackground: '#E4E7EA',
textInputSecondaryBackground: '#030b1b', // backgroundColor textInputSecondaryBackground: '#030b1b', // backgroundColor
overlayColor: '#1F2329B2',
...mentions ...mentions
}, },
black: { black: {
@ -229,6 +231,7 @@ export const colors = {
conferenceCallEnabledIconBackground: '#156FF5', conferenceCallEnabledIconBackground: '#156FF5',
conferenceCallPhotoBackground: '#E4E7EA', conferenceCallPhotoBackground: '#E4E7EA',
textInputSecondaryBackground: '#000000', // backgroundColor textInputSecondaryBackground: '#000000', // backgroundColor
overlayColor: '#1F2329B2',
...mentions ...mentions
} }
}; };