Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayush Srivastava committed Dec 22, 2021
1 parent 81fd67e commit d929ab1
Show file tree
Hide file tree
Showing 10 changed files with 17,833 additions and 723 deletions.
10 changes: 7 additions & 3 deletions App.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
import { StatusBar } from 'expo-status-bar';
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import AppNavigation from './Navigation/AppNavigation';
import FlashMessage from "react-native-flash-message";

export default function App() {

global.baseURL = 'https://supariderbackend.herokuapp.com/'
return (
<View style={styles.container}>
<Text>Open up App.js to start working on your app!</Text>
<AppNavigation />
<StatusBar style="auto" />
<FlashMessage position="top" statusBarHeight={35} />
</View>
);
}
Expand All @@ -14,7 +20,5 @@ const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});
3 changes: 3 additions & 0 deletions Context.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import React from 'react';

export const AuthContext= React.createContext();
48 changes: 48 additions & 0 deletions Navigation/AppNavigation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import React, { useState, useEffect, useMemo } from "react";
import { StackNav, TimesDrawer, Auth } from "./TimesNavigation";
import { NavigationContainer } from "@react-navigation/native";
import StartingScreen from "../Screens/StartingScreen";
import { AuthContext } from "../Context";
import AsyncStorage from "@react-native-async-storage/async-storage";

export const AppNavigation = () => {
const [storage, setStorage] = useState();
const [isLoading, setIsloading] = useState(true);
console.log(storage)
useEffect(() => {

AsyncStorage.getItem("userData").then((value) => {
let parseData = JSON.parse(value);
setStorage(parseData);


});
}, []);

const authContext = useMemo(() => {
return {
login: () => {
setStorage("userLogin");
},
signUp: () => {
setStorage("userSignup");
},
skip: () => {
setStorage("skip");
},
logOut: () => {
setStorage(null);
console.log('Logout')
},
};
}, []);
return (
<AuthContext.Provider value={authContext}>
<NavigationContainer>
{ storage ? <TimesDrawer /> : <Auth />}
</NavigationContainer>
</AuthContext.Provider>
);
};

export default AppNavigation;
134 changes: 134 additions & 0 deletions Navigation/GrowMoreNavigation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
import React, { useState } from 'react';
import { createStackNavigator } from '@react-navigation/stack';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import { MaterialCommunityIcons } from '@expo/vector-icons';
import { createDrawerNavigator } from '@react-navigation/drawer';
import { NavigationContainer } from '@react-navigation/native';
import AsyncStorage from '@react-native-async-storage/async-storage';

const Authnavigator = createStackNavigator();
export const Auth = () => {

const [oldUser, setOldUser] = useState();
AsyncStorage.getItem('checkUser').then((value) => {
let parseData = JSON.parse(value);
//let checkUserAccess = (!parseData) ? 'false" : "true"
setOldUser(parseData.olduser)
//console.log('oldeuser value ', parseData.olduser);
})


return (
<Authnavigator.Navigator>

<Authnavigator.Screen name="StartingScreen" component={StartingScreen} options={{ headerShown: false }} />
<Authnavigator.Screen name="LoginPage" component={LoginPage} options={{ headerShown: false }} />
<Authnavigator.Screen name="SignUpPage" component={SignUpPage} options={{ headerShown: false }} />
</Authnavigator.Navigator>
);
}


// const WelcomeNavigator = createStackNavigator();
// const WelcomeNav = () => {
// return (
// <WelcomeNavigator.Navigator >
// {/* <WelcomeNavigator.Screen name="DecideScreen" component={DecideScreen} options={{ headerShown: false}} /> */}
// <WelcomeNavigator.Screen name="IntroSlider" component={IntroSlider} options={{ headerShown: false }} />

// </WelcomeNavigator.Navigator>
// )
// }

const MainStackNavigator = createStackNavigator();
export const StackNav = () => {
return (
<MainStackNavigator.Navigator>
<MainStackNavigator.Screen name="BottomTab" component={TabNavigation} options={{ headerShown: false, title: "Home" }} />

{/* <MainStackNavigator.Screen name="Events" component={Events} options={{
title: '', headerStyle: { backgroundColor: '#500935', },
headerTintColor: '#fff',
headerTitleStyle: {
fontWeight: 'bold',
},
}} /> */}
<MainStackNavigator.Screen name="AddEvent" component={AddEvent} options={{
title: '', headerStyle: { backgroundColor: '#500935', },
headerTintColor: '#000',
headerTitleStyle: {
fontWeight: 'bold',
},
}} />
<MainStackNavigator.Screen name="ChatScreen" component={ChatScreen} options={{ headerShown: false, title: "ChatScreen" }}
/>
</MainStackNavigator.Navigator>
)
}

const TimesBottomTab = createBottomTabNavigator();
export const TabNavigation = (props) => {

return (

<TimesBottomTab.Navigator
screenOptions={({ route, navigation }) => ({
tabBarIcon: ({ focused, color, size }) => {
let iconName;
if (route.name === 'HomePage') {
iconName = focused ? 'briefcase-search' : 'briefcase-clock';
} else if (route.name === 'Jobs') {
iconName = focused ? 'book-open-variant' : 'book-open-page-variant';

} else if (route.name === 'Courses') {
iconName = focused ? 'format-list-bulleted-square' : 'format-list-text';
} else if (route.name === 'Events') {
iconName = focused ? 'calendar' : 'calendar-account';
} /* else if (route.name === 'HRpro') {
iconName = focused ? 'account-convert' : 'account-multiple-plus';
} */
else if (route.name === 'RemoteWork') {
iconName = focused ? 'account-convert' : 'account-multiple-plus';
}
// You can return any component that you like here!
return <MaterialCommunityIcons name={iconName} size={24} color={color} />;
},
})}
tabBarOptions={{
keyboardHidesTabBar: true,
style: { backgroundColor: 'white', justifyContent: 'center', alignItems: 'center', alignSelf: 'center', paddingBttom: 10, },
activeTintColor: '#F02F39',
inactiveTintColor: 'grey',
}}>
<TimesBottomTab.Screen name="HomePage" component={HomePage} options={{ title: 'Careers' }} />
<TimesBottomTab.Screen name="Jobs" component={Jobs} options={{ title: 'Jobs' }} />
<TimesBottomTab.Screen name="Courses" component={Courses} options={{ title: 'Courses', }} />
<TimesBottomTab.Screen name="Events" component={Events} options={{ title: 'Events', }} />
{/* <TimesBottomTab.Screen name="HRpro" component={HRpro} options={{ title: 'HR Pro', }} /> */}
<TimesBottomTab.Screen name="RemoteWork" component={RemoteWork} options={{ title: 'Remote Work', }} />
</TimesBottomTab.Navigator>

);
}

const Drawer = createDrawerNavigator();

export const TimesDrawer = () => {
return (

<Drawer.Navigator drawerStyle={{ backgroundColor: '#f8f8f8' }}
drawerContent={(props) => <SideDrawer {...props} />}
drawerContentOptions={{
activeTintColor: '#e91e63',
}}>
<Drawer.Screen name="Career" component={StackNav} />
<Drawer.Screen name="Interview and GD Prep" component={InterViewAndGD} />
<Drawer.Screen name="Resume Writing" component={InterViewAndGD} />
<Drawer.Screen name="HR Pro" component={HRpro} />
<Drawer.Screen name="Mentorship" component={InterViewAndGD} />
<Drawer.Screen name="News And Info" component={NewsAndInfo} />

</Drawer.Navigator>

);
}
Loading

0 comments on commit d929ab1

Please sign in to comment.