@@ -15,9 +15,15 @@ import { useRoute } from "@react-navigation/native";
1515const assets = require ( "../assets/assets.js" ) ;
1616
1717export default function interiorScreen ( navigation , route ) {
18+ const debug = false ;
19+
1820 // Route fix
1921 route = useRoute ( ) ;
22+
23+ // Grabe the building code from the provided pamrameters
2024 const buildingCode = route . params . code ;
25+
26+ // Set the initial floor to the provided floor number if it exists, otherwise set it to 1
2127 const [ currentFloor , setCurrentFloor ] = useState (
2228 String ( buildingCode ) +
2329 ( route . params . floor !== undefined ? String ( route . params . floor ) : "1" )
@@ -48,12 +54,19 @@ export default function interiorScreen(navigation, route) {
4854 setCurrentFloor ( newFloor ) ;
4955 }
5056 } ;
51- useEffect ( ( ) => {
52- console . log ( currentFloor . substring ( 2 , 3 ) ) ;
53- console . log ( route . params . floor ) ;
54- console . log ( route . params . floor <= parseInt ( currentFloor . substring ( 2 , 3 ) ) ) ;
55- } ) ;
56- console . log ( route . params . xCoord - 64 , route . params . yCoord - 32 ) ;
57+
58+ debug &&
59+ useEffect ( ( ) => {
60+ debug && console . log ( currentFloor . substring ( 2 , 3 ) ) ;
61+ debug && console . log ( route . params . floor ) ;
62+ debug &&
63+ console . log (
64+ route . params . floor <= parseInt ( currentFloor . substring ( 2 , 3 ) )
65+ ) ;
66+ } ) ;
67+
68+ debug && console . log ( route . params . xCoord - 64 , route . params . yCoord - 32 ) ;
69+
5770 return (
5871 // Main interior screen
5972 < View style = { styles . main } >
@@ -93,7 +106,6 @@ export default function interiorScreen(navigation, route) {
93106 </ View >
94107
95108 { /* Up button */ }
96- { /* <View style={styles.button, route.params.floor <= parseInt(currentFloor.substring(2, 3)) ? styles.dark : styles.light}> */ }
97109 < View style = { styles . button } >
98110 < TouchableOpacity onPress = { ( ) => goUp ( ) } >
99111 < Icon
@@ -140,7 +152,6 @@ const styles = StyleSheet.create({
140152 buttonContainer : {
141153 marginLeft : Dimensions . get ( "window" ) . width * 0.8 ,
142154 marginTop : Dimensions . get ( "window" ) . height * 0.65 ,
143- // justifyContent: "space-around",
144155 position : "absolute" ,
145156 } ,
146157 button : {
@@ -164,7 +175,6 @@ const styles = StyleSheet.create({
164175 marginBottom : 10 ,
165176 } ,
166177 chip : {
167- // justify: "center",
168178 color : "white" ,
169179 padding : 14 ,
170180 paddingLeft : 20 ,
0 commit comments