Added safearea for editor and post display screen

This commit is contained in:
Mustafa Buyukcelebi 2019-09-05 17:29:09 +03:00
parent cc1ac43f28
commit 65c7dad230
3 changed files with 61 additions and 56 deletions

View File

@ -9,9 +9,10 @@ export default EStyleSheet.create({
justifyContent: 'space-between',
width: '$deviceWidth',
height: 50,
shadowOpacity: 0.2,
shadowOpacity: 0.1,
shadowOffset: {
height: 1.5,
width: 0,
height: -3,
},
elevation: 3,
},

View File

@ -1,9 +1,11 @@
import React from 'react';
import { View } from 'react-native';
import { View, SafeAreaView } from 'react-native';
import styles from './stickyBarStyles';
const StickyBar = ({ children, isFixedFooter }) => (
<View style={[styles.container, isFixedFooter && styles.fixedFooter]}>{children}</View>
<SafeAreaView>
<View style={[styles.container, isFixedFooter && styles.fixedFooter]}>{children}</View>
</SafeAreaView>
);
export default StickyBar;

View File

@ -1,5 +1,5 @@
import React, { PureComponent, Fragment } from 'react';
import { View, Text, ScrollView, Dimensions } from 'react-native';
import { View, Text, ScrollView, Dimensions, SafeAreaView } from 'react-native';
import { injectIntl } from 'react-intl';
import get from 'lodash/get';
import ActionSheet from 'react-native-actionsheet';
@ -77,68 +77,70 @@ class PostDisplayView extends PureComponent {
} = this.props;
return (
<StickyBar isFixedFooter={isFixedFooter}>
<View style={styles.stickyWrapper}>
<Upvote fetchPost={fetchPost} isShowPayoutValue content={post} />
<TextWithIcon
iconName="people"
iconStyle={styles.barIcons}
iconType="MaterialIcons"
isClickable
onPress={() => handleOnVotersPress && handleOnVotersPress(get(post, 'active_votes'))}
text={get(post, 'vote_count', 0)}
textMarginLeft={20}
/>
<TextWithIcon
iconName="comment"
iconStyle={styles.barIcons}
iconType="MaterialIcons"
isClickable
text={get(post, 'children', 0)}
textMarginLeft={20}
/>
<TextWithIcon
iconName="repeat"
iconStyle={styles.barIcons}
iconType="MaterialIcons"
isClickable
onPress={() => handleOnReblogsPress && handleOnReblogsPress(get(post, 'reblogs'))}
text={get(post, 'reblogCount', 0)}
textMarginLeft={20}
/>
<View style={styles.stickyRightWrapper}>
{get(currentAccount, 'name') === get(post, 'author') && (
<Fragment>
{!get(post, 'children') && !get(post, 'vote_count') && (
<SafeAreaView>
<StickyBar isFixedFooter={isFixedFooter}>
<View style={styles.stickyWrapper}>
<Upvote fetchPost={fetchPost} isShowPayoutValue content={post} />
<TextWithIcon
iconName="people"
iconStyle={styles.barIcons}
iconType="MaterialIcons"
isClickable
onPress={() => handleOnVotersPress && handleOnVotersPress(get(post, 'active_votes'))}
text={get(post, 'vote_count', 0)}
textMarginLeft={20}
/>
<TextWithIcon
iconName="comment"
iconStyle={styles.barIcons}
iconType="MaterialIcons"
isClickable
text={get(post, 'children', 0)}
textMarginLeft={20}
/>
<TextWithIcon
iconName="repeat"
iconStyle={styles.barIcons}
iconType="MaterialIcons"
isClickable
onPress={() => handleOnReblogsPress && handleOnReblogsPress(get(post, 'reblogs'))}
text={get(post, 'reblogCount', 0)}
textMarginLeft={20}
/>
<View style={styles.stickyRightWrapper}>
{get(currentAccount, 'name') === get(post, 'author') && (
<Fragment>
{!get(post, 'children') && !get(post, 'vote_count') && (
<IconButton
iconStyle={styles.barIconRight}
iconType="MaterialIcons"
name="delete-forever"
onPress={() => this.ActionSheet.show()}
style={styles.barIconButton}
/>
)}
<IconButton
iconStyle={styles.barIconRight}
iconType="MaterialIcons"
name="delete-forever"
onPress={() => this.ActionSheet.show()}
name="create"
onPress={() => handleOnEditPress && handleOnEditPress()}
style={styles.barIconButton}
/>
)}
</Fragment>
)}
{isLoggedIn && (
<IconButton
iconStyle={styles.barIconRight}
iconType="MaterialIcons"
name="create"
onPress={() => handleOnEditPress && handleOnEditPress()}
name="reply"
onPress={() => handleOnReplyPress && handleOnReplyPress()}
style={styles.barIconButton}
/>
</Fragment>
)}
{isLoggedIn && (
<IconButton
iconStyle={styles.barIconRight}
iconType="MaterialIcons"
name="reply"
onPress={() => handleOnReplyPress && handleOnReplyPress()}
style={styles.barIconButton}
/>
)}
)}
</View>
</View>
</View>
</StickyBar>
</StickyBar>
</SafeAreaView>
);
};