mirror of
https://github.com/ecency/ecency-mobile.git
synced 2025-01-02 19:06:39 +03:00
Merge branch 'master' into feature/removePost
This commit is contained in:
commit
cddbbc6dc5
@ -157,7 +157,6 @@ dependencies {
|
||||
compile project(':appcenter-push')
|
||||
compile project(':react-native-view-overflow')
|
||||
compile project(':react-native-vector-icons')
|
||||
compile project(':react-native-restart')
|
||||
compile project(':react-native-linear-gradient')
|
||||
compile project(':react-native-config')
|
||||
compile project(':appcenter-crashes')
|
||||
|
@ -12,7 +12,6 @@ import com.reactnative.ivpusic.imagepicker.PickerPackage;
|
||||
import com.microsoft.appcenter.reactnative.push.AppCenterReactNativePushPackage;
|
||||
import com.entria.views.RNViewOverflowPackage;
|
||||
import com.oblador.vectoricons.VectorIconsPackage;
|
||||
import com.avishayil.rnrestart.ReactNativeRestartPackage;
|
||||
import com.BV.LinearGradient.LinearGradientPackage;
|
||||
import com.lugg.ReactNativeConfig.ReactNativeConfigPackage;
|
||||
import com.microsoft.appcenter.reactnative.crashes.AppCenterReactNativeCrashesPackage;
|
||||
@ -54,7 +53,6 @@ public class MainApplication extends Application implements ReactApplication {
|
||||
new AppCenterReactNativePushPackage(MainApplication.this),
|
||||
new RNViewOverflowPackage(),
|
||||
new VectorIconsPackage(),
|
||||
new ReactNativeRestartPackage(),
|
||||
new LinearGradientPackage(),
|
||||
new ReactNativeConfigPackage(),
|
||||
new AppCenterReactNativeCrashesPackage(MainApplication.this, getResources().getString(R.string.appCenterCrashes_whenToSendCrashes)),
|
||||
|
@ -17,8 +17,6 @@ include ':react-native-view-overflow'
|
||||
project(':react-native-view-overflow').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-view-overflow/android')
|
||||
include ':react-native-vector-icons'
|
||||
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
|
||||
include ':react-native-restart'
|
||||
project(':react-native-restart').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-restart/android')
|
||||
include ':react-native-linear-gradient'
|
||||
project(':react-native-linear-gradient').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-linear-gradient/android')
|
||||
include ':react-native-config'
|
||||
|
@ -22,8 +22,6 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.1.2",
|
||||
"@esteemapp/react-native-scrollable-tab-view": "^0.8.2",
|
||||
"@esteemapp/react-native-tags": "^1.3.1",
|
||||
"appcenter": "^1.10.0",
|
||||
"appcenter-analytics": "^1.10.0",
|
||||
"appcenter-crashes": "^1.10.0",
|
||||
@ -41,7 +39,7 @@
|
||||
"moment": "^2.22.2",
|
||||
"react": "^16.7.0",
|
||||
"react-intl": "^2.7.2",
|
||||
"react-native": "^0.57.5",
|
||||
"react-native": "esteemapp/react-native",
|
||||
"react-native-actionsheet": "^2.4.2",
|
||||
"react-native-code-push": "^5.5.2",
|
||||
"react-native-config": "^0.11.5",
|
||||
@ -55,7 +53,7 @@
|
||||
"react-native-markdown-renderer": "^3.2.8",
|
||||
"react-native-modal-dropdown": "^0.6.2",
|
||||
"react-native-modal-popover": "0.0.12",
|
||||
"react-native-restart": "0.0.6",
|
||||
"react-native-scrollable-tab-view": "^0.10.0",
|
||||
"react-native-sentry": "^0.42.0",
|
||||
"react-native-slider": "^0.11.0",
|
||||
"react-native-vector-icons": "^6.0.2",
|
||||
|
@ -48,7 +48,7 @@ class LeaderboardView extends PureComponent {
|
||||
<FlatList
|
||||
data={users}
|
||||
refreshing={refreshing}
|
||||
keyExtractor={item => item.voter}
|
||||
keyExtractor={item => item._id}
|
||||
removeClippedSubviews={false}
|
||||
onRefresh={() => fetchLeaderBoard()}
|
||||
renderItem={({ item, index }) => this._renderItem(item, index)}
|
||||
|
@ -1,14 +1,19 @@
|
||||
import React from 'react';
|
||||
import { View, Text, TouchableOpacity } from 'react-native';
|
||||
import { withNavigation } from 'react-navigation';
|
||||
import get from 'lodash/get';
|
||||
import { default as ROUTES } from '../../../constants/routeNames';
|
||||
|
||||
|
||||
import styles from './parentPostStyles';
|
||||
|
||||
const ParentPost = ({ post, navigation }) => (
|
||||
const ParentPost = (props) => {
|
||||
const { navigation, post } = props;
|
||||
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<TouchableOpacity
|
||||
onPress={() => (navigation && navigation.navigate
|
||||
onPress={() => (get(navigation, 'navigate')
|
||||
? navigation.navigate({
|
||||
routeName: ROUTES.SCREENS.POST,
|
||||
params: {
|
||||
@ -19,10 +24,11 @@ const ParentPost = ({ post, navigation }) => (
|
||||
: null)
|
||||
}
|
||||
>
|
||||
<Text style={styles.title}>{post.title}</Text>
|
||||
<Text style={styles.description}>{post.summary}</Text>
|
||||
<Text style={styles.title}>{get(post, 'title')}</Text>
|
||||
<Text style={styles.description}>{get(post, 'summary')}</Text>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
export default withNavigation(ParentPost);
|
||||
|
@ -31,7 +31,7 @@ class PointsContainer extends Component {
|
||||
componentDidMount() {
|
||||
this._fetchuserPointActivities();
|
||||
|
||||
this.fetchInterval = setInterval(this._fetchuserPointActivities, 360000);
|
||||
this.fetchInterval = setInterval(this._fetchuserPointActivities, 6 * 60 * 1000);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
|
@ -1,9 +1,15 @@
|
||||
import React, { Component, Fragment } from 'react';
|
||||
import {
|
||||
Text, View, FlatList, ScrollView, RefreshControl, TouchableOpacity,
|
||||
Text,
|
||||
View,
|
||||
FlatList,
|
||||
ScrollView,
|
||||
RefreshControl,
|
||||
TouchableOpacity,
|
||||
} from 'react-native';
|
||||
import { injectIntl } from 'react-intl';
|
||||
import { Popover, PopoverController } from 'react-native-modal-popover';
|
||||
import { get, size } from 'lodash';
|
||||
|
||||
// Components
|
||||
import { LineBreak, WalletLineItem } from '../../basicUIElements';
|
||||
@ -31,8 +37,6 @@ class PointsView extends Component {
|
||||
this.state = {};
|
||||
}
|
||||
|
||||
// Component Life Cycles
|
||||
|
||||
// Component Functions
|
||||
|
||||
refreshControl = () => {
|
||||
@ -48,17 +52,18 @@ class PointsView extends Component {
|
||||
colors={['#fff']}
|
||||
/>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const {
|
||||
userActivities, userPoints, intl, isClaiming, claimPoints,
|
||||
userActivities,
|
||||
userPoints,
|
||||
intl,
|
||||
isClaiming,
|
||||
claimPoints,
|
||||
} = this.props;
|
||||
// TODO: this feature temporarily closed.
|
||||
const isActiveIcon = false;
|
||||
|
||||
return (
|
||||
|
||||
<Fragment>
|
||||
<LineBreak height={12} />
|
||||
<ScrollView
|
||||
@ -67,8 +72,7 @@ class PointsView extends Component {
|
||||
>
|
||||
<Text style={styles.pointText}>{userPoints.points}</Text>
|
||||
<Text style={styles.subText}>eSteem Points</Text>
|
||||
{userPoints.unclaimed_points > 0
|
||||
&& (
|
||||
{get(userPoints, 'unclaimed_points') > 0 && (
|
||||
<MainButton
|
||||
isLoading={isClaiming}
|
||||
isDisable={isClaiming}
|
||||
@ -77,26 +81,37 @@ class PointsView extends Component {
|
||||
onPress={() => claimPoints()}
|
||||
>
|
||||
<View style={styles.mainButtonWrapper}>
|
||||
<Text style={styles.unclaimedText}>{userPoints.unclaimed_points}</Text>
|
||||
<Text style={styles.unclaimedText}>
|
||||
{userPoints.unclaimed_points}
|
||||
</Text>
|
||||
<View style={styles.mainIconWrapper}>
|
||||
<Icon name="add" iconType="MaterialIcons" color="#357ce6" size={23} />
|
||||
<Icon
|
||||
name="add"
|
||||
iconType="MaterialIcons"
|
||||
color="#357ce6"
|
||||
size={23}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
</MainButton>
|
||||
)
|
||||
}
|
||||
)}
|
||||
|
||||
<View style={styles.iconsWrapper}>
|
||||
<FlatList
|
||||
style={styles.iconsList}
|
||||
data={POINTS_KEYS}
|
||||
horizontal
|
||||
keyExtractor={(item, index) => (item.type + index).toString()}
|
||||
renderItem={({ item }) => (
|
||||
<PopoverController key={item.type}>
|
||||
<PopoverController>
|
||||
{({
|
||||
openPopover, closePopover, popoverVisible, setPopoverAnchor, popoverAnchorRect,
|
||||
openPopover,
|
||||
closePopover,
|
||||
popoverVisible,
|
||||
setPopoverAnchor,
|
||||
popoverAnchorRect,
|
||||
}) => (
|
||||
<View styles={styles.iconWrapper} key={item.type}>
|
||||
<View styles={styles.iconWrapper}>
|
||||
<View style={styles.iconWrapper}>
|
||||
<TouchableOpacity
|
||||
ref={setPopoverAnchor}
|
||||
@ -114,7 +129,9 @@ class PointsView extends Component {
|
||||
/>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
<Text style={styles.subText}>{intl.formatMessage({ id: POINTS[item.type].nameKey })}</Text>
|
||||
<Text style={styles.subText}>
|
||||
{intl.formatMessage({ id: POINTS[item.type].nameKey })}
|
||||
</Text>
|
||||
<Popover
|
||||
backgroundStyle={styles.overlay}
|
||||
contentStyle={styles.popoverDetails}
|
||||
@ -128,7 +145,11 @@ class PointsView extends Component {
|
||||
supportedOrientations={['portrait', 'landscape']}
|
||||
>
|
||||
<View style={styles.popoverWrapper}>
|
||||
<Text style={styles.popoverText}>{intl.formatMessage({ id: POINTS[item.type].descriptionKey })}</Text>
|
||||
<Text style={styles.popoverText}>
|
||||
{intl.formatMessage({
|
||||
id: POINTS[item.type].descriptionKey,
|
||||
})}
|
||||
</Text>
|
||||
</View>
|
||||
</Popover>
|
||||
</View>
|
||||
@ -139,34 +160,32 @@ class PointsView extends Component {
|
||||
</View>
|
||||
|
||||
<View style={styles.listWrapper}>
|
||||
{userActivities && userActivities.length < 1
|
||||
? <Text style={styles.subText}>{intl.formatMessage({ id: 'points.no_activity' })}</Text>
|
||||
: (
|
||||
{size(userActivities) < 1 ? (
|
||||
<Text style={styles.subText}>
|
||||
{intl.formatMessage({ id: 'points.no_activity' })}
|
||||
</Text>
|
||||
) : (
|
||||
<FlatList
|
||||
data={userActivities}
|
||||
keyExtractor={item => item.id.toString()}
|
||||
renderItem={({ item, index }) => (
|
||||
<WalletLineItem
|
||||
key={item.id.toString()}
|
||||
index={index + 1}
|
||||
text={intl.formatMessage({ id: item.textKey })}
|
||||
description={getTimeFromNow(item.created)}
|
||||
description={getTimeFromNow(get(item, 'created'))}
|
||||
isCircleIcon
|
||||
isThin
|
||||
isBlackText
|
||||
iconName={item.icon}
|
||||
iconType={item.iconType}
|
||||
rightText={`${item.amount} ESTM`}
|
||||
iconName={get(item, 'icon')}
|
||||
iconType={get(item, 'iconType')}
|
||||
rightText={`${get(item, 'amount')} ESTM`}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
)
|
||||
}
|
||||
)}
|
||||
</View>
|
||||
|
||||
</ScrollView>
|
||||
</Fragment>
|
||||
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -94,6 +94,7 @@ class PostBody extends PureComponent {
|
||||
_handleOnPostPress = (permlink, author) => {
|
||||
const { navigation } = this.props;
|
||||
|
||||
if (permlink) {
|
||||
navigation.navigate({
|
||||
routeName: ROUTES.SCREENS.POST,
|
||||
params: {
|
||||
@ -102,6 +103,7 @@ class PostBody extends PureComponent {
|
||||
},
|
||||
key: permlink,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
_handleOnUserPress = (username) => {
|
||||
|
@ -53,6 +53,7 @@ class PostDisplayContainer extends Component {
|
||||
|
||||
_handleOnReplyPress = () => {
|
||||
const { post, navigation } = this.props;
|
||||
|
||||
navigation.navigate({
|
||||
routeName: ROUTES.SCREENS.EDITOR,
|
||||
params: {
|
||||
@ -65,14 +66,20 @@ class PostDisplayContainer extends Component {
|
||||
|
||||
_handleOnEditPress = () => {
|
||||
const { post, navigation } = this.props;
|
||||
|
||||
if (post) {
|
||||
const isReply = post.parent_author;
|
||||
|
||||
navigation.navigate({
|
||||
routeName: ROUTES.SCREENS.EDITOR,
|
||||
params: {
|
||||
isEdit: true,
|
||||
isReply,
|
||||
post,
|
||||
fetchPost: this._fetchPost,
|
||||
},
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
_handleDeleteComment = (permlink) => {
|
||||
|
@ -2,7 +2,8 @@ import EStyleSheet from 'react-native-extended-stylesheet';
|
||||
|
||||
export default EStyleSheet.create({
|
||||
container: {
|
||||
flexDirection: 'column',
|
||||
backgroundColor: '$primaryBackgroundColor',
|
||||
flex: 1,
|
||||
},
|
||||
header: {
|
||||
marginHorizontal: 16,
|
||||
@ -18,7 +19,7 @@ export default EStyleSheet.create({
|
||||
flexDirection: 'row',
|
||||
},
|
||||
scroll: {
|
||||
height: '$deviceHeight / 1.135',
|
||||
height: '$deviceHeight',
|
||||
backgroundColor: '$primaryBackgroundColor',
|
||||
marginBottom: 50,
|
||||
},
|
||||
|
@ -167,7 +167,7 @@ class PostDisplayView extends PureComponent {
|
||||
}
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
<View style={styles.container}>
|
||||
<ScrollView style={styles.scroll} onScroll={event => this._handleOnScroll(event)}>
|
||||
{parentPost && <ParentPost post={parentPost} />}
|
||||
|
||||
@ -218,7 +218,7 @@ class PostDisplayView extends PureComponent {
|
||||
cancelButtonIndex={1}
|
||||
onPress={index => (index === 0 ? handleOnRemovePress(get(post, 'permlink')) : null)}
|
||||
/>
|
||||
</Fragment>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ import Config from 'react-native-config';
|
||||
import { NavigationActions } from 'react-navigation';
|
||||
import { bindActionCreators } from 'redux';
|
||||
import Push from 'appcenter-push';
|
||||
import get from 'lodash/get';
|
||||
|
||||
// Languages
|
||||
import en from 'react-intl/locale-data/en';
|
||||
@ -21,10 +22,10 @@ import ko from 'react-intl/locale-data/ko';
|
||||
import lt from 'react-intl/locale-data/lt';
|
||||
import pt from 'react-intl/locale-data/pt';
|
||||
import fa from 'react-intl/locale-data/fa';
|
||||
import he from 'react-intl/locale-data/he';
|
||||
|
||||
// Constants
|
||||
import AUTH_TYPE from '../../../constants/authType';
|
||||
import ROUTES from '../../../constants/routeNames';
|
||||
|
||||
// Services
|
||||
import {
|
||||
@ -103,6 +104,7 @@ class ApplicationContainer extends Component {
|
||||
}
|
||||
|
||||
this.globalInterval = setInterval(this._refreshGlobalProps, 180000);
|
||||
this._createPushListener();
|
||||
};
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
@ -139,6 +141,58 @@ class ApplicationContainer extends Component {
|
||||
this.setState({ isReady: true });
|
||||
};
|
||||
|
||||
_createPushListener = () => {
|
||||
const { dispatch } = this.props;
|
||||
let params = null;
|
||||
let key = null;
|
||||
let routeName = null;
|
||||
|
||||
Push.setListener({
|
||||
onPushNotificationReceived(pushNotification) {
|
||||
const push = get(pushNotification, 'customProperties');
|
||||
const permlink1 = get(push, 'permlink1');
|
||||
const permlink2 = get(push, 'permlink2');
|
||||
const permlink3 = get(push, 'permlink3');
|
||||
const parentPermlink1 = get(push, 'parent_permlink1');
|
||||
const parentPermlink2 = get(push, 'parent_permlink2');
|
||||
const parentPermlink3 = get(push, 'parent_permlink3');
|
||||
|
||||
if (parentPermlink1 || permlink1) {
|
||||
const fullParentPermlink = `${parentPermlink1}${parentPermlink2}${parentPermlink3}`;
|
||||
const fullPermlink = `${permlink1}${permlink2}${permlink3}`;
|
||||
|
||||
params = {
|
||||
author: parentPermlink1 ? get(push, 'parent_author') : get(push, 'target'),
|
||||
permlink: parentPermlink1
|
||||
? fullParentPermlink
|
||||
: fullPermlink,
|
||||
};
|
||||
key = parentPermlink1
|
||||
? fullParentPermlink
|
||||
: fullPermlink;
|
||||
routeName = ROUTES.SCREENS.POST;
|
||||
} else {
|
||||
params = {
|
||||
username: push.source,
|
||||
};
|
||||
key = push.source;
|
||||
routeName = ROUTES.SCREENS.PROFILE;
|
||||
}
|
||||
|
||||
this.pushNavigationTimeout = setTimeout(() => {
|
||||
clearTimeout(this.pushNavigationTimeout);
|
||||
const navigateAction = NavigationActions.navigate({
|
||||
routeName,
|
||||
params,
|
||||
key,
|
||||
action: NavigationActions.navigate({ routeName }),
|
||||
});
|
||||
dispatch(navigateAction);
|
||||
}, 4000);
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
_handleConntectionChange = (status) => {
|
||||
const { dispatch, isConnected } = this.props;
|
||||
|
||||
|
@ -117,6 +117,7 @@ class DraftsContainer extends Component {
|
||||
_handleOnBookarkPress = (permlink, author) => {
|
||||
const { navigation } = this.props;
|
||||
|
||||
if (permlink && author) {
|
||||
navigation.navigate({
|
||||
routeName: ROUTES.SCREENS.POST,
|
||||
params: {
|
||||
@ -124,6 +125,7 @@ class DraftsContainer extends Component {
|
||||
author,
|
||||
},
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
_sortData = data => data.sort((a, b) => {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React, { Component } from 'react';
|
||||
import { injectIntl } from 'react-intl';
|
||||
import { View, FlatList, Text } from 'react-native';
|
||||
import ScrollableTabView from '@esteemapp/react-native-scrollable-tab-view';
|
||||
import ScrollableTabView from 'react-native-scrollable-tab-view';
|
||||
import ActionSheet from 'react-native-actionsheet';
|
||||
|
||||
// Components
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React, { Component } from 'react';
|
||||
import { injectIntl } from 'react-intl';
|
||||
import { View, FlatList, Text } from 'react-native';
|
||||
import ScrollableTabView from '@esteemapp/react-native-scrollable-tab-view';
|
||||
import ScrollableTabView from 'react-native-scrollable-tab-view';
|
||||
import ActionSheet from 'react-native-actionsheet';
|
||||
|
||||
// Utils
|
||||
|
@ -274,9 +274,9 @@ class EditorContainer extends Component {
|
||||
};
|
||||
|
||||
_saveCurrentDraft = async (fields) => {
|
||||
const { draftId, isReply } = this.state;
|
||||
const { draftId, isReply, isEdit } = this.state;
|
||||
|
||||
if (!draftId) {
|
||||
if (!draftId && !isEdit) {
|
||||
const { currentAccount } = this.props;
|
||||
const username = currentAccount && currentAccount.name ? currentAccount.name : '';
|
||||
|
||||
@ -359,7 +359,7 @@ class EditorContainer extends Component {
|
||||
navigation.navigate({
|
||||
routeName: ROUTES.SCREENS.POST,
|
||||
params: {
|
||||
author: currentAccount.name,
|
||||
author: get(currentAccount, 'name'),
|
||||
permlink,
|
||||
isNewPost: true,
|
||||
},
|
||||
@ -410,8 +410,8 @@ class EditorContainer extends Component {
|
||||
0,
|
||||
)
|
||||
.then(() => {
|
||||
this._handleSubmitSuccess();
|
||||
AsyncStorage.setItem('temp-reply', '');
|
||||
this._handleSubmitSuccess();
|
||||
})
|
||||
.catch((error) => {
|
||||
this._handleSubmitFailure(error);
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React, { PureComponent, Fragment } from 'react';
|
||||
import { View } from 'react-native';
|
||||
import ScrollableTabView from '@esteemapp/react-native-scrollable-tab-view';
|
||||
import ScrollableTabView from 'react-native-scrollable-tab-view';
|
||||
import { injectIntl } from 'react-intl';
|
||||
|
||||
// Components
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React, { PureComponent } from 'react';
|
||||
import { View, StatusBar, Platform } from 'react-native';
|
||||
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
|
||||
import ScrollableTabView from '@esteemapp/react-native-scrollable-tab-view';
|
||||
import ScrollableTabView from 'react-native-scrollable-tab-view';
|
||||
import { injectIntl } from 'react-intl';
|
||||
|
||||
// Actions
|
||||
|
@ -1,5 +1,6 @@
|
||||
import React, { Component } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import get from 'lodash/get';
|
||||
|
||||
// Actions and Services
|
||||
import { getActivities, markActivityAsRead } from '../../../providers/esteem/esteem';
|
||||
@ -61,6 +62,9 @@ class NotificationContainer extends Component {
|
||||
|
||||
_navigateToNotificationRoute = (data) => {
|
||||
const { navigation, username, dispatch } = this.props;
|
||||
const type = get(data, 'type');
|
||||
const permlink = get(data, 'permlink');
|
||||
const author = get(data, 'author');
|
||||
let routeName;
|
||||
let params;
|
||||
let key;
|
||||
@ -68,30 +72,32 @@ class NotificationContainer extends Component {
|
||||
dispatch(updateUnreadActivityCount(result.unread));
|
||||
});
|
||||
|
||||
if (data.permlink) {
|
||||
if (permlink) {
|
||||
routeName = ROUTES.SCREENS.POST;
|
||||
key = data.permlink;
|
||||
key = permlink;
|
||||
params = {
|
||||
author: data.author,
|
||||
permlink: data.permlink,
|
||||
isHasParentPost: data.parent_author && data.parent_permlink,
|
||||
author,
|
||||
permlink,
|
||||
isHasParentPost: get(data, 'parent_permlink'),
|
||||
};
|
||||
} else if (data.type === 'follow') {
|
||||
} else if (type === 'follow') {
|
||||
routeName = ROUTES.SCREENS.PROFILE;
|
||||
key = data.follower;
|
||||
key = get(data, 'follower');
|
||||
params = {
|
||||
username: data.follower,
|
||||
username: get(data, 'follower'),
|
||||
};
|
||||
} else if (data.type === 'transfer') {
|
||||
} else if (type === 'transfer') {
|
||||
routeName = ROUTES.TABBAR.PROFILE;
|
||||
params = { activePage: 2 };
|
||||
}
|
||||
|
||||
if (routeName) {
|
||||
navigation.navigate({
|
||||
routeName,
|
||||
params,
|
||||
key,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
_readAllNotification = () => {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React, { PureComponent } from 'react';
|
||||
import { View } from 'react-native';
|
||||
import ScrollableTabView from '@esteemapp/react-native-scrollable-tab-view';
|
||||
import ScrollableTabView from 'react-native-scrollable-tab-view';
|
||||
import { injectIntl } from 'react-intl';
|
||||
|
||||
// Components
|
||||
|
@ -3,7 +3,7 @@ import { View, ScrollView } from 'react-native';
|
||||
import { injectIntl } from 'react-intl';
|
||||
|
||||
// Components
|
||||
import ScrollableTabView from '@esteemapp/react-native-scrollable-tab-view';
|
||||
import ScrollableTabView from 'react-native-scrollable-tab-view';
|
||||
import { Comments } from '../../../components/comments';
|
||||
import { CollapsibleCard } from '../../../components/collapsibleCard';
|
||||
import { Header } from '../../../components/header';
|
||||
|
@ -53,11 +53,11 @@ export default EStyleSheet.create({
|
||||
},
|
||||
postTabBar: {
|
||||
backgroundColor: '$primaryBackgroundColor',
|
||||
flex: 1,
|
||||
},
|
||||
commentsTabBar: {
|
||||
backgroundColor: '$primaryBackgroundColor',
|
||||
paddingHorizontal: 16,
|
||||
paddingVertical: 5,
|
||||
},
|
||||
tabBarTitle: {},
|
||||
});
|
||||
|
@ -5,6 +5,7 @@ import {
|
||||
import { connect } from 'react-redux';
|
||||
import Push from 'appcenter-push';
|
||||
import { injectIntl } from 'react-intl';
|
||||
import get from 'lodash/get';
|
||||
|
||||
// Actions & Services
|
||||
import { openPinCodeModal } from '../../../redux/actions/applicationActions';
|
||||
@ -31,7 +32,6 @@ const RootContainer = () => (WrappedComponent) => {
|
||||
|
||||
componentDidMount() {
|
||||
AppState.addEventListener('change', this._handleAppStateChange);
|
||||
this._createPushListener();
|
||||
|
||||
if (Platform.OS === 'android') {
|
||||
Linking.getInitialURL().then((url) => {
|
||||
@ -72,13 +72,15 @@ const RootContainer = () => (WrappedComponent) => {
|
||||
const routeParams = url.indexOf('/') > -1 ? url.split('/') : [url];
|
||||
|
||||
[, permlink] = routeParams;
|
||||
author = routeParams[0].indexOf('@') > -1 ? routeParams[0].replace('@', '') : routeParams[0];
|
||||
author = routeParams && routeParams.length > 0
|
||||
&& routeParams[0].indexOf('@') > -1
|
||||
? routeParams[0].replace('@', '') : routeParams[0];
|
||||
}
|
||||
|
||||
if (author && permlink) {
|
||||
await getPost(author, permlink, currentAccountUsername)
|
||||
.then((result) => {
|
||||
if (result && result.title) {
|
||||
if (get(result, 'title')) {
|
||||
content = result;
|
||||
} else {
|
||||
this._handleAlert(
|
||||
@ -111,10 +113,10 @@ const RootContainer = () => (WrappedComponent) => {
|
||||
}
|
||||
|
||||
routeName = ROUTES.SCREENS.PROFILE;
|
||||
params = { username: profile.name, reputation: profile.reputation };
|
||||
params = { username: get(profile, 'name'), reputation: get(profile, 'reputation') };
|
||||
}
|
||||
|
||||
if (profile || content) {
|
||||
if (routeName && (profile || content)) {
|
||||
this.navigationTimeout = setTimeout(() => {
|
||||
clearTimeout(this.navigationTimeout);
|
||||
navigation.navigate({
|
||||
@ -160,42 +162,6 @@ const RootContainer = () => (WrappedComponent) => {
|
||||
this.setState({ wrappedComponentStates: { ...data } });
|
||||
};
|
||||
|
||||
_createPushListener = () => {
|
||||
const { navigation } = this.props;
|
||||
let params = null;
|
||||
let key = null;
|
||||
let routeName = null;
|
||||
|
||||
Push.setListener({
|
||||
onPushNotificationReceived(pushNotification) {
|
||||
const push = pushNotification.customProperties;
|
||||
|
||||
if (push.parent_permlink1 || push.permlink1) {
|
||||
params = {
|
||||
author: push.parent_permlink1 ? push.parent_author : push.target,
|
||||
permlink: push.parent_permlink1
|
||||
? `${push.parent_permlink1}${push.parent_permlink2}${push.parent_permlink3}`
|
||||
: `${push.permlink1}${push.permlink2}${push.permlink3}`,
|
||||
};
|
||||
key = push.parent_permlink1
|
||||
? `${push.parent_permlink1}${push.parent_permlink2}${push.parent_permlink3}`
|
||||
: `${push.permlink1}${push.permlink2}${push.permlink3}`;
|
||||
routeName = ROUTES.SCREENS.POST;
|
||||
} else {
|
||||
params = {
|
||||
username: push.source,
|
||||
};
|
||||
key = push.source;
|
||||
routeName = ROUTES.SCREENS.PROFILE;
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
navigation.navigate({ routeName, params, key });
|
||||
}, 4000);
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { isPinCodeReqiure, navigation } = this.props;
|
||||
const { wrappedComponentStates } = this.state;
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React, { PureComponent } from 'react';
|
||||
import { View } from 'react-native';
|
||||
import ScrollableTabView from '@esteemapp/react-native-scrollable-tab-view';
|
||||
import ScrollableTabView from 'react-native-scrollable-tab-view';
|
||||
import { injectIntl } from 'react-intl';
|
||||
|
||||
// Components
|
||||
|
37
yarn.lock
37
yarn.lock
@ -1090,20 +1090,6 @@
|
||||
lodash "^4.17.11"
|
||||
to-fast-properties "^2.0.0"
|
||||
|
||||
"@esteemapp/react-native-scrollable-tab-view@^0.8.2":
|
||||
version "0.8.2"
|
||||
resolved "https://registry.yarnpkg.com/@esteemapp/react-native-scrollable-tab-view/-/react-native-scrollable-tab-view-0.8.2.tgz#44c0b0dbfc5dca7361a0c60f21e5e6e95d486742"
|
||||
integrity sha512-RjhzM0pSPHTHyMoyGa3NZRBBDB4gvco8TVmDo7MKzUqjF8a8BQYp43o8IMR5tkKN7UzGgKNsStuRch7MEb+0jQ==
|
||||
dependencies:
|
||||
create-react-class "^15.6.2"
|
||||
prop-types "^15.6.0"
|
||||
react-timer-mixin "^0.13.3"
|
||||
|
||||
"@esteemapp/react-native-tags@^1.3.1":
|
||||
version "1.3.1"
|
||||
resolved "https://registry.yarnpkg.com/@esteemapp/react-native-tags/-/react-native-tags-1.3.1.tgz#8345384b21f4cfe26cd01bfea738b9b0ec7b04c2"
|
||||
integrity sha512-r/EHz8h5wYOPNHA9nv6b2hcaX6pFJI36NHII4ADWJ4Ll9ikQIHCQsDmlS7X8FMmnRQZonETEKglMULfU0of9qw==
|
||||
|
||||
"@samverschueren/stream-to-observable@^0.3.0":
|
||||
version "0.3.0"
|
||||
resolved "https://registry.yarnpkg.com/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.0.tgz#ecdf48d532c58ea477acfcab80348424f8d0662f"
|
||||
@ -7357,11 +7343,6 @@ react-native-modal-popover@0.0.12:
|
||||
lodash.debounce "^4.0.8"
|
||||
prop-types "^15.6.2"
|
||||
|
||||
react-native-restart@0.0.6:
|
||||
version "0.0.6"
|
||||
resolved "https://registry.yarnpkg.com/react-native-restart/-/react-native-restart-0.0.6.tgz#77770d078683947b2c1f2adb876f179269d8443a"
|
||||
integrity sha512-ysKvNOjCeCS8A4ouQkJ8DZRYH4wgPdPEJqqqSGFuNzK4eAi3VPOeneQ3w0HHYeOui5fc6fV9y9ClOB9LcKbKpQ==
|
||||
|
||||
react-native-safe-area-view@0.11.0:
|
||||
version "0.11.0"
|
||||
resolved "https://registry.yarnpkg.com/react-native-safe-area-view/-/react-native-safe-area-view-0.11.0.tgz#4f3dda43c2bace37965e7c6aef5fc83d4f19d174"
|
||||
@ -7374,6 +7355,15 @@ react-native-screens@^1.0.0-alpha.11:
|
||||
resolved "https://registry.yarnpkg.com/react-native-screens/-/react-native-screens-1.0.0-alpha.22.tgz#7a120377b52aa9bbb94d0b8541a014026be9289b"
|
||||
integrity sha512-kSyAt0AeVU6N7ZonfV6dP6iZF8B7Bce+tk3eujXhzBGsLg0VSLnU7uE9VqJF0xdQrHR91ZjGgVMieo/8df9KTA==
|
||||
|
||||
react-native-scrollable-tab-view@^0.10.0:
|
||||
version "0.10.0"
|
||||
resolved "https://registry.yarnpkg.com/react-native-scrollable-tab-view/-/react-native-scrollable-tab-view-0.10.0.tgz#8ce7908254685ee37d35df7d849676eaa1e81132"
|
||||
integrity sha512-7FWw9X2hLozWqpGJTAU/p7ONdTTO635bbAZ5AUPDrB4JwaLbhNV6ePjsNUjsCaopgCwz/EdmH0hTCPeja9dh4w==
|
||||
dependencies:
|
||||
create-react-class "^15.6.2"
|
||||
prop-types "^15.6.0"
|
||||
react-timer-mixin "^0.13.3"
|
||||
|
||||
react-native-sentry@^0.42.0:
|
||||
version "0.42.0"
|
||||
resolved "https://registry.yarnpkg.com/react-native-sentry/-/react-native-sentry-0.42.0.tgz#9cd59659d9b6cd36d6fc4c48f50613cd82cde25f"
|
||||
@ -7422,10 +7412,9 @@ react-native-view-overflow@0.0.3:
|
||||
resolved "https://registry.yarnpkg.com/react-native-view-overflow/-/react-native-view-overflow-0.0.3.tgz#d7b08e8c1e5047a2cf07f3ece82025899f930674"
|
||||
integrity sha512-CcX61kqFyO41WAmqARr/1A7YgTkd1GoQGJl0LYrzl+4CL5uw2CAu68T+1DPapt7RdgvSMLZIPlNvj4TzdJY/hw==
|
||||
|
||||
react-native@^0.57.5:
|
||||
react-native@esteemapp/react-native:
|
||||
version "0.57.8"
|
||||
resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.57.8.tgz#1a840fbe144cd3902cc14313a783ce28efc48cb9"
|
||||
integrity sha512-K6DAMTPTq+lxVYC73y4Kh/bgLajddBaIKzwsVeV4JOoS1Fdq48/ISXD3vApV+x+/IBVTXnrT9qlA+9U6MMZCqA==
|
||||
resolved "https://codeload.github.com/esteemapp/react-native/tar.gz/862999968c8a912c63c048c7b428ea2365a0b58f"
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.0.0"
|
||||
absolute-path "^0.0.0"
|
||||
@ -9378,9 +9367,9 @@ xcode@^2.0.0:
|
||||
simple-plist "^1.0.0"
|
||||
uuid "^3.3.2"
|
||||
|
||||
"xcode@git+https://github.com/apache/cordova-node-xcode.git#e7646f0680d509b590b839e567c217590451505b":
|
||||
"xcode@https://github.com/apache/cordova-node-xcode#e7646f0680d509b590b839e567c217590451505b":
|
||||
version "1.0.1-dev"
|
||||
resolved "git+https://github.com/apache/cordova-node-xcode.git#e7646f0680d509b590b839e567c217590451505b"
|
||||
resolved "https://github.com/apache/cordova-node-xcode#e7646f0680d509b590b839e567c217590451505b"
|
||||
dependencies:
|
||||
simple-plist "^0.2.1"
|
||||
uuid "3.0.1"
|
||||
|
Loading…
Reference in New Issue
Block a user