Commit 0618900f authored by Wahyu Adjie Prasetyo's avatar Wahyu Adjie Prasetyo

memperbaiki home

parent afe77d64
...@@ -6,6 +6,7 @@ import ActionType from '../redux/globalActionType'; ...@@ -6,6 +6,7 @@ import ActionType from '../redux/globalActionType';
import MenuSelection from './MenuSelection'; import MenuSelection from './MenuSelection';
import { FontAwesome } from '@expo/vector-icons'; import { FontAwesome } from '@expo/vector-icons';
import Home from './Home'; import Home from './Home';
import { SimpleLineIcons } from '@expo/vector-icons';
import Login from './Login'; import Login from './Login';
import Register from './Register'; import Register from './Register';
import ResetPassword from './ResetPassword'; import ResetPassword from './ResetPassword';
...@@ -59,10 +60,11 @@ import UpdateVersion from './UpdateVersion'; ...@@ -59,10 +60,11 @@ import UpdateVersion from './UpdateVersion';
import SettingUrl from './setBaseUrl'; import SettingUrl from './setBaseUrl';
import InboxList from './InboxList'; import InboxList from './InboxList';
import InboxDetail from './InboxDetail'; import InboxDetail from './InboxDetail';
import badgeInbox from './Home';
import { useNavigation } from '@react-navigation/native';
enableScreens(); enableScreens();
const Tab = createBottomTabNavigator(); const Tab = createBottomTabNavigator();
const BottomNavigation = ({ state, descriptors, navigation }) => { const BottomNavigation = ({ state, descriptors, navigation }) => {
...@@ -124,9 +126,7 @@ const BottomNavigation = ({ state, descriptors, navigation }) => { ...@@ -124,9 +126,7 @@ const BottomNavigation = ({ state, descriptors, navigation }) => {
onLongPress={onLongPress} onLongPress={onLongPress}
style={{ flex: 1, alignItems: 'center', backgroundColor: 'white', borderTopWidth: 1, borderTopColor: '#f0f0f0' }} style={{ flex: 1, alignItems: 'center', backgroundColor: 'white', borderTopWidth: 1, borderTopColor: '#f0f0f0' }}
> >
<Image source={icon} style={{ height: 50, width: 50, tintColor: isFocused ? '#CFB368' : 'gray' }} /> <Image source={icon} style={{ height: 50, width: 50, tintColor: isFocused ? '#CFB368' : 'gray' }} />
</TouchableOpacity> </TouchableOpacity>
); );
})} })}
...@@ -134,6 +134,16 @@ const BottomNavigation = ({ state, descriptors, navigation }) => { ...@@ -134,6 +134,16 @@ const BottomNavigation = ({ state, descriptors, navigation }) => {
) )
} }
function HandleInbox({ navigation }) {
return (
<View>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Inbox List')}>
<SimpleLineIcons name="bell" size={24} color="white" />
</TouchableOpacity>
</View>
)
}
function HomePage({ navigation }) { function HomePage({ navigation }) {
return ( return (
<Tab.Navigator tabBar={props => <BottomNavigation {...props} />} <Tab.Navigator tabBar={props => <BottomNavigation {...props} />}
...@@ -319,6 +329,7 @@ class Auth extends React.Component { ...@@ -319,6 +329,7 @@ class Auth extends React.Component {
<Stack.Screen name="Home" component={HomePage} <Stack.Screen name="Home" component={HomePage}
options={{ options={{
headerShown: false, headerShown: false,
headerRight: props => <HandleInbox {...props} />,
title: 'TODAY PROMOTION', title: 'TODAY PROMOTION',
headerStyle: { backgroundColor: '#CFB368' }, headerStyle: { backgroundColor: '#CFB368' },
headerTitleContainerStyle: { alignContent: 'center' }, headerTitleContainerStyle: { alignContent: 'center' },
......
...@@ -14,7 +14,8 @@ import CheckVersion from '../function/CheckVersion'; ...@@ -14,7 +14,8 @@ import CheckVersion from '../function/CheckVersion';
import ActionType from '../redux/globalActionType'; import ActionType from '../redux/globalActionType';
import Toast from 'react-native-tiny-toast'; import Toast from 'react-native-tiny-toast';
import i18n from 'i18n-js'; import i18n from 'i18n-js';
import { Badge } from 'react-native-elements' import { Badge } from 'react-native-elements';
import NumberFormat from 'react-number-format';
let version = info.expo.version let version = info.expo.version
let buildNumber = info.expo.android.versionCode let buildNumber = info.expo.android.versionCode
...@@ -172,7 +173,7 @@ class Home extends React.Component { ...@@ -172,7 +173,7 @@ class Home extends React.Component {
} }
// console.log(params); // console.log(params);
Axios.post(this.props.BASE_URL + 'crm/v2/member/get_profile', params).then(res => { Axios.post(this.props.BASE_URL + 'crm/v2/member/get_profile', params).then(res => {
console.log("data" + JSON.stringify(res) )
const dataCard = res.data const dataCard = res.data
let point = dataCard.kaspro_point let point = dataCard.kaspro_point
let balance = dataCard.kaspro_balance let balance = dataCard.kaspro_balance
...@@ -461,7 +462,7 @@ class Home extends React.Component { ...@@ -461,7 +462,7 @@ class Home extends React.Component {
<Text style={{ fontSize: 10, fontFamily: 'Gotham-Light' }}>{i18n.t('cardnumber')}</Text> <Text style={{ fontSize: 10, fontFamily: 'Gotham-Light' }}>{i18n.t('cardnumber')}</Text>
</View> </View>
<View style={{ flex: 0.5 }}> <View style={{ flex: 0.5 }}>
<Text style={{ fontSize: 10, textAlign: 'right', fontFamily: 'Gotham-Light' }}> {i18n.t('active')} {this.state.member_since}</Text> <Text style={{ fontSize: 10, textAlign: 'right', fontFamily: 'Gotham-Light' }}> {i18n.t('expired')} {this.state.member_since}</Text>
</View> </View>
</View> </View>
<View style={{ paddingHorizontal: 10 }}> <View style={{ paddingHorizontal: 10 }}>
...@@ -493,7 +494,8 @@ class Home extends React.Component { ...@@ -493,7 +494,8 @@ class Home extends React.Component {
{this.state.old_balance_claimed == false ? ( {this.state.old_balance_claimed == false ? (
<Card style={{ padding: 10, margin: 10, alignContent: 'center' }}> <Card style={{ padding: 10, margin: 10, alignContent: 'center' }}>
<View style={{ flex: 1, height: 80, borderRadius: 20, marginRight: 10, marginLeft: 10, justifyContent: 'center' }}> <View style={{ flex: 1, height: 80, borderRadius: 20, marginRight: 10, marginLeft: 10, justifyContent: 'center' }}>
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Light', textAlign: 'center', marginBottom: 10 }}>CREDIT : {this.state.old_balance} </Text> <NumberFormat decimalScale={0} value={this.state.old_balance} renderText={value => <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', top: 20, textAlign: 'center', color:'#838383' }}> CREDIT : {value}</Text>} displayType={'text'} thousandSeparator={true} prefix={''} />
{/* <Text style={{ fontSize: 14, fontFamily: 'Gotham-Light', textAlign: 'center', marginBottom: 10 }}>CREDIT : {this.state.old_balance} </Text> */}
<View style={{ justifyContent: 'center' }}> <View style={{ justifyContent: 'center' }}>
<TouchableOpacity onPress={() => this.handleClaimCredit()}> <TouchableOpacity onPress={() => this.handleClaimCredit()}>
<View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', marginRight: 20, marginLeft: 20, justifyContent: 'center' }}> <View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', marginRight: 20, marginLeft: 20, justifyContent: 'center' }}>
...@@ -513,7 +515,7 @@ class Home extends React.Component { ...@@ -513,7 +515,7 @@ class Home extends React.Component {
<Text style={{ fontSize: 10, fontFamily: 'Gotham-Light' }}>{i18n.t('cardnumber')}</Text> <Text style={{ fontSize: 10, fontFamily: 'Gotham-Light' }}>{i18n.t('cardnumber')}</Text>
</View> </View>
<View style={{ flex: 0.5 }}> <View style={{ flex: 0.5 }}>
<Text style={{ fontSize: 10, textAlign: 'right', fontFamily: 'Gotham-Light', color: 'red' }}>{i18n.t('expired')} {this.state.expire_date}</Text> <Text style={{ fontSize: 10, textAlign: 'right', fontFamily: 'Gotham-Light' }}>{i18n.t('expired')} {this.state.expire_date}</Text>
</View> </View>
</View> </View>
<View style={{ paddingHorizontal: 10 }}> <View style={{ paddingHorizontal: 10 }}>
...@@ -553,7 +555,8 @@ class Home extends React.Component { ...@@ -553,7 +555,8 @@ class Home extends React.Component {
{this.state.old_balance_claimed == false ? ( {this.state.old_balance_claimed == false ? (
<Card style={{ padding: 10, margin: 10, alignContent: 'center' }}> <Card style={{ padding: 10, margin: 10, alignContent: 'center' }}>
<View style={{ flex: 1, height: 80, borderRadius: 20, marginRight: 10, marginLeft: 10, justifyContent: 'center' }}> <View style={{ flex: 1, height: 80, borderRadius: 20, marginRight: 10, marginLeft: 10, justifyContent: 'center' }}>
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Light', textAlign: 'center', marginBottom: 10 }}>CREDIT : {this.state.old_balance} </Text> {/* <Text style={{ fontSize: 14, fontFamily: 'Gotham-Light', textAlign: 'center', marginBottom: 10 }}>CREDIT : {this.state.old_balance} </Text> */}
<NumberFormat decimalScale={0} value={this.state.old_balance} renderText={value => <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', top: 20, textAlign: 'center', color:'#838383' }}> CREDIT : {value}</Text>} displayType={'text'} thousandSeparator={true} prefix={''} />
<View style={{ justifyContent: 'center' }}> <View style={{ justifyContent: 'center' }}>
<TouchableOpacity onPress={() => this.handleClaimCredit()}> <TouchableOpacity onPress={() => this.handleClaimCredit()}>
<View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', marginRight: 20, marginLeft: 20, justifyContent: 'center' }}> <View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', marginRight: 20, marginLeft: 20, justifyContent: 'center' }}>
...@@ -571,9 +574,16 @@ class Home extends React.Component { ...@@ -571,9 +574,16 @@ class Home extends React.Component {
<View style={{ flex: 0.5 }}> <View style={{ flex: 0.5 }}>
<Text style={{ fontSize: 10, fontFamily: 'Gotham-Light' }}>{i18n.t('cardnumber')}</Text> <Text style={{ fontSize: 10, fontFamily: 'Gotham-Light' }}>{i18n.t('cardnumber')}</Text>
</View> </View>
{
this.state.is_expired_date == true ? (
<View style={{ flex: 0.5 }}> <View style={{ flex: 0.5 }}>
<Text style={{ fontSize: 10, textAlign: 'right', fontFamily: 'Gotham-Light' }}>{i18n.t('expired')} {this.state.expire_date}</Text> <Text style={{ fontSize: 10, textAlign: 'right', fontFamily: 'Gotham-Light',color:'red' }}>{i18n.t('expired')} {this.state.expire_date}</Text>
</View> </View>
):(<View style={{ flex: 0.5 }}>
<Text style={{ fontSize: 10, textAlign: 'right', fontFamily: 'Gotham-Light' }}>{i18n.t('expired')} {this.state.expire_date}</Text>
</View>)
}
</View> </View>
<View style={{ paddingHorizontal: 10 }}> <View style={{ paddingHorizontal: 10 }}>
<Text style={{ textAlign: "center", fontSize: 30, color: '#c9af6d', fontFamily: 'Gotham-Black' }}> <Text style={{ textAlign: "center", fontSize: 30, color: '#c9af6d', fontFamily: 'Gotham-Black' }}>
...@@ -599,6 +609,7 @@ class Home extends React.Component { ...@@ -599,6 +609,7 @@ class Home extends React.Component {
</View> </View>
</View> </View>
<View style={styles.line2}></View> <View style={styles.line2}></View>
{this.state.is_expired_date == true ? (
<View style={{ justifyContent: 'center', marginTop: 20 }}> <View style={{ justifyContent: 'center', marginTop: 20 }}>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Renewal')}> <TouchableOpacity onPress={() => this.props.navigation.navigate('Renewal')}>
<View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', marginRight: 20, marginLeft: 20, justifyContent: 'center' }}> <View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', marginRight: 20, marginLeft: 20, justifyContent: 'center' }}>
...@@ -606,6 +617,7 @@ class Home extends React.Component { ...@@ -606,6 +617,7 @@ class Home extends React.Component {
</View> </View>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
):(null)}
</Card> </Card>
</View> </View>
) )
......
...@@ -183,6 +183,12 @@ class Login extends React.Component { ...@@ -183,6 +183,12 @@ class Login extends React.Component {
proses: '' proses: ''
} }
let pageProps = {
pageEmailConfirmation: true
}
this.props.setPage(pageProps)
this.props.setProses(prosesProps); this.props.setProses(prosesProps);
this.props.setLoginInfo(loginProps); this.props.setLoginInfo(loginProps);
this.setState({ this.setState({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment