-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from yeukfei02/fix-code
refactor: 💡 add sg mrt map
- Loading branch information
Showing
7 changed files
with
142 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from 'react'; | ||
import { NavigationContainer } from '@react-navigation/native'; | ||
import { createStackNavigator } from '@react-navigation/stack'; | ||
|
||
import Settings from '../settings/Settings'; | ||
import SingaporeMrtMapPdf from '../singaporeMrtMapPdf/SingaporeMrtMapPdf'; | ||
|
||
const Stack = createStackNavigator(); | ||
|
||
function SettingsView(): JSX.Element { | ||
return ( | ||
<NavigationContainer independent={true}> | ||
<Stack.Navigator screenOptions={{ headerShown: false }}> | ||
<Stack.Screen name="Settings" component={Settings} /> | ||
<Stack.Screen name="SingaporeMrtMapPdf" component={SingaporeMrtMapPdf} /> | ||
</Stack.Navigator> | ||
</NavigationContainer> | ||
); | ||
} | ||
|
||
export default SettingsView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React, { useEffect, useState } from 'react'; | ||
import { StyleSheet, View } from 'react-native'; | ||
import PDFReader from 'rn-pdf-reader-js'; | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
flex: 1, | ||
backgroundColor: 'white', | ||
}, | ||
}); | ||
|
||
function SingaporeMrtMapPdf(props: any): JSX.Element { | ||
const [uri, setUri] = useState(''); | ||
|
||
useEffect(() => { | ||
if (props.route.params) { | ||
setUri(props.route.params.uri); | ||
} | ||
}, [props.route.params]); | ||
|
||
return ( | ||
<View style={styles.container}> | ||
<PDFReader | ||
source={{ | ||
uri: uri, | ||
}} | ||
/> | ||
</View> | ||
); | ||
} | ||
|
||
export default SingaporeMrtMapPdf; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters