From 0fe0ee25a04ba754d6cb7b2ba144ab3ce6818a89 Mon Sep 17 00:00:00 2001 From: ue Date: Sat, 14 Dec 2019 22:53:09 +0300 Subject: [PATCH] created new commet more && aligned comments --- src/components/comment/view/commentStyles.js | 4 + src/components/comment/view/commentView.js | 5 +- src/components/comments/view/commentsView.js | 8 +- .../postElements/body/view/postBodyStyles.js | 1 + src/navigation/routes.js | 2 - src/screens/comments/screen/commentsScreen.js | 41 ------- src/screens/index.js | 2 - .../notification/screen/notificationScreen.js | 110 ++++++++---------- src/screens/post/screen/postScreen.js | 90 ++++++-------- 9 files changed, 99 insertions(+), 164 deletions(-) delete mode 100644 src/screens/comments/screen/commentsScreen.js diff --git a/src/components/comment/view/commentStyles.js b/src/components/comment/view/commentStyles.js index de69930c8..b0ce55d82 100644 --- a/src/components/comment/view/commentStyles.js +++ b/src/components/comment/view/commentStyles.js @@ -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', diff --git a/src/components/comment/view/commentView.js b/src/components/comment/view/commentView.js index 64bffe94b..3028eb008 100644 --- a/src/components/comment/view/commentView.js +++ b/src/components/comment/view/commentView.js @@ -51,7 +51,7 @@ const CommentView = ({ return ( - + - + { 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, + }, }); }; diff --git a/src/components/postElements/body/view/postBodyStyles.js b/src/components/postElements/body/view/postBodyStyles.js index 8b4525891..cc9827023 100644 --- a/src/components/postElements/body/view/postBodyStyles.js +++ b/src/components/postElements/body/view/postBodyStyles.js @@ -30,6 +30,7 @@ export default EStyleSheet.create({ }, commentContainer: { paddingHorizontal: 0, + right: 30, marginTop: 10, }, th: { diff --git a/src/navigation/routes.js b/src/navigation/routes.js index d80a43b59..9030c9028 100644 --- a/src/navigation/routes.js +++ b/src/navigation/routes.js @@ -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' }, ); diff --git a/src/screens/comments/screen/commentsScreen.js b/src/screens/comments/screen/commentsScreen.js deleted file mode 100644 index 3ee41e527..000000000 --- a/src/screens/comments/screen/commentsScreen.js +++ /dev/null @@ -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 ( - - - - - - - ); -}; - -export { CommentsScreen as Comments }; diff --git a/src/screens/index.js b/src/screens/index.js index 6e01317c2..e9bcbbfde 100755 --- a/src/screens/index.js +++ b/src/screens/index.js @@ -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, diff --git a/src/screens/notification/screen/notificationScreen.js b/src/screens/notification/screen/notificationScreen.js index 56ac8bc1f..82777208b 100644 --- a/src/screens/notification/screen/notificationScreen.js +++ b/src/screens/notification/screen/notificationScreen.js @@ -11,64 +11,56 @@ import { LoggedInContainer } from '../../../containers'; import styles from './notificationStyles'; import globalStyles from '../../../globalStyles'; -class NotificationScreen extends PureComponent { - constructor(props) { - super(props); - this.state = {}; - } - - render() { - const { - notifications, - getActivities, - intl, - navigateToNotificationRoute, - readAllNotification, - isNotificationRefreshing, - changeSelectedFilter, - } = this.props; - - return ( - -
- - ( - - )} +const NotificationScreen = ({ + notifications, + getActivities, + intl, + navigateToNotificationRoute, + readAllNotification, + isNotificationRefreshing, + changeSelectedFilter, +}) => { + return ( + +
+ + ( + + )} + > + - - - {() => ( - - )} - - - - - - - - - ); - } -} + + {() => ( + + )} + + + + + + + + + ); +}; + export default injectIntl(NotificationScreen); diff --git a/src/screens/post/screen/postScreen.js b/src/screens/post/screen/postScreen.js index b9d391d76..bbb067c17 100644 --- a/src/screens/post/screen/postScreen.js +++ b/src/screens/post/screen/postScreen.js @@ -1,61 +1,41 @@ -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 { - currentAccount, - fetchPost, - isFetchComments, - isLoggedIn, - isNewPost, - parentPost, - post, - isPostUnavailable, - author, - } = this.props; - - return ( - - } - isNewPost={isNewPost} - /> - - - ); - } -} +const PostScreen = ({ + currentAccount, + fetchPost, + isFetchComments, + isLoggedIn, + isNewPost, + parentPost, + post, + isPostUnavailable, + author, +}) => { + return ( + + } + isNewPost={isNewPost} + /> + + + ); +}; export default PostScreen;