Authen.js 1.72 KB
Newer Older
Giang Tran committed
1
import React from 'react';
Giang Tran committed
2 3 4 5 6 7 8 9
import {
  View,
  Text,
  KeyboardAvoidingView,
  Platform,
  SafeAreaView,
  StatusBar,
} from 'react-native';
Giang Tran committed
10 11 12 13 14
import HeaderAuthen from '../../components/Header/HeaderAuthen';
import {createMaterialTopTabNavigator} from '@react-navigation/material-top-tabs';
import {getFontXD} from '../../Config/Functions';
import Login from './Login';
import Registor from './Registor';
Giang Tran committed
15
import {ScrollView} from 'react-native-gesture-handler';
Giang Tran committed
16 17 18 19

const Tab = createMaterialTopTabNavigator();
const Authen = (props) => {
  return (
Giang Tran committed
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
    <KeyboardAvoidingView
      behavior={Platform.Os === 'ios' ? 'padding' : 'height'}
      style={{flex: 1, backgroundColor: 'white'}}
      keyboardVerticalOffset={-50}>
      <ScrollView showsVerticalScrollIndicator={false}>
        <View style={{flex: 1}}>
          <HeaderAuthen />
          <View style={{flex: 1, backgroundColor: 'white'}}>
            <Tab.Navigator
              initialRouteName="Login"
              tabBarOptions={{
                activeTintColor: '#0045C8',
                labelStyle: {fontSize: getFontXD(42), fontWeight: '700'},
                style: {
                  justifyContent: 'center',
                  marginHorizontal: 40,
                  elevation: 0,
                },
              }}>
              <Tab.Screen
                name="LOGIN"
                component={Login}
                options={{tabBarLabel: 'Đăng nhập'}}
              />
              <Tab.Screen
                name="REGISTOR"
                component={Registor}
                options={{tabBarLabel: 'Đăng ký'}}
              />
            </Tab.Navigator>
          </View>
        </View>
      </ScrollView>
    </KeyboardAvoidingView>
Giang Tran committed
54 55 56 57
  );
};

export default Authen;