added place holder for boost

This commit is contained in:
u-e 2019-08-04 15:51:43 +03:00
parent 11f027343f
commit 0f0d5410e5
3 changed files with 14 additions and 9 deletions

View File

@ -6,10 +6,13 @@ export default EStyleSheet.create({
borderColor: '$primaryLightBackground', borderColor: '$primaryLightBackground',
marginRight: 0, marginRight: 0,
marginLeft: 0, marginLeft: 0,
flex: 1, flexDirection: 'column',
flexDirection: 'row',
}, },
paragraphWrapper: { paragraphWrapper: {
marginLeft: 50, marginLeft: 50,
}, },
line: {
flexDirection: 'row',
marginVertical: 10,
},
}); });

View File

@ -1,5 +1,5 @@
/* eslint-disable radix */ /* eslint-disable radix */
import React, { Fragment } from 'react'; import React from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { Dimensions, View } from 'react-native'; import { Dimensions, View } from 'react-native';
import times from 'lodash/times'; import times from 'lodash/times';
@ -11,15 +11,17 @@ const HEIGHT = Dimensions.get('window').height;
const BoostPlaceHolder = ({ isDarkTheme }) => { const BoostPlaceHolder = ({ isDarkTheme }) => {
const color = isDarkTheme ? '#2e3d51' : '#f5f5f5'; const color = isDarkTheme ? '#2e3d51' : '#f5f5f5';
const ratio = (HEIGHT - 300) / 50; const ratio = (HEIGHT - 300) / 50 / 1.3;
const listElements = []; const listElements = [];
times(parseInt(ratio), i => { times(parseInt(ratio), i => {
listElements.push( listElements.push(
<View key={i}> <View style={styles.container} key={i}>
<Placeholder.Box width={90} height={40} /> <View style={styles.line}>
<Placeholder.Box color={color} width={90} height={40} animate="fade" />
<View style={styles.paragraphWrapper}> <View style={styles.paragraphWrapper}>
<Placeholder.Box width={120} radius={20} height={40} /> <Placeholder.Box color={color} width={120} radius={20} height={40} animate="fade" />
</View>
</View> </View>
</View>, </View>,
); );

View File

@ -62,7 +62,7 @@ class BoostScreen extends PureComponent {
})} })}
/> />
{true ? ( {isLoading ? (
<BoostPlaceHolder /> <BoostPlaceHolder />
) : ( ) : (
productList.map(item => ( productList.map(item => (