Skip to content

Commit

Permalink
fix: reviewing param for redirection's url
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianRid committed Jul 13, 2021
1 parent ca9ef3b commit be7e741
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tumeplay-app/environnements/env.dev.guyane
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
REACT_APP_API_URL=http://localhost:1337
REACT_APP_ZONE=guyane
REACT_APP_OTHER_ZONE_URL=http://localhost:3001/?zone_choice=true
REACT_APP_OTHER_ZONE_URL=http://localhost:3001/
2 changes: 1 addition & 1 deletion tumeplay-app/environnements/env.dev.metropole
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
REACT_APP_API_URL=http://localhost:1337
REACT_APP_ZONE=metropole
REACT_APP_OTHER_ZONE_URL=http://localhost:3002/?zone_choice=true
REACT_APP_OTHER_ZONE_URL=http://localhost:3002/
6 changes: 3 additions & 3 deletions tumeplay-app/src/screens/LandingPage.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import React from 'react'
import {View, Text, StyleSheet, TouchableOpacity, Image} from 'react-native'
import Styles from '../styles/Styles'
import Colors from '../styles/Color'

const LandingPage = (props) => {

const france = require('../assets/pictures/cartefrance.svg')
const guyane = require('../assets/pictures/carteguyane.svg')
const logo = require('../assets/pictures/logoTumeplay.svg')
const param = "?zone_choice=true"

const handleRedirection = (name) => {
if(process.env.REACT_APP_ZONE === 'metropole' && name === 'guyane') {
window.location.href = process.env.REACT_APP_OTHER_ZONE_URL
window.location.href = process.env.REACT_APP_OTHER_ZONE_URL + param
}
if(process.env.REACT_APP_ZONE === 'metropole' && name === 'metropole') {
props.navigation.navigate('LandingScreen')
}
if(process.env.REACT_APP_ZONE === 'guyane' && name === 'metropole') {
window.location.href = process.env.REACT_APP_OTHER_ZONE_URL
window.location.href = process.env.REACT_APP_OTHER_ZONE_URL + param
}
if(process.env.REACT_APP_ZONE === 'guyane' && name === 'guyane') {
props.navigation.navigate('LandingScreen')
Expand Down

0 comments on commit be7e741

Please sign in to comment.