diff --git a/src/screens/Amicale/LoginScreen.js b/src/screens/Amicale/LoginScreen.js index 28cabf2..66e6eab 100644 --- a/src/screens/Amicale/LoginScreen.js +++ b/src/screens/Amicale/LoginScreen.js @@ -7,7 +7,6 @@ import ConnectionManager from "../../managers/ConnectionManager"; import i18n from 'i18n-js'; import ErrorDialog from "../../components/Dialog/ErrorDialog"; import {CommonActions} from "@react-navigation/native"; -import {Linking} from "expo"; type Props = { navigation: Object, @@ -26,7 +25,7 @@ type State = { const ICON_AMICALE = require('../../../assets/amicale.png'); -const RESET_PASSWORD_LINK = "https://www.amicale-insat.fr/password/reset"; +const RESET_PASSWORD_PATH = "password/reset"; const emailRegex = /^.+@.+\..+$/; @@ -78,7 +77,10 @@ class LoginScreen extends React.Component { handleSuccess = () => this.props.navigation.navigate(this.nextScreen); - onResetPasswordClick = () => Linking.openURL(RESET_PASSWORD_LINK); + onResetPasswordClick = () => this.props.navigation.navigate('amicale-website', { + screen: 'amicale-website', + params: {path: RESET_PASSWORD_PATH} + }); validateEmail = () => this.setState({isEmailValidated: true}); diff --git a/src/screens/Amicale/ProfileScreen.js b/src/screens/Amicale/ProfileScreen.js index 9c33dfe..f4dd389 100644 --- a/src/screens/Amicale/ProfileScreen.js +++ b/src/screens/Amicale/ProfileScreen.js @@ -7,7 +7,6 @@ import AuthenticatedScreen from "../../components/Amicale/AuthenticatedScreen"; import i18n from 'i18n-js'; import LogoutDialog from "../../components/Amicale/LogoutDialog"; import MaterialHeaderButtons, {Item} from "../../components/Custom/HeaderButton"; -import {Linking} from "expo"; type Props = { navigation: Object, @@ -158,7 +157,10 @@ class ProfileScreen extends React.Component { diff --git a/src/screens/Websites/AmicaleWebsiteScreen.js b/src/screens/Websites/AmicaleWebsiteScreen.js index 9d1b6a5..591986e 100644 --- a/src/screens/Websites/AmicaleWebsiteScreen.js +++ b/src/screens/Websites/AmicaleWebsiteScreen.js @@ -2,17 +2,28 @@ import * as React from 'react'; import WebViewScreen from "../../components/Screens/WebViewScreen"; +import {CommonActions} from "@react-navigation/native"; -const URL = 'https://amicale-insat.fr/'; +const URL = 'https://www.amicale-insat.fr/'; /** * Class defining the app's available rooms screen. * This screen uses a webview to render the page */ export const AmicaleWebsiteScreen = (props: Object) => { + let path = ''; + if (props.route.params !== undefined) { + if (props.route.params.path !== undefined && props.route.params.path !== null) { + path = props.route.params.path; + path = path.replace(URL, ''); + // reset params to prevent infinite loop + props.navigation.dispatch(CommonActions.setParams({path: null})); + } + } + console.log(path); return ( + url={URL + path}/> ); };