diff --git a/App.js b/App.js index 9ee597f..a10e755 100644 --- a/App.js +++ b/App.js @@ -8,7 +8,7 @@ import thunk from "redux-thunk"; import { persistStore, persistReducer } from "redux-persist"; import autoMergeLevel2 from "redux-persist/lib/stateReconciler/autoMergeLevel2"; import allReducers from "./src/reducers"; -import Navigator from "./navigation"; +import Navigation from "./navigation/index"; import AlertModal from "./src/components/AlertModal"; const persistConfig = { @@ -47,7 +47,7 @@ const App = () => { return ( - + ); diff --git a/navigation.js b/navigation.js index 6dc6560..62350d3 100644 --- a/navigation.js +++ b/navigation.js @@ -10,7 +10,6 @@ import Product from './src/screens/Product'; import Products from './src/screens/Products'; import ShoppingCart from './src/screens/ShoppingCart'; import QR from './src/screens/QR/index'; -import {connect} from 'react-redux'; import i18n from './src/services/i18n'; import {useTranslation} from 'react-i18next'; import Profile from './src/screens/Profile'; @@ -29,40 +28,27 @@ const Stack = createNativeStackNavigator(); const Tab = createBottomTabNavigator(); function BottomTab(props) { - const {t} = useTranslation('translation', {keyPrefix: 'main'}); return ( { - i18n.changeLanguage(props.config.lan); + // i18n.changeLanguage(props.config.lan); }, [props.config]); return ( @@ -113,7 +99,7 @@ function Navigator(props) { /> @@ -127,4 +113,4 @@ function Navigator(props) { ); } -export default connect(mapStateToProps)(Navigator); +export default Navigator; diff --git a/navigation/BottomNavigation.js b/navigation/BottomNavigation.js new file mode 100644 index 0000000..c4c19e3 --- /dev/null +++ b/navigation/BottomNavigation.js @@ -0,0 +1,54 @@ +import React from "react"; +import { createBottomTabNavigator } from "@react-navigation/bottom-tabs"; +import Home from "../src/screens/Home"; +import ShoppingCart from '../src/screens/ShoppingCart'; +import Products from "../src/screens/Products"; +import { Entypo, FontAwesome } from "@expo/vector-icons"; + +const Tab = createBottomTabNavigator(); + +const BottomTabNavigator = () => { + return ( + + ( + + ), + }} + /> + ( + + ), + }} + /> + ( + + ), + }} + /> + + ); +}; + +export default BottomTabNavigator; \ No newline at end of file diff --git a/navigation/index.js b/navigation/index.js new file mode 100644 index 0000000..d2b66ca --- /dev/null +++ b/navigation/index.js @@ -0,0 +1,46 @@ +import React from "react"; +import { NavigationContainer } from "@react-navigation/native"; +import { createNativeStackNavigator } from "@react-navigation/native-stack"; +import BottomTabNavigator from "./BottomNavigation"; +import Splash from "../src/screens/Splash"; +import Home from "../src/screens/Home"; +import Login from "../src/screens/Login"; +import Otp from "../src/screens/Otp"; +import Product from "../src/screens/Product"; +import QR from "../src/screens/QR/index"; +import { connect } from "react-redux"; +import i18n from "../src/services/i18n"; +import { useTranslation } from "react-i18next"; +import Profile from "../src/screens/Profile"; +import Videos from "../src/screens/Videos"; +import Exams from "../src/screens/Exams"; +import OrderDetails from "../src/screens/OrderDetails"; + +const Stack = createNativeStackNavigator(); + +const Navigation = () => { + return ( + + + + + + + + + + + ); +}; + +const mapStateToProps = (state) => { + return { + profile: state.profile, + config: state.config, + }; +}; + +export default connect(mapStateToProps)(Navigation); diff --git a/package.json b/package.json index ca0522a..99cc228 100644 --- a/package.json +++ b/package.json @@ -14,16 +14,20 @@ "@react-navigation/bottom-tabs": "^6.0.9", "@react-navigation/native": "^6.0.6", "@react-navigation/native-stack": "^6.2.5", - "expo": "~44.0.0", + "expo": "^44.0.1", + "expo-barcode-scanner": "~11.2.0", + "expo-camera": "~12.1.0", "expo-device": "~4.1.0", "expo-status-bar": "~1.2.0", "i18next": "^21.6.3", + "install": "^0.13.0", "lodash": "^4.17.21", "react": "17.0.1", "react-dom": "17.0.1", "react-i18next": "^11.15.1", "react-native": "0.64.3", "react-native-awesome-alerts": "^1.5.2", + "react-native-qrcode-scanner": "^1.5.4", "react-native-restart": "^0.0.22", "react-native-safe-area-context": "3.3.2", "react-native-screens": "~3.10.1", diff --git a/src/components/Navbar.js b/src/components/Navbar.js index 1260892..f9017d9 100644 --- a/src/components/Navbar.js +++ b/src/components/Navbar.js @@ -1,64 +1,79 @@ -import React, {useCallback} from 'react'; -import {Image, StyleSheet, View, TouchableOpacity} from 'react-native'; -import {useNavigation} from '@react-navigation/native'; -import tw from 'tailwind-rn'; +import React, { useCallback } from "react"; +import { + Image, + StyleSheet, + View, + Pressable, +} from "react-native"; +import { useNavigation } from "@react-navigation/native"; +import tw from "tailwind-rn"; //colors -import Color from '../constants/Colors'; +import Color from "../constants/Colors"; //assets -import hamburgerLightIcon from '../assets/icons/hamburger-light.png'; -import logoIcon from '../assets/icons/logo.png'; -import qrLightIcon from '../assets/icons/qr-light.png'; -import arLightIcon from '../assets/icons/ar-light.png'; +import hamburgerLightIcon from "../assets/icons/hamburger-light.png"; +import logoIcon from "../assets/icons/logo.png"; +import qrLightIcon from "../assets/icons/qr-light.png"; +import arLightIcon from "../assets/icons/ar-light.png"; -const Navbar = ({notification}) => { +const Navbar = ({ notification }) => { const navigation = useNavigation(); - const Button = useCallback(({icon, route}) => { + const Button = useCallback(({ icon, route }) => { return ( - navigation.navigate(route)}> - - + onPress={() => navigation.navigate(route)} + > + + ); }, []); return ( - - + "w-full flex flex-row-reverse justify-between h-16 bg-white items-center px-4 relative" + )} + > + + {notification && ( + "h-2.5 w-2.5 absolute -left-1 -top-1 bg-red-500 rounded-full" + )} + > )} - - -