mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-22 12:51:42 +03:00
Merge pull request #1401 from esteemapp/enhancment/comment
created new commet more && aligned comments
This commit is contained in:
commit
7091b9d339
@ -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',
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -30,6 +30,7 @@ export default EStyleSheet.create({
|
||||
},
|
||||
commentContainer: {
|
||||
paddingHorizontal: 0,
|
||||
right: 30,
|
||||
marginTop: 10,
|
||||
},
|
||||
th: {
|
||||
|
@ -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' },
|
||||
);
|
||||
|
@ -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 };
|
@ -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,
|
||||
|
@ -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 (
|
||||
<Fragment>
|
||||
<Header />
|
||||
<SafeAreaView style={styles.container}>
|
||||
<ScrollableTabView
|
||||
style={globalStyles.tabView}
|
||||
renderTabBar={() => (
|
||||
<TabBar style={styles.tabbar} tabUnderlineDefaultWidth={100} tabUnderlineScaleX={2} />
|
||||
)}
|
||||
const NotificationScreen = ({
|
||||
notifications,
|
||||
getActivities,
|
||||
intl,
|
||||
navigateToNotificationRoute,
|
||||
readAllNotification,
|
||||
isNotificationRefreshing,
|
||||
changeSelectedFilter,
|
||||
}) => {
|
||||
return (
|
||||
<Fragment>
|
||||
<Header />
|
||||
<SafeAreaView style={styles.container}>
|
||||
<ScrollableTabView
|
||||
style={globalStyles.tabView}
|
||||
renderTabBar={() => (
|
||||
<TabBar style={styles.tabbar} tabUnderlineDefaultWidth={100} tabUnderlineScaleX={2} />
|
||||
)}
|
||||
>
|
||||
<View
|
||||
tabLabel={intl.formatMessage({
|
||||
id: 'notification.notification',
|
||||
})}
|
||||
style={styles.tabbarItem}
|
||||
>
|
||||
<View
|
||||
tabLabel={intl.formatMessage({
|
||||
id: 'notification.notification',
|
||||
})}
|
||||
style={styles.tabbarItem}
|
||||
>
|
||||
<LoggedInContainer>
|
||||
{() => (
|
||||
<Notification
|
||||
getActivities={getActivities}
|
||||
notifications={notifications}
|
||||
navigateToNotificationRoute={navigateToNotificationRoute}
|
||||
readAllNotification={readAllNotification}
|
||||
isNotificationRefreshing={isNotificationRefreshing}
|
||||
changeSelectedFilter={changeSelectedFilter}
|
||||
/>
|
||||
)}
|
||||
</LoggedInContainer>
|
||||
</View>
|
||||
<View
|
||||
tabLabel={intl.formatMessage({
|
||||
id: 'notification.leaderboard',
|
||||
})}
|
||||
style={styles.tabbarItem}
|
||||
>
|
||||
<LeaderBoard />
|
||||
</View>
|
||||
</ScrollableTabView>
|
||||
</SafeAreaView>
|
||||
</Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
<LoggedInContainer>
|
||||
{() => (
|
||||
<Notification
|
||||
getActivities={getActivities}
|
||||
notifications={notifications}
|
||||
navigateToNotificationRoute={navigateToNotificationRoute}
|
||||
readAllNotification={readAllNotification}
|
||||
isNotificationRefreshing={isNotificationRefreshing}
|
||||
changeSelectedFilter={changeSelectedFilter}
|
||||
/>
|
||||
)}
|
||||
</LoggedInContainer>
|
||||
</View>
|
||||
<View
|
||||
tabLabel={intl.formatMessage({
|
||||
id: 'notification.leaderboard',
|
||||
})}
|
||||
style={styles.tabbarItem}
|
||||
>
|
||||
<LeaderBoard />
|
||||
</View>
|
||||
</ScrollableTabView>
|
||||
</SafeAreaView>
|
||||
</Fragment>
|
||||
);
|
||||
};
|
||||
|
||||
export default injectIntl(NotificationScreen);
|
||||
|
@ -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 (
|
||||
<Fragment>
|
||||
<BasicHeader
|
||||
isHasDropdown
|
||||
title="Post"
|
||||
content={post}
|
||||
dropdownComponent={<PostDropdown content={post} fetchPost={fetchPost} />}
|
||||
isNewPost={isNewPost}
|
||||
/>
|
||||
<PostDisplay
|
||||
author={author}
|
||||
currentAccount={currentAccount}
|
||||
isPostUnavailable={isPostUnavailable}
|
||||
fetchPost={fetchPost}
|
||||
isFetchComments={isFetchComments}
|
||||
isLoggedIn={isLoggedIn}
|
||||
isNewPost={isNewPost}
|
||||
parentPost={parentPost}
|
||||
post={post}
|
||||
/>
|
||||
</Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
const PostScreen = ({
|
||||
currentAccount,
|
||||
fetchPost,
|
||||
isFetchComments,
|
||||
isLoggedIn,
|
||||
isNewPost,
|
||||
parentPost,
|
||||
post,
|
||||
isPostUnavailable,
|
||||
author,
|
||||
}) => {
|
||||
return (
|
||||
<Fragment>
|
||||
<BasicHeader
|
||||
isHasDropdown
|
||||
title="Post"
|
||||
content={post}
|
||||
dropdownComponent={<PostDropdown content={post} fetchPost={fetchPost} />}
|
||||
isNewPost={isNewPost}
|
||||
/>
|
||||
<PostDisplay
|
||||
author={author}
|
||||
currentAccount={currentAccount}
|
||||
isPostUnavailable={isPostUnavailable}
|
||||
fetchPost={fetchPost}
|
||||
isFetchComments={isFetchComments}
|
||||
isLoggedIn={isLoggedIn}
|
||||
isNewPost={isNewPost}
|
||||
parentPost={parentPost}
|
||||
post={post}
|
||||
/>
|
||||
</Fragment>
|
||||
);
|
||||
};
|
||||
|
||||
export default PostScreen;
|
||||
|
Loading…
Reference in New Issue
Block a user