update: token into headers update

parent 5261cb71
......@@ -7,6 +7,9 @@ import { homeStack } from "./Navigations/homeStack";
import { AuthStack } from "./Navigations/AuthStack";
import { FontAwesome } from '@expo/vector-icons';
import { AboutUs } from './screen/AboutUs';
// import {HomeScreen} from './screen/HomeScreen';
// import {HomeScreen} from './screen/HomeScreen'
// import {BottomTab} from './Navigations/BottomTab';
......
// import React from 'react';
// // import React from 'react';
// // import { createMaterialBottomTabNavigator } from '@react-navigation/material-bottom-tabs';
// // import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
// // import { HomeScreen } from "../screen/HomeScreen";
// // const Tab = createMaterialBottomTabNavigator();
// // export function BottomTab() {
// // return (
// // <Tab.Navigator
// // initialRouteName="HomeScreen"
// // screenOptions={{
// // tabBarActiveTintColor: '#e91e63',
// // }}
// // >
// // <Tab.Screen
// // name="HomeScreen"
// // component={HomeScreen}
// // options={{
// // tabBarLabel: 'Home',
// // tabBarIcon: ({ color, size }) => (
// // <MaterialCommunityIcons name="home" color={color} size={size} />
// // ),
// // }}
// // />
// // </Tab.Navigator>
// // );
// // }
// import React from 'react';
// import { createMaterialBottomTabNavigator } from '@react-navigation/material-bottom-tabs';
// import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
// import { HomeScreen } from "../screen/HomeScreen";
// // import { gamification } from '../screen/gamification';
// // import { Leaderboard } from '../screen/Leaderboard';
// import PriceScreen from '../screen/PriceScreen';
// const Tab = createMaterialBottomTabNavigator();
// export function BottomTab() {
// export function MyTabs() {
// return (
// <Tab.Navigator
// initialRouteName="HomeScreen"
// screenOptions={{
// tabBarActiveTintColor: '#e91e63',
// }}
// initialRouteName="Feed"
// activeColor="#e91e63"
// barStyle={{ backgroundColor: 'tomato' }}
// >
// <Tab.Screen
// name="HomeScreen"
// component={HomeScreen}
// name="Feed"
// component={Feed}
// options={{
// tabBarLabel: 'Home',
// tabBarIcon: ({ color, size }) => (
// <MaterialCommunityIcons name="home" color={color} size={size} />
// tabBarIcon: ({ color }) => (
// <MaterialCommunityIcons name="home" color={color} size={26} />
// ),
// }}
// />
// {/* <Tab.Screen
// name="PriceScreen"
// component={PriceScreen}
// options={{
// tabBarLabel: 'Updates',
// tabBarIcon: ({ color }) => (
// <MaterialCommunityIcons name="bell" color={color} size={26} />
// ),
// }}
// /> */}
// {/* <Tab.Screen
// name="gamification"
// component={gamification}
// options={{
// tabBarLabel: 'Profile',
// tabBarIcon: ({ color }) => (
// <MaterialCommunityIcons name="account" color={color} size={26} />
// ),
// }}
// /> */}
// </Tab.Navigator>
// );
// }
\ No newline at end of file
......@@ -3843,6 +3843,11 @@
"resolved": "https://registry.npmjs.org/expo-keep-awake/-/expo-keep-awake-9.1.2.tgz",
"integrity": "sha512-CCuEOQUNLYtMA0rt0sQ9u5LlIMH7lDJG7dImoorfKMsP95yHXy8dl3oCdtaz2zbsPgggVYeom9gE+gQu+Ki4rQ=="
},
"expo-secure-store": {
"version": "10.2.0",
"resolved": "https://registry.npmjs.org/expo-secure-store/-/expo-secure-store-10.2.0.tgz",
"integrity": "sha512-yNahMY3qzEotAYdsE02ps4yGfDay2twasHfsI/7gJB9SrwXYFx5bJuCDk8uTo8jsm6psvDjO+9VMM2DSPHik2A=="
},
"expo-splash-screen": {
"version": "0.10.2",
"resolved": "https://registry.npmjs.org/expo-splash-screen/-/expo-splash-screen-0.10.2.tgz",
......
......@@ -19,7 +19,7 @@ import {
} from "@expo/vector-icons";
import { MaterialIcons } from "@expo/vector-icons";
import { gamification } from "./gamification";
// import {MyTabs} from '../Navigations/BottomTab'
// import BottomTab from "../Navigations/BottomTab";
export function HomeScreen({ navigation }) {
//to diable the yellow box warning on the simulator
......@@ -98,7 +98,7 @@ export function HomeScreen({ navigation }) {
<Text style={styles.heading2}>All Right Reserved.</Text>
</ImageBackground>
{/* <BottomTab/> */}
{/* <MyTabs/> */}
</View>
);
}
......
......@@ -102,6 +102,10 @@ export function PriceScreen({ navigation, data }) {
);
}
function dbDetails(){
}
const form = new FormData ();
form.append("name", details.name)
......@@ -193,7 +197,7 @@ export function PriceScreen({ navigation, data }) {
// ref={passwordInputRef}
// onSubmitEditing={Keyboard.dismiss}
blurOnSubmit={false}
secureTextEntry={true}
secureTextEntry={false}
/>
</View>
{details.isValiddistrict ? null : (
......
......@@ -11,6 +11,10 @@ import {
import { Entypo } from "@expo/vector-icons";
import axios from "axios";
import { State } from "react-native-gesture-handler";
import * as SecureStore from 'expo-secure-store'
export function SignIn({ navigation }) {
......@@ -122,13 +126,20 @@ export function SignIn({ navigation }) {
<TouchableOpacity
style={styles.buttonSub}
activeOpacity={0.5}
onPress={() =>
onPress={ () =>
axios.post("http://192.168.8.126:5000/login", form)
.then(function (response) {
const stngobj = JSON.stringify(response.data)
console.log(stngobj + "logged");
alert("Successfully Logged in")
.then( async function (response) {
// const stngobj = JSON.stringify()
console.log(response.data);
// alert("Successfully Logged in");
await SecureStore.setItemAsync("token", response.data.token);
axios.defaults.headers.common = {
authorization : response.data.token
}
navigation.navigate("HomeScreen")
// return response;
})
.catch(function (error) {
......
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