Compare commits
No commits in common. "c5e79f45c3f529ec54c404a5e40cd7347ac180a5" and "4259dd779d762e0efe6ad27ad6d415231995dfec" have entirely different histories.
c5e79f45c3
...
4259dd779d
7 changed files with 21 additions and 253 deletions
|
|
@ -10,21 +10,6 @@ afterEach(() => {
|
||||||
jest.restoreAllMocks();
|
jest.restoreAllMocks();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('isLoggedIn yes', () => {
|
|
||||||
jest.spyOn(ConnectionManager.prototype, 'recoverLogin').mockImplementationOnce(() => {
|
|
||||||
return Promise.resolve(true);
|
|
||||||
});
|
|
||||||
return expect(c.isLoggedIn()).resolves.toBe(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('isLoggedIn no', () => {
|
|
||||||
jest.spyOn(ConnectionManager.prototype, 'recoverLogin').mockImplementationOnce(() => {
|
|
||||||
return Promise.reject(false);
|
|
||||||
});
|
|
||||||
return expect(c.isLoggedIn()).rejects.toBe(false);
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
test('recoverLogin error crypto', () => {
|
test('recoverLogin error crypto', () => {
|
||||||
jest.spyOn(SecureStore, 'getItemAsync').mockImplementationOnce(() => {
|
jest.spyOn(SecureStore, 'getItemAsync').mockImplementationOnce(() => {
|
||||||
return Promise.reject();
|
return Promise.reject();
|
||||||
|
|
@ -172,7 +157,7 @@ test("connect good credentials", () => {
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
jest.spyOn(ConnectionManager.prototype, 'saveLogin').mockImplementationOnce(() => {
|
c.saveLogin = jest.fn(() => {
|
||||||
return Promise.resolve(true);
|
return Promise.resolve(true);
|
||||||
});
|
});
|
||||||
return expect(c.connect('email', 'password')).resolves.toBeTruthy();
|
return expect(c.connect('email', 'password')).resolves.toBeTruthy();
|
||||||
|
|
@ -190,7 +175,7 @@ test("connect good credentials, fail save token", () => {
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
jest.spyOn(ConnectionManager.prototype, 'saveLogin').mockImplementationOnce(() => {
|
c.saveLogin = jest.fn(() => {
|
||||||
return Promise.reject(false);
|
return Promise.reject(false);
|
||||||
});
|
});
|
||||||
return expect(c.connect('email', 'password')).rejects.toBe(ERROR_TYPE.SAVE_TOKEN);
|
return expect(c.connect('email', 'password')).rejects.toBe(ERROR_TYPE.SAVE_TOKEN);
|
||||||
|
|
@ -221,7 +206,7 @@ test("connect bogus response 1", () => {
|
||||||
|
|
||||||
|
|
||||||
test("authenticatedRequest success", () => {
|
test("authenticatedRequest success", () => {
|
||||||
jest.spyOn(ConnectionManager.prototype, 'recoverLogin').mockImplementationOnce(() => {
|
c.recoverLogin = jest.fn(() => {
|
||||||
return Promise.resolve('token');
|
return Promise.resolve('token');
|
||||||
});
|
});
|
||||||
jest.spyOn(global, 'fetch').mockImplementationOnce(() => {
|
jest.spyOn(global, 'fetch').mockImplementationOnce(() => {
|
||||||
|
|
@ -236,7 +221,7 @@ test("authenticatedRequest success", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
test("authenticatedRequest error wrong token", () => {
|
test("authenticatedRequest error wrong token", () => {
|
||||||
jest.spyOn(ConnectionManager.prototype, 'recoverLogin').mockImplementationOnce(() => {
|
c.recoverLogin = jest.fn(() => {
|
||||||
return Promise.resolve('token');
|
return Promise.resolve('token');
|
||||||
});
|
});
|
||||||
jest.spyOn(global, 'fetch').mockImplementationOnce(() => {
|
jest.spyOn(global, 'fetch').mockImplementationOnce(() => {
|
||||||
|
|
@ -251,7 +236,7 @@ test("authenticatedRequest error wrong token", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
test("authenticatedRequest error bogus response", () => {
|
test("authenticatedRequest error bogus response", () => {
|
||||||
jest.spyOn(ConnectionManager.prototype, 'recoverLogin').mockImplementationOnce(() => {
|
c.recoverLogin = jest.fn(() => {
|
||||||
return Promise.resolve('token');
|
return Promise.resolve('token');
|
||||||
});
|
});
|
||||||
jest.spyOn(global, 'fetch').mockImplementationOnce(() => {
|
jest.spyOn(global, 'fetch').mockImplementationOnce(() => {
|
||||||
|
|
@ -266,7 +251,7 @@ test("authenticatedRequest error bogus response", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
test("authenticatedRequest connection error", () => {
|
test("authenticatedRequest connection error", () => {
|
||||||
jest.spyOn(ConnectionManager.prototype, 'recoverLogin').mockImplementationOnce(() => {
|
c.recoverLogin = jest.fn(() => {
|
||||||
return Promise.resolve('token');
|
return Promise.resolve('token');
|
||||||
});
|
});
|
||||||
jest.spyOn(global, 'fetch').mockImplementationOnce(() => {
|
jest.spyOn(global, 'fetch').mockImplementationOnce(() => {
|
||||||
|
|
@ -277,7 +262,7 @@ test("authenticatedRequest connection error", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
test("authenticatedRequest error no token", () => {
|
test("authenticatedRequest error no token", () => {
|
||||||
jest.spyOn(ConnectionManager.prototype, 'recoverLogin').mockImplementationOnce(() => {
|
c.recoverLogin = jest.fn(() => {
|
||||||
return Promise.reject(false);
|
return Promise.reject(false);
|
||||||
});
|
});
|
||||||
jest.spyOn(global, 'fetch').mockImplementationOnce(() => {
|
jest.spyOn(global, 'fetch').mockImplementationOnce(() => {
|
||||||
|
|
|
||||||
|
|
@ -1,52 +0,0 @@
|
||||||
import * as React from 'react';
|
|
||||||
import {View} from "react-native";
|
|
||||||
import {Text} from 'react-native-paper';
|
|
||||||
import ConnectionManager from "../managers/ConnectionManager";
|
|
||||||
|
|
||||||
type Props = {
|
|
||||||
navigation: Object,
|
|
||||||
theme: Object,
|
|
||||||
link: string,
|
|
||||||
renderFunction: Function,
|
|
||||||
}
|
|
||||||
|
|
||||||
type State = {
|
|
||||||
loading: boolean,
|
|
||||||
}
|
|
||||||
|
|
||||||
export default class AuthenticatedScreen extends React.Component<Props, State> {
|
|
||||||
|
|
||||||
state = {
|
|
||||||
loading: true,
|
|
||||||
};
|
|
||||||
|
|
||||||
connectionManager: ConnectionManager;
|
|
||||||
|
|
||||||
constructor(props) {
|
|
||||||
super(props);
|
|
||||||
this.connectionManager = ConnectionManager.getInstance();
|
|
||||||
this.connectionManager.isLoggedIn()
|
|
||||||
.then(() => {
|
|
||||||
this.setState({loading: false});
|
|
||||||
this.connectionManager.authenticatedRequest(this.props.link)
|
|
||||||
.then((data) => {
|
|
||||||
console.log(data);
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
console.log(error);
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
this.props.navigation.navigate('LoginScreen');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
this.state.loading
|
|
||||||
? <View><Text>LOADING</Text></View>
|
|
||||||
: this.props.renderFunction()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,13 +1,12 @@
|
||||||
// @flow
|
// @flow
|
||||||
|
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import {Alert, Dimensions, FlatList, Image, Platform, StyleSheet, View} from 'react-native';
|
import {Dimensions, FlatList, Image, Platform, StyleSheet, View} from 'react-native';
|
||||||
import i18n from "i18n-js";
|
import i18n from "i18n-js";
|
||||||
import {openBrowser} from "../utils/WebBrowser";
|
import {openBrowser} from "../utils/WebBrowser";
|
||||||
import SidebarDivider from "./SidebarDivider";
|
import SidebarDivider from "./SidebarDivider";
|
||||||
import SidebarItem from "./SidebarItem";
|
import SidebarItem from "./SidebarItem";
|
||||||
import {TouchableRipple, withTheme} from "react-native-paper";
|
import {TouchableRipple, withTheme} from "react-native-paper";
|
||||||
import ConnectionManager from "../managers/ConnectionManager";
|
|
||||||
|
|
||||||
const deviceWidth = Dimensions.get("window").width;
|
const deviceWidth = Dimensions.get("window").width;
|
||||||
|
|
||||||
|
|
@ -19,7 +18,6 @@ type Props = {
|
||||||
|
|
||||||
type State = {
|
type State = {
|
||||||
active: string,
|
active: string,
|
||||||
isLoggedIn: boolean,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -31,7 +29,6 @@ class SideBar extends React.PureComponent<Props, State> {
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
active: 'Home',
|
active: 'Home',
|
||||||
isLoggedIn: false,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
getRenderItem: Function;
|
getRenderItem: Function;
|
||||||
|
|
@ -51,27 +48,10 @@ class SideBar extends React.PureComponent<Props, State> {
|
||||||
route: "Main",
|
route: "Main",
|
||||||
icon: "home",
|
icon: "home",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: "AMICALE",
|
|
||||||
route: "Divider4"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: 'LOGIN',
|
name: 'LOGIN',
|
||||||
route: "LoginScreen",
|
route: "LoginScreen",
|
||||||
icon: "login",
|
icon: "login",
|
||||||
onlyWhenLoggedOut: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'DISCONNECT',
|
|
||||||
action: () => this.onClickDisconnect(),
|
|
||||||
icon: "logout",
|
|
||||||
onlyWhenLoggedIn: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'PROFILE',
|
|
||||||
route: "ProfileScreen",
|
|
||||||
icon: "circle",
|
|
||||||
onlyWhenLoggedIn: true,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: i18n.t('sidenav.divider2'),
|
name: i18n.t('sidenav.divider2'),
|
||||||
|
|
@ -149,24 +129,6 @@ class SideBar extends React.PureComponent<Props, State> {
|
||||||
];
|
];
|
||||||
this.getRenderItem = this.getRenderItem.bind(this);
|
this.getRenderItem = this.getRenderItem.bind(this);
|
||||||
this.colors = props.theme.colors;
|
this.colors = props.theme.colors;
|
||||||
ConnectionManager.getInstance().setLoginCallback((value) => this.onLoginStateChange(value));
|
|
||||||
}
|
|
||||||
|
|
||||||
onClickDisconnect() {
|
|
||||||
console.log('coucou');
|
|
||||||
Alert.alert(
|
|
||||||
'DISCONNECT',
|
|
||||||
'DISCONNECT?',
|
|
||||||
[
|
|
||||||
{text: 'YES', onPress: () => ConnectionManager.getInstance().disconnect()},
|
|
||||||
{text: 'NO', undefined},
|
|
||||||
],
|
|
||||||
{cancelable: false},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
onLoginStateChange(isLoggedIn: boolean) {
|
|
||||||
this.setState({isLoggedIn: isLoggedIn});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -176,13 +138,10 @@ class SideBar extends React.PureComponent<Props, State> {
|
||||||
* @param item The item pressed
|
* @param item The item pressed
|
||||||
*/
|
*/
|
||||||
onListItemPress(item: Object) {
|
onListItemPress(item: Object) {
|
||||||
console.log(item.action);
|
if (item.link === undefined)
|
||||||
if (item.link !== undefined)
|
|
||||||
openBrowser(item.link, this.colors.primary);
|
|
||||||
else if (item.action !== undefined)
|
|
||||||
item.action();
|
|
||||||
else
|
|
||||||
this.props.navigation.navigate(item.route);
|
this.props.navigation.navigate(item.route);
|
||||||
|
else
|
||||||
|
openBrowser(item.link, this.colors.primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -203,11 +162,7 @@ class SideBar extends React.PureComponent<Props, State> {
|
||||||
*/
|
*/
|
||||||
getRenderItem({item}: Object) {
|
getRenderItem({item}: Object) {
|
||||||
const onListItemPress = this.onListItemPress.bind(this, item);
|
const onListItemPress = this.onListItemPress.bind(this, item);
|
||||||
const onlyWhenLoggedOut = item.onlyWhenLoggedOut !== undefined && item.onlyWhenLoggedOut === true;
|
if (item.icon !== undefined) {
|
||||||
const onlyWhenLoggedIn = item.onlyWhenLoggedIn !== undefined && item.onlyWhenLoggedIn === true;
|
|
||||||
if (onlyWhenLoggedIn && !this.state.isLoggedIn || onlyWhenLoggedOut && this.state.isLoggedIn)
|
|
||||||
return null;
|
|
||||||
else if (item.icon !== undefined) {
|
|
||||||
return (
|
return (
|
||||||
<SidebarItem
|
<SidebarItem
|
||||||
title={item.name}
|
title={item.name}
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,6 @@ export default class ConnectionManager {
|
||||||
#email: string;
|
#email: string;
|
||||||
#token: string;
|
#token: string;
|
||||||
|
|
||||||
loginCallback: Function;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get this class instance or create one if none is found
|
* Get this class instance or create one if none is found
|
||||||
* @returns {ConnectionManager}
|
* @returns {ConnectionManager}
|
||||||
|
|
@ -29,22 +27,15 @@ export default class ConnectionManager {
|
||||||
ConnectionManager.instance;
|
ConnectionManager.instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
onLoginStateChange(newState: boolean) {
|
|
||||||
this.loginCallback(newState);
|
|
||||||
}
|
|
||||||
|
|
||||||
setLoginCallback(callback: Function) {
|
|
||||||
this.loginCallback = callback;
|
|
||||||
}
|
|
||||||
|
|
||||||
async recoverLogin() {
|
async recoverLogin() {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
console.log(this.#token);
|
||||||
if (this.#token !== undefined)
|
if (this.#token !== undefined)
|
||||||
resolve(this.#token);
|
resolve(this.#token);
|
||||||
else {
|
else {
|
||||||
SecureStore.getItemAsync('token')
|
SecureStore.getItemAsync('token')
|
||||||
.then((token) => {
|
.then((token) => {
|
||||||
this.onLoginStateChange(true);
|
console.log(token);
|
||||||
resolve(token);
|
resolve(token);
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
|
|
@ -54,25 +45,13 @@ export default class ConnectionManager {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async isLoggedIn() {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
this.recoverLogin()
|
|
||||||
.then(() => {
|
|
||||||
resolve(true);
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
reject(false);
|
|
||||||
})
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
async saveLogin(email: string, token: string) {
|
async saveLogin(email: string, token: string) {
|
||||||
|
console.log(token);
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
SecureStore.setItemAsync('token', token)
|
SecureStore.setItemAsync('token', token)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.#token = token;
|
this.#token = token;
|
||||||
this.#email = email;
|
this.#email = email;
|
||||||
this.onLoginStateChange(true);
|
|
||||||
resolve(true);
|
resolve(true);
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
|
|
@ -81,11 +60,6 @@ export default class ConnectionManager {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async disconnect() {
|
|
||||||
SecureStore.deleteItemAsync('token'); // TODO use promise
|
|
||||||
this.onLoginStateChange(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
async connect(email: string, password: string) {
|
async connect(email: string, password: string) {
|
||||||
let data = {
|
let data = {
|
||||||
email: email,
|
email: email,
|
||||||
|
|
@ -159,6 +133,7 @@ export default class ConnectionManager {
|
||||||
body: JSON.stringify({token: token})
|
body: JSON.stringify({token: token})
|
||||||
}).then(async (response) => response.json())
|
}).then(async (response) => response.json())
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
|
console.log(data);
|
||||||
if (this.isRequestResponseValid(data)) {
|
if (this.isRequestResponseValid(data)) {
|
||||||
if (data.state)
|
if (data.state)
|
||||||
resolve(data.data);
|
resolve(data.data);
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@ import {createStackNavigator, TransitionPresets} from "@react-navigation/stack";
|
||||||
import HeaderButton from "../components/HeaderButton";
|
import HeaderButton from "../components/HeaderButton";
|
||||||
import i18n from "i18n-js";
|
import i18n from "i18n-js";
|
||||||
import LoginScreen from "../screens/Amicale/LoginScreen";
|
import LoginScreen from "../screens/Amicale/LoginScreen";
|
||||||
import ProfileScreen from "../screens/Amicale/ProfileScreen";
|
|
||||||
|
|
||||||
const defaultScreenOptions = {
|
const defaultScreenOptions = {
|
||||||
gestureEnabled: true,
|
gestureEnabled: true,
|
||||||
|
|
@ -212,30 +211,6 @@ function LoginStackComponent() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const ProfileStack = createStackNavigator();
|
|
||||||
|
|
||||||
function ProfileStackComponent() {
|
|
||||||
return (
|
|
||||||
<ProfileStack.Navigator
|
|
||||||
initialRouteName="ProfileScreen"
|
|
||||||
headerMode="float"
|
|
||||||
screenOptions={defaultScreenOptions}
|
|
||||||
>
|
|
||||||
<ProfileStack.Screen
|
|
||||||
name="ProfileScreen"
|
|
||||||
component={ProfileScreen}
|
|
||||||
options={({navigation}) => {
|
|
||||||
const openDrawer = getDrawerButton.bind(this, navigation);
|
|
||||||
return {
|
|
||||||
title: 'PROFILE',
|
|
||||||
headerLeft: openDrawer
|
|
||||||
};
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</ProfileStack.Navigator>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const Drawer = createDrawerNavigator();
|
const Drawer = createDrawerNavigator();
|
||||||
|
|
||||||
function getDrawerContent(props) {
|
function getDrawerContent(props) {
|
||||||
|
|
@ -285,10 +260,6 @@ export default function DrawerNavigator() {
|
||||||
name="LoginScreen"
|
name="LoginScreen"
|
||||||
component={LoginStackComponent}
|
component={LoginStackComponent}
|
||||||
/>
|
/>
|
||||||
<Drawer.Screen
|
|
||||||
name="ProfileScreen"
|
|
||||||
component={ProfileStackComponent}
|
|
||||||
/>
|
|
||||||
</Drawer.Navigator>
|
</Drawer.Navigator>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ import {
|
||||||
View
|
View
|
||||||
} from "react-native";
|
} from "react-native";
|
||||||
import {Avatar, Button, Card, HelperText, Text, TextInput, withTheme} from 'react-native-paper';
|
import {Avatar, Button, Card, HelperText, Text, TextInput, withTheme} from 'react-native-paper';
|
||||||
import ConnectionManager, {ERROR_TYPE} from "../../managers/ConnectionManager";
|
import ConnectionManager from "../../managers/ConnectionManager";
|
||||||
import {openBrowser} from "../../utils/WebBrowser";
|
import {openBrowser} from "../../utils/WebBrowser";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
|
|
@ -121,10 +121,12 @@ class LoginScreen extends React.Component<Props, State> {
|
||||||
this.setState({loading: true});
|
this.setState({loading: true});
|
||||||
ConnectionManager.getInstance().connect(this.state.email, this.state.password)
|
ConnectionManager.getInstance().connect(this.state.email, this.state.password)
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
this.handleSuccess();
|
console.log(data);
|
||||||
|
Alert.alert('COOL', 'ÇA MARCHE');
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
this.handleErrors(error);
|
console.log(error);
|
||||||
|
Alert.alert('ERREUR', 'MDP OU MAIL INVALIDE');
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
this.setState({loading: false});
|
this.setState({loading: false});
|
||||||
|
|
@ -132,28 +134,6 @@ class LoginScreen extends React.Component<Props, State> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
handleSuccess() {
|
|
||||||
this.props.navigation.navigate('ProfileScreen');
|
|
||||||
}
|
|
||||||
|
|
||||||
handleErrors(error: number) {
|
|
||||||
switch (error) {
|
|
||||||
case ERROR_TYPE.CONNECTION_ERROR:
|
|
||||||
Alert.alert('ERREUR', 'PB DE CONNEXION');
|
|
||||||
break;
|
|
||||||
case ERROR_TYPE.BAD_CREDENTIALS:
|
|
||||||
Alert.alert('ERREUR', 'MDP OU MAIL INVALIDE');
|
|
||||||
break;
|
|
||||||
case ERROR_TYPE.SAVE_TOKEN:
|
|
||||||
Alert.alert('ERREUR', 'IMPOSSIBLE DE SAUVEGARDER INFOS CONNEXION');
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Alert.alert('ERREUR', 'ERREUR INCONNUE. CONTACTER ARNAUD');
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
getFormInput() {
|
getFormInput() {
|
||||||
return (
|
return (
|
||||||
<View>
|
<View>
|
||||||
|
|
|
||||||
|
|
@ -1,46 +0,0 @@
|
||||||
import * as React from 'react';
|
|
||||||
import {View} from "react-native";
|
|
||||||
import {Text, withTheme} from 'react-native-paper';
|
|
||||||
import AuthenticatedScreen from "../../components/AuthenticatedScreen";
|
|
||||||
|
|
||||||
type Props = {
|
|
||||||
navigation: Object,
|
|
||||||
theme: Object,
|
|
||||||
}
|
|
||||||
|
|
||||||
type State = {
|
|
||||||
}
|
|
||||||
|
|
||||||
class ProfileScreen extends React.Component<Props, State> {
|
|
||||||
|
|
||||||
state = {
|
|
||||||
};
|
|
||||||
|
|
||||||
colors: Object;
|
|
||||||
|
|
||||||
constructor(props) {
|
|
||||||
super(props);
|
|
||||||
this.colors = props.theme.colors;
|
|
||||||
}
|
|
||||||
|
|
||||||
getScreen(data: Object) {
|
|
||||||
return (
|
|
||||||
<View>
|
|
||||||
<Text>PAGE</Text>
|
|
||||||
</View>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<AuthenticatedScreen
|
|
||||||
{...this.props}
|
|
||||||
link={'https://www.amicale-insat.fr/api/user/profile'}
|
|
||||||
renderFunction={() => this.getScreen()}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
export default withTheme(ProfileScreen);
|
|
||||||
Loading…
Reference in a new issue