created new commet more && aligned comments

This commit is contained in:
ue 2019-12-14 22:53:09 +03:00
parent 55252eec8e
commit d272c682e8
9 changed files with 99 additions and 164 deletions

View File

@ -1,6 +1,9 @@
import EStyleSheet from 'react-native-extended-stylesheet';
export default EStyleSheet.create({
commentContainer: {
marginTop: 10,
},
leftIcon: {
color: '$iconColor',
},
@ -31,6 +34,7 @@ export default EStyleSheet.create({
footerWrapper: {
flex: 1,
flexDirection: 'row',
right: 29,
},
rightButtonWrapper: {
alignSelf: 'flex-end',

View File

@ -51,7 +51,7 @@ const CommentView = ({
return (
<TouchableWithoutFeedback onLongPress={handleOnLongPress}>
<View>
<View style={styles.commentContainer}>
<PostHeaderDescription
key={comment.permlink}
date={getTimeFromNow(comment.created)}
@ -62,7 +62,7 @@ const CommentView = ({
isShowOwnerIndicator={mainAuthor === comment.author}
isHideImage={isHideImage}
/>
<View style={[{ marginLeft: marginLeft || 29 }, styles.bodyWrapper]}>
<View style={[{ marginLeft: 29 }, styles.bodyWrapper]}>
<CommentBody
commentDepth={comment.depth}
handleOnUserPress={handleOnUserPress}
@ -85,7 +85,6 @@ const CommentView = ({
handleOnVotersPress(get(comment, 'active_votes'))
}
text={voteCount}
textMarginLeft={20}
textStyle={styles.voteCountText}
/>
<IconButton

View File

@ -51,8 +51,12 @@ const CommentsView = ({
const _readMoreComments = () => {
navigate({
routeName: ROUTES.SCREENS.COMMENTS,
params: { comments, fetchPost, handleOnVotersPress },
routeName: ROUTES.SCREENS.POST,
key: comments[0].permlink,
params: {
author: comments[0].author,
permlink: comments[0].permlink,
},
});
};

View File

@ -30,6 +30,7 @@ export default EStyleSheet.create({
},
commentContainer: {
paddingHorizontal: 0,
right: 30,
marginTop: 10,
},
th: {

View File

@ -16,7 +16,6 @@ import { PostButton, BottomTabBar, SideMenu } from '../components';
import {
Bookmarks,
Boost,
Comments,
Drafts,
Editor,
Feed,
@ -122,7 +121,6 @@ const stackNavigator = createStackNavigator(
[ROUTES.SCREENS.REDEEM]: { screen: Redeem },
[ROUTES.SCREENS.REBLOGS]: { screen: Reblogs },
[ROUTES.SCREENS.SPIN_GAME]: { screen: SpinGame },
[ROUTES.SCREENS.COMMENTS]: { screen: Comments },
},
{ headerMode: 'none' },
);

View File

@ -1,41 +0,0 @@
import React from 'react';
import { View } from 'react-native';
import { useIntl } from 'react-intl';
import { BasicHeader, Comments } from '../../../components';
// Styles
import globalStyles from '../../../globalStyles';
const CommentsScreen = ({ navigation }) => {
const intl = useIntl();
const comments = navigation.getParam('comments', [{}])[0];
return (
<View style={globalStyles.container}>
<BasicHeader
title={intl.formatMessage({
id: 'comments.title',
})}
/>
<View style={globalStyles.containerHorizontal16}>
<Comments
isShowComments
author={comments.author}
mainAuthor={comments.author}
permlink={comments.permlink}
commentCount={comments.children}
isShowMoreButton={true}
isShowSubComments
showAllComments
fetchPost={navigation.getParam('fetchPost', null)}
handleOnVotersPress={navigation.getParam('handleOnVotersPress', null)}
hasManyComments={false}
hideManyCommentsButton
/>
</View>
</View>
);
};
export { CommentsScreen as Comments };

View File

@ -1,5 +1,4 @@
import { Bookmarks } from './bookmarks';
import { Comments } from './comments/screen/commentsScreen';
import { Drafts } from './drafts';
import { Editor } from './editor';
import { Feed } from './feed';
@ -25,7 +24,6 @@ import Voters from './voters';
export {
Bookmarks,
Boost,
Comments,
Drafts,
Editor,
Feed,

View File

@ -11,14 +11,7 @@ import { LoggedInContainer } from '../../../containers';
import styles from './notificationStyles';
import globalStyles from '../../../globalStyles';
class NotificationScreen extends PureComponent {
constructor(props) {
super(props);
this.state = {};
}
render() {
const {
const NotificationScreen = ({
notifications,
getActivities,
intl,
@ -26,8 +19,7 @@ class NotificationScreen extends PureComponent {
readAllNotification,
isNotificationRefreshing,
changeSelectedFilter,
} = this.props;
}) => {
return (
<Fragment>
<Header />
@ -69,6 +61,6 @@ class NotificationScreen extends PureComponent {
</SafeAreaView>
</Fragment>
);
}
}
};
export default injectIntl(NotificationScreen);

View File

@ -1,27 +1,9 @@
import React, { PureComponent, Fragment } from 'react';
// Constants
import React, { Fragment } from 'react';
// Components
import { BasicHeader, PostDisplay, PostDropdown } from '../../../components';
class PostScreen extends PureComponent {
/* Props
* ------------------------------------------------
* @prop { type } name - Description....
*/
constructor(props) {
super(props);
this.state = {};
}
// Component Life Cycles
// Component Functions
render() {
const {
const PostScreen = ({
currentAccount,
fetchPost,
isFetchComments,
@ -31,8 +13,7 @@ class PostScreen extends PureComponent {
post,
isPostUnavailable,
author,
} = this.props;
}) => {
return (
<Fragment>
<BasicHeader
@ -55,7 +36,6 @@ class PostScreen extends PureComponent {
/>
</Fragment>
);
}
}
};
export default PostScreen;