mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-22 12:51:42 +03:00
moved points to messages tab
This commit is contained in:
parent
9d61bfde15
commit
595efe4cce
@ -94,4 +94,7 @@ export default EStyleSheet.create({
|
|||||||
width: 24,
|
width: 24,
|
||||||
height: 24,
|
height: 24,
|
||||||
},
|
},
|
||||||
|
scrollContainer: {
|
||||||
|
flex: 1,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
@ -50,12 +50,14 @@ class PointsView extends Component {
|
|||||||
const {
|
const {
|
||||||
userActivities, userPoints, intl, isClaiming, claimPoints,
|
userActivities, userPoints, intl, isClaiming, claimPoints,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const isActiveIcon = true;
|
// TODO:
|
||||||
|
const isActiveIcon = false;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<LineBreak height={12} />
|
<LineBreak height={12} />
|
||||||
<ScrollView
|
<ScrollView
|
||||||
|
style={styles.scrollContainer}
|
||||||
refreshControl={this.refreshControl()}
|
refreshControl={this.refreshControl()}
|
||||||
>
|
>
|
||||||
<Text style={styles.pointText}>{userPoints.points}</Text>
|
<Text style={styles.pointText}>{userPoints.points}</Text>
|
||||||
|
@ -26,7 +26,7 @@ export default {
|
|||||||
HOME: `Home${TABBAR_SUFFIX}`,
|
HOME: `Home${TABBAR_SUFFIX}`,
|
||||||
NOTIFICATION: `Notification${TABBAR_SUFFIX}`,
|
NOTIFICATION: `Notification${TABBAR_SUFFIX}`,
|
||||||
POSTBUTTON: `PostButton${TABBAR_SUFFIX}`,
|
POSTBUTTON: `PostButton${TABBAR_SUFFIX}`,
|
||||||
MESSAGES: `Messages${TABBAR_SUFFIX}`,
|
POINTS: `Points${TABBAR_SUFFIX}`,
|
||||||
PROFILE: `Profile${TABBAR_SUFFIX}`,
|
PROFILE: `Profile${TABBAR_SUFFIX}`,
|
||||||
},
|
},
|
||||||
MODAL: {
|
MODAL: {
|
||||||
|
@ -7,7 +7,7 @@ import ROUTES from '../constants/routeNames';
|
|||||||
// Components
|
// Components
|
||||||
import { Icon, IconContainer } from '../components/icon';
|
import { Icon, IconContainer } from '../components/icon';
|
||||||
import {
|
import {
|
||||||
Home, Notification, Profile, RootComponent, Messages,
|
Home, Notification, Profile, RootComponent, Points,
|
||||||
} from '../screens';
|
} from '../screens';
|
||||||
import { PostButton } from '../components/postButton';
|
import { PostButton } from '../components/postButton';
|
||||||
import { BottomTabBar } from '../components/bottomTabBar';
|
import { BottomTabBar } from '../components/bottomTabBar';
|
||||||
@ -50,14 +50,14 @@ const BaseNavigator = createBottomTabNavigator(
|
|||||||
tabBarIcon: <PostButton />,
|
tabBarIcon: <PostButton />,
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
[ROUTES.TABBAR.MESSAGES]: {
|
[ROUTES.TABBAR.POINTS]: {
|
||||||
screen: RootComponent()(Messages),
|
screen: RootComponent()(Points),
|
||||||
navigationOptions: () => ({
|
navigationOptions: () => ({
|
||||||
tabBarIcon: ({ tintColor }) => (
|
tabBarIcon: ({ tintColor }) => (
|
||||||
<Icon
|
<Icon
|
||||||
iconType="MaterialIcons"
|
iconType="MaterialCommunityIcons"
|
||||||
style={{ padding: 15 }}
|
style={{ padding: 15 }}
|
||||||
name="mail-outline"
|
name="gift"
|
||||||
color={tintColor}
|
color={tintColor}
|
||||||
size={26}
|
size={26}
|
||||||
/>
|
/>
|
||||||
|
@ -5,7 +5,7 @@ import { Follows } from './follows';
|
|||||||
import { Home } from './home';
|
import { Home } from './home';
|
||||||
import { Launch } from './launch';
|
import { Launch } from './launch';
|
||||||
import { Login } from './login';
|
import { Login } from './login';
|
||||||
import { Messages } from './messages';
|
import { Points } from './points';
|
||||||
import { Notification } from './notification';
|
import { Notification } from './notification';
|
||||||
import { PinCode } from './pinCode';
|
import { PinCode } from './pinCode';
|
||||||
import { Post } from './post';
|
import { Post } from './post';
|
||||||
@ -24,7 +24,7 @@ export {
|
|||||||
Home,
|
Home,
|
||||||
Launch,
|
Launch,
|
||||||
Login,
|
Login,
|
||||||
Messages,
|
Points,
|
||||||
Notification,
|
Notification,
|
||||||
PinCode,
|
PinCode,
|
||||||
Post,
|
Post,
|
||||||
|
@ -1,27 +0,0 @@
|
|||||||
import React, { PureComponent } from 'react';
|
|
||||||
|
|
||||||
// Component
|
|
||||||
import MessagesScreen from '../screen/messagesScreen';
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Props Name Description Value
|
|
||||||
*@props --> props name here description here Value Type Here
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
class MessagesContainer extends PureComponent {
|
|
||||||
constructor(props) {
|
|
||||||
super(props);
|
|
||||||
this.state = {};
|
|
||||||
}
|
|
||||||
|
|
||||||
// Component Life Cycle Functions
|
|
||||||
|
|
||||||
// Component Functions
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return <MessagesScreen {...this.props} />;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default MessagesContainer;
|
|
@ -1,5 +0,0 @@
|
|||||||
import MessagesScreen from './screen/messagesScreen';
|
|
||||||
import Messages from './container/messagesContainer';
|
|
||||||
|
|
||||||
export { MessagesScreen, Messages };
|
|
||||||
export default Messages;
|
|
@ -1,48 +0,0 @@
|
|||||||
import React, { PureComponent, Fragment } from 'react';
|
|
||||||
import { injectIntl } from 'react-intl';
|
|
||||||
|
|
||||||
// Constants
|
|
||||||
|
|
||||||
// Components
|
|
||||||
import { Header } from '../../../components/header';
|
|
||||||
import { NoPost } from '../../../components/basicUIElements';
|
|
||||||
|
|
||||||
// Styles
|
|
||||||
import styles from './messagesStyle';
|
|
||||||
import MESSAGES_IMAGE from '../../../assets/keep_calm.png';
|
|
||||||
|
|
||||||
class MessagesScreen extends PureComponent {
|
|
||||||
/* Props
|
|
||||||
* ------------------------------------------------
|
|
||||||
* @prop { type } name - Description....
|
|
||||||
*/
|
|
||||||
|
|
||||||
constructor(props) {
|
|
||||||
super(props);
|
|
||||||
this.state = {};
|
|
||||||
}
|
|
||||||
|
|
||||||
// Component Life Cycles
|
|
||||||
|
|
||||||
// Component Functions
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const { intl } = this.props;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Fragment>
|
|
||||||
<Header />
|
|
||||||
<NoPost
|
|
||||||
style={styles.container}
|
|
||||||
imageStyle={styles.image}
|
|
||||||
source={MESSAGES_IMAGE}
|
|
||||||
defaultText={intl.formatMessage({
|
|
||||||
id: 'messages.comingsoon',
|
|
||||||
})}
|
|
||||||
/>
|
|
||||||
</Fragment>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default injectIntl(MessagesScreen);
|
|
@ -1,5 +1,5 @@
|
|||||||
import React, { PureComponent } from 'react';
|
import React, { PureComponent } from 'react';
|
||||||
import { View, Text } from 'react-native';
|
import { View } from 'react-native';
|
||||||
import ScrollableTabView from '@esteemapp/react-native-scrollable-tab-view';
|
import ScrollableTabView from '@esteemapp/react-native-scrollable-tab-view';
|
||||||
import { injectIntl } from 'react-intl';
|
import { injectIntl } from 'react-intl';
|
||||||
|
|
||||||
@ -9,7 +9,6 @@ import { Notification } from '../../../components/notification';
|
|||||||
import { Header } from '../../../components/header';
|
import { Header } from '../../../components/header';
|
||||||
import { NoPost } from '../../../components/basicUIElements';
|
import { NoPost } from '../../../components/basicUIElements';
|
||||||
import { LeaderBoard } from '../../../components/leaderboard';
|
import { LeaderBoard } from '../../../components/leaderboard';
|
||||||
import { Points } from '../../../components/points';
|
|
||||||
|
|
||||||
// Styles
|
// Styles
|
||||||
import styles from './notificationStyles';
|
import styles from './notificationStyles';
|
||||||
@ -70,24 +69,6 @@ class NotificationScreen extends PureComponent {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
<View
|
|
||||||
tabLabel={intl.formatMessage({
|
|
||||||
id: 'notification.epoint',
|
|
||||||
})}
|
|
||||||
style={styles.tabbarItem}
|
|
||||||
>
|
|
||||||
{isLoggedIn ? (
|
|
||||||
<Points />
|
|
||||||
) : (
|
|
||||||
<NoPost
|
|
||||||
isButtonText
|
|
||||||
defaultText={intl.formatMessage({
|
|
||||||
id: 'profile.login_to_see',
|
|
||||||
})}
|
|
||||||
handleOnButtonPress={handleLoginPress}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</View>
|
|
||||||
<View
|
<View
|
||||||
tabLabel={intl.formatMessage({
|
tabLabel={intl.formatMessage({
|
||||||
id: 'notification.leaderboard',
|
id: 'notification.leaderboard',
|
||||||
|
41
src/screens/points/container/pointsContainer.js
Normal file
41
src/screens/points/container/pointsContainer.js
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
import React, { PureComponent } from 'react';
|
||||||
|
import { connect } from 'react-redux';
|
||||||
|
|
||||||
|
// Component
|
||||||
|
import PointsScreen from '../screen/pointsScreen';
|
||||||
|
|
||||||
|
// Constants
|
||||||
|
import ROUTES from '../../../constants/routeNames';
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Props Name Description Value
|
||||||
|
*@props --> props name here description here Value Type Here
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
class PointsContainer extends PureComponent {
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
this.state = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
// Component Life Cycle Functions
|
||||||
|
|
||||||
|
// Component Functions
|
||||||
|
_handleOnPressLogin = () => {
|
||||||
|
const { navigation } = this.props;
|
||||||
|
|
||||||
|
navigation.navigate(ROUTES.SCREENS.LOGIN);
|
||||||
|
};
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const { isLoggedIn } = this.props;
|
||||||
|
|
||||||
|
return <PointsScreen isLoggedIn={isLoggedIn} handleLoginPress={this._handleOnPressLogin} />;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const matStateToProps = state => ({
|
||||||
|
isLoggedIn: state.application.isLoggedIn,
|
||||||
|
});
|
||||||
|
|
||||||
|
export default connect(matStateToProps)(PointsContainer);
|
5
src/screens/points/index.js
Normal file
5
src/screens/points/index.js
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import PointsScreen from './screen/pointsScreen';
|
||||||
|
import Points from './container/pointsContainer';
|
||||||
|
|
||||||
|
export { PointsScreen, Points };
|
||||||
|
export default Points;
|
61
src/screens/points/screen/pointsScreen.js
Normal file
61
src/screens/points/screen/pointsScreen.js
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
import React, { PureComponent } from 'react';
|
||||||
|
import { injectIntl } from 'react-intl';
|
||||||
|
import { View } from 'react-native';
|
||||||
|
// Constants
|
||||||
|
|
||||||
|
// Components
|
||||||
|
import { Header } from '../../../components/header';
|
||||||
|
import { NoPost } from '../../../components/basicUIElements';
|
||||||
|
import { Points } from '../../../components/points';
|
||||||
|
|
||||||
|
// Styles
|
||||||
|
import styles from './pointsStyles';
|
||||||
|
|
||||||
|
class PointsScreen extends PureComponent {
|
||||||
|
/* Props
|
||||||
|
* ------------------------------------------------
|
||||||
|
* @prop { type } name - Description....
|
||||||
|
*/
|
||||||
|
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
this.state = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
// Component Life Cycles
|
||||||
|
|
||||||
|
// Component Functions
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const { intl, isLoggedIn, handleLoginPress } = this.props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View style={styles.container}>
|
||||||
|
<Header />
|
||||||
|
{/* <NoPost
|
||||||
|
style={styles.container}
|
||||||
|
imageStyle={styles.image}
|
||||||
|
source={MESSAGES_IMAGE}
|
||||||
|
defaultText={intl.formatMessage({
|
||||||
|
id: 'messages.comingsoon',
|
||||||
|
})}
|
||||||
|
/> */}
|
||||||
|
|
||||||
|
{isLoggedIn ? (
|
||||||
|
<Points />
|
||||||
|
) : (
|
||||||
|
<NoPost
|
||||||
|
style={{ flex: 1 }}
|
||||||
|
isButtonText
|
||||||
|
defaultText={intl.formatMessage({
|
||||||
|
id: 'profile.login_to_see',
|
||||||
|
})}
|
||||||
|
handleOnButtonPress={handleLoginPress}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default injectIntl(PointsScreen);
|
@ -2,9 +2,8 @@ import EStyleSheet from 'react-native-extended-stylesheet';
|
|||||||
|
|
||||||
export default EStyleSheet.create({
|
export default EStyleSheet.create({
|
||||||
container: {
|
container: {
|
||||||
justifyContent: 'center',
|
|
||||||
alignItems: 'center',
|
|
||||||
flex: 1,
|
flex: 1,
|
||||||
|
backgroundColor: '$primaryBackgroundColor',
|
||||||
},
|
},
|
||||||
image: {
|
image: {
|
||||||
width: 193,
|
width: 193,
|
Loading…
Reference in New Issue
Block a user