moved points to messages tab

This commit is contained in:
u-e 2019-04-25 22:32:29 +03:00
parent 41dbaf7443
commit e9dce77dc6
13 changed files with 123 additions and 111 deletions

View File

@ -94,4 +94,7 @@ export default EStyleSheet.create({
width: 24,
height: 24,
},
scrollContainer: {
flex: 1,
},
});

View File

@ -50,12 +50,14 @@ class PointsView extends Component {
const {
userActivities, userPoints, intl, isClaiming, claimPoints,
} = this.props;
const isActiveIcon = true;
// TODO:
const isActiveIcon = false;
return (
<Fragment>
<LineBreak height={12} />
<ScrollView
style={styles.scrollContainer}
refreshControl={this.refreshControl()}
>
<Text style={styles.pointText}>{userPoints.points}</Text>

View File

@ -26,7 +26,7 @@ export default {
HOME: `Home${TABBAR_SUFFIX}`,
NOTIFICATION: `Notification${TABBAR_SUFFIX}`,
POSTBUTTON: `PostButton${TABBAR_SUFFIX}`,
MESSAGES: `Messages${TABBAR_SUFFIX}`,
POINTS: `Points${TABBAR_SUFFIX}`,
PROFILE: `Profile${TABBAR_SUFFIX}`,
},
MODAL: {

View File

@ -7,7 +7,7 @@ import ROUTES from '../constants/routeNames';
// Components
import { Icon, IconContainer } from '../components/icon';
import {
Home, Notification, Profile, RootComponent, Messages,
Home, Notification, Profile, RootComponent, Points,
} from '../screens';
import { PostButton } from '../components/postButton';
import { BottomTabBar } from '../components/bottomTabBar';
@ -50,14 +50,14 @@ const BaseNavigator = createBottomTabNavigator(
tabBarIcon: <PostButton />,
}),
},
[ROUTES.TABBAR.MESSAGES]: {
screen: RootComponent()(Messages),
[ROUTES.TABBAR.POINTS]: {
screen: RootComponent()(Points),
navigationOptions: () => ({
tabBarIcon: ({ tintColor }) => (
<Icon
iconType="MaterialIcons"
iconType="MaterialCommunityIcons"
style={{ padding: 15 }}
name="mail-outline"
name="gift"
color={tintColor}
size={26}
/>

View File

@ -5,7 +5,7 @@ import { Follows } from './follows';
import { Home } from './home';
import { Launch } from './launch';
import { Login } from './login';
import { Messages } from './messages';
import { Points } from './points';
import { Notification } from './notification';
import { PinCode } from './pinCode';
import { Post } from './post';
@ -24,7 +24,7 @@ export {
Home,
Launch,
Login,
Messages,
Points,
Notification,
PinCode,
Post,

View File

@ -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;

View File

@ -1,5 +0,0 @@
import MessagesScreen from './screen/messagesScreen';
import Messages from './container/messagesContainer';
export { MessagesScreen, Messages };
export default Messages;

View File

@ -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);

View File

@ -1,5 +1,5 @@
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 { injectIntl } from 'react-intl';
@ -9,7 +9,6 @@ import { Notification } from '../../../components/notification';
import { Header } from '../../../components/header';
import { NoPost } from '../../../components/basicUIElements';
import { LeaderBoard } from '../../../components/leaderboard';
import { Points } from '../../../components/points';
// Styles
import styles from './notificationStyles';
@ -70,24 +69,6 @@ class NotificationScreen extends PureComponent {
/>
)}
</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
tabLabel={intl.formatMessage({
id: 'notification.leaderboard',

View 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);

View File

@ -0,0 +1,5 @@
import PointsScreen from './screen/pointsScreen';
import Points from './container/pointsContainer';
export { PointsScreen, Points };
export default Points;

View 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);

View File

@ -2,9 +2,8 @@ import EStyleSheet from 'react-native-extended-stylesheet';
export default EStyleSheet.create({
container: {
justifyContent: 'center',
alignItems: 'center',
flex: 1,
backgroundColor: '$primaryBackgroundColor',
},
image: {
width: 193,