Merge pull request #915 from esteemapp/bugfix/reblog-option

Removed reblog option from reblogged posts
This commit is contained in:
Mustafa Buyukcelebi 2019-06-21 11:33:53 +03:00 committed by GitHub
commit 55e6306db7
5 changed files with 25 additions and 13 deletions

View File

@ -82,7 +82,7 @@ class PostCardContainer extends PureComponent {
}; };
render() { render() {
const { content, isHideImage, nsfw } = this.props; const { content, isHideImage, nsfw, isHideReblogOption } = this.props;
const { _content } = this.state; const { _content } = this.state;
const isNsfwPost = nsfw === '1'; const isNsfwPost = nsfw === '1';
@ -96,6 +96,7 @@ class PostCardContainer extends PureComponent {
content={_content || content} content={_content || content}
isHideImage={isHideImage} isHideImage={isHideImage}
isNsfwPost={isNsfwPost} isNsfwPost={isNsfwPost}
isHideReblogOption={isHideReblogOption}
/> />
); );
} }

View File

@ -68,7 +68,7 @@ class PostCardView extends Component {
}; };
render() { render() {
const { content, isHideImage, fetchPost, isNsfwPost } = this.props; const { content, isHideImage, fetchPost, isNsfwPost, isHideReblogOption } = this.props;
const _image = this._getPostImage(content, isNsfwPost); const _image = this._getPostImage(content, isNsfwPost);
const reblogedBy = content.reblogged_by && content.reblogged_by[0]; const reblogedBy = content.reblogged_by && content.reblogged_by[0];
@ -88,7 +88,11 @@ class PostCardView extends Component {
reblogedBy={reblogedBy} reblogedBy={reblogedBy}
/> />
<View style={styles.dropdownWrapper}> <View style={styles.dropdownWrapper}>
<PostDropdown content={content} fetchPost={fetchPost} /> <PostDropdown
isHideReblogOption={isHideReblogOption}
content={content}
fetchPost={fetchPost}
/>
</View> </View>
</View> </View>
<View style={styles.postBodyWrapper}> <View style={styles.postBodyWrapper}>

View File

@ -173,10 +173,10 @@ class PostDropdownContainer extends PureComponent {
}; };
render() { render() {
const { intl, currentAccount, content } = this.props; const { intl, currentAccount, content, isHideReblogOption } = this.props;
let _OPTIONS = OPTIONS; let _OPTIONS = OPTIONS;
if (content && content.author === currentAccount.name) { if ((content && content.author === currentAccount.name) || isHideReblogOption) {
_OPTIONS = OPTIONS.filter(item => item !== 'reblog'); _OPTIONS = OPTIONS.filter(item => item !== 'reblog');
} }

View File

@ -228,6 +228,7 @@ class PostsView extends Component {
isLoginDone, isLoginDone,
tag, tag,
isDarkTheme, isDarkTheme,
isHideReblogOption,
} = this.props; } = this.props;
return ( return (
@ -262,7 +263,12 @@ class PostsView extends Component {
data={posts} data={posts}
showsVerticalScrollIndicator={false} showsVerticalScrollIndicator={false}
renderItem={({ item }) => ( renderItem={({ item }) => (
<PostCard isRefresh={refreshing} content={item} isHideImage={isHideImage} /> <PostCard
isHideReblogOption={isHideReblogOption}
isRefresh={refreshing}
content={item}
isHideImage={isHideImage}
/>
)} )}
keyExtractor={(post, index) => index.toString()} keyExtractor={(post, index) => index.toString()}
onEndReached={() => this._loadPosts()} onEndReached={() => this._loadPosts()}

View File

@ -206,6 +206,7 @@ class ProfileScreen extends PureComponent {
tag={username} tag={username}
key={username} key={username}
handleOnScroll={this._handleOnScroll} handleOnScroll={this._handleOnScroll}
isHideReblogOption
/> />
</View> </View>
<View <View