using fast image instead of progressive image

This commit is contained in:
Nouman Tahir 2022-09-23 12:33:55 +05:00
parent 6e8a744d35
commit 275deb5976
2 changed files with 18 additions and 31 deletions

View File

@ -14,16 +14,9 @@ export default EStyleSheet.create({
body: {
marginHorizontal: 9,
},
image: {
margin: 0,
alignItems: 'center',
alignSelf: 'center',
//height: 200,
//width: '$deviceWidth - 16',
borderRadius: 8,
backgroundColor: '$primaryLightGray',
// paddingVertical: 10,
marginVertical: 5,
thumbnail: {
width: '$deviceWidth - 16',
height: 300
},
postDescripton: {
flexDirection: 'column',

View File

@ -1,5 +1,5 @@
import React, { useRef, useState, useEffect, Fragment } from 'react';
import { View, Text, TouchableOpacity, Image } from 'react-native';
import { View, Text, TouchableOpacity } from 'react-native';
import { injectIntl } from 'react-intl';
// Utils
@ -8,20 +8,14 @@ import { getTimeFromNow } from '../../../utils/time';
// Components
import { PostHeaderDescription } from '../../postElements';
import { IconButton } from '../../iconButton';
import ProgressiveImage from '../../progressiveImage';
import { OptionsModal } from '../../atoms';
// Styles
import styles from './draftListItemStyles';
import { ScheduledPostStatus } from '../../../providers/ecency/ecency.types';
import { PopoverWrapper } from '../../popoverWrapper/popoverWrapperView';
import getWindowDimensions from '../../../utils/getWindowDimensions';
import FastImage from 'react-native-fast-image';
// Defaults
const DEFAULT_IMAGE =
'https://images.ecency.com/DQmT8R33geccEjJfzZEdsRHpP3VE8pu3peRCnQa1qukU4KR/no_image_3x.png';
const dim = getWindowDimensions();
const DraftListItemView = ({
title,
@ -65,24 +59,24 @@ const DraftListItemView = ({
status === ScheduledPostStatus.PENDING
? intl.formatMessage({ id: 'schedules.pending' })
: status === ScheduledPostStatus.POSTPONED
? intl.formatMessage({ id: 'schedules.postponed' })
: status === ScheduledPostStatus.PUBLISHED
? intl.formatMessage({ id: 'schedules.published' })
: intl.formatMessage({ id: 'schedules.error' });
? intl.formatMessage({ id: 'schedules.postponed' })
: status === ScheduledPostStatus.PUBLISHED
? intl.formatMessage({ id: 'schedules.published' })
: intl.formatMessage({ id: 'schedules.error' });
const statusIcon =
status === ScheduledPostStatus.PENDING
? 'timer'
: status === ScheduledPostStatus.POSTPONED
? 'schedule'
: status === ScheduledPostStatus.PUBLISHED
? 'check-circle'
: 'error';
? 'schedule'
: status === ScheduledPostStatus.PUBLISHED
? 'check-circle'
: 'error';
const statusIconColor =
status === ScheduledPostStatus.PUBLISHED
? '#4FD688'
: status === ScheduledPostStatus.ERROR
? '#e63535'
: '#c1c5c7';
? '#e63535'
: '#c1c5c7';
return (
<Fragment>
@ -125,10 +119,10 @@ const DraftListItemView = ({
<View style={styles.body}>
<TouchableOpacity onPress={_onItemPress}>
{image !== null && (
<ProgressiveImage
<FastImage
source={image}
thumbnailSource={thumbnail}
style={[styles.thumbnail, { width: dim.width - 16, height: 300 }]}
style={styles.thumbnail}
resizeMode={FastImage.resizeMode.cover}
/>
)}
<View style={[styles.postDescripton]}>