revert post summary

This commit is contained in:
feruz 2020-01-12 04:41:13 +02:00
parent 35450168c2
commit 16576aa25d
8 changed files with 20 additions and 3 deletions

View File

@ -2,7 +2,6 @@ import React from 'react';
import { View, Text, TouchableOpacity } from 'react-native';
import { withNavigation } from 'react-navigation';
import get from 'lodash/get';
import { postBodySummary } from '@esteemapp/esteem-render-helpers';
import { default as ROUTES } from '../../../constants/routeNames';
import styles from './parentPostStyles';
@ -26,7 +25,7 @@ const ParentPost = props => {
}
>
<Text style={styles.title}>{get(post, 'title')}</Text>
<Text style={styles.description}>{postBodySummary(post, 100)}</Text>
<Text style={styles.description}>{get(post, 'summary')}</Text>
</TouchableOpacity>
</View>
);

View File

@ -51,6 +51,10 @@ export default EStyleSheet.create({
marginVertical: 12,
color: '$primaryBlack',
},
summary: {
fontSize: 13,
color: '$primaryDarkGray',
},
bodyFooter: {
backgroundColor: '$primaryBackgroundColor',
flexDirection: 'row',

View File

@ -117,6 +117,7 @@ class PostCardView extends Component {
)}
<View style={[styles.postDescripton]}>
<Text style={styles.title}>{content.title}</Text>
<Text style={styles.summary}>{content.summary}</Text>
</View>
</TouchableOpacity>

View File

@ -39,6 +39,10 @@ export default EStyleSheet.create({
fontWeight: 'bold',
color: '$primaryBlack',
},
summary: {
fontSize: 13,
color: '$primaryDarkText',
},
header: {
backgroundColor: '$primaryBackgroundColor',
flexDirection: 'row',

View File

@ -19,6 +19,7 @@ import styles from './postListItemStyles';
const PostListItemView = ({
title,
summary,
mainTag,
username,
reputation,
@ -62,6 +63,7 @@ const PostListItemView = ({
<FastImage source={image} style={styles.image} defaultSource={DEFAULT_IMAGE} />
<View style={[styles.postDescripton]}>
<Text style={styles.title}>{title}</Text>
<Text style={styles.summary}>{summary}</Text>
</View>
</TouchableOpacity>
</View>

View File

@ -516,6 +516,9 @@ class ApplicationContainer extends Component {
dispatch(updateActiveBottomTab(ROUTES.TABBAR.NOTIFICATION));
}
};
ws.onclose = e => {
console.log(e);
};
};
_logout = () => {

View File

@ -5,6 +5,7 @@ import ScrollableTabView from 'react-native-scrollable-tab-view';
import ActionSheet from 'react-native-actionsheet';
// Utils
import { postBodySummary } from '@esteemapp/esteem-render-helpers';
import { catchDraftImage } from '../../../utils/image';
import { getFormatedCreatedDate } from '../../../utils/time';
@ -46,6 +47,7 @@ const DraftsScreen = ({
const tags = item.tags ? item.tags.split(/[ ,]+/) : [];
const tag = tags[0] || '';
const image = catchDraftImage(item.body);
const summary = postBodySummary({ item, last_update: item.created }, 100);
const isSchedules = type === 'schedules';
return (
@ -53,6 +55,7 @@ const DraftsScreen = ({
created={isSchedules ? getFormatedCreatedDate(item.schedule) : item.created}
mainTag={tag}
title={item.title}
summary={summary}
isFormatedDate={isSchedules}
image={image ? { uri: catchDraftImage(item.body) } : null}
username={currentAccount.name}

View File

@ -2,7 +2,7 @@ import isEmpty from 'lodash/isEmpty';
import forEach from 'lodash/forEach';
import { get, uniqBy } from 'lodash';
import { renderPostBody } from '@esteemapp/esteem-render-helpers';
import { postBodySummary, renderPostBody } from '@esteemapp/esteem-render-helpers';
// Dsteem
// eslint-disable-next-line import/no-cycle
@ -44,6 +44,7 @@ export const parsePost = async (post, currentUserName, isPromoted) => {
post.active_votes.sort((a, b) => b.rshares - a.rshares);
post.body = renderPostBody(post);
post.summary = postBodySummary(post, 150);
post.is_declined_payout = Number(parseFloat(post.max_accepted_payout)) === 0;
if (currentUserName) {