-
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.
- Loading branch information
1 parent
6bd96d7
commit bfc0c4c
Showing
10 changed files
with
226 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,4 @@ web-build/ | |
# macOS | ||
.DS_Store | ||
|
||
/firebase.js | ||
secrets.json |
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 @@ | ||
Developer Guide |
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,12 @@ | ||
import { initializeApp } from "firebase/app"; | ||
import { getAuth } from "firebase/auth"; | ||
import secrets from "./secrets.json"; | ||
|
||
// Your web app's Firebase configuration | ||
// For Firebase JS SDK v7.20.0 and later, measurementId is optional | ||
const firebaseConfig = secrets.firebase; | ||
|
||
// Initialize Firebase | ||
const firebaseApp = initializeApp(firebaseConfig); | ||
|
||
export const auth = getAuth(firebaseApp); |
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,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>NSLocationWhenInUseUsageDescription</key> | ||
<string>For users to see their current location when completing our amazing race.</string> | ||
</dict> | ||
</plist> |
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,73 @@ | ||
import { useEffect, useState } from "react"; | ||
import MapView from "react-native-maps"; | ||
import { StyleSheet, Text, View, Dimensions } from "react-native"; | ||
import * as Location from "expo-location"; | ||
|
||
interface Region { | ||
latitude: number; | ||
longitude: number; | ||
latitudeDelta: number; | ||
longitudeDelta: number; | ||
} | ||
|
||
const sentosaDefault: Region = { | ||
latitude: 1.254206, | ||
longitude: 103.819977, | ||
latitudeDelta: 0.01, | ||
longitudeDelta: 0.01, | ||
}; | ||
|
||
const MapScreen = () => { | ||
const [loading, setLoading] = useState(true); | ||
const [region, setRegion] = useState(sentosaDefault); | ||
|
||
useEffect(() => { | ||
(async () => { | ||
let { status } = await Location.requestForegroundPermissionsAsync(); | ||
if (status !== "granted") { | ||
alert("Permission Denied!"); | ||
return; | ||
} | ||
let location = await Location.getCurrentPositionAsync(); | ||
console.log(location); | ||
const r = { | ||
latitude: location.coords.latitude, | ||
longitude: location.coords.longitude, | ||
latitudeDelta: 0.01, | ||
longitudeDelta: 0.01, | ||
}; | ||
setRegion(r); | ||
setLoading(false); | ||
})(); | ||
}, []); | ||
|
||
if (loading) { | ||
return <Text>loading...</Text>; | ||
} else { | ||
return ( | ||
<View style={styles.container}> | ||
<MapView | ||
style={styles.map} | ||
provider={"google"} | ||
initialRegion={region} | ||
showsUserLocation={true} | ||
/> | ||
</View> | ||
); | ||
} | ||
}; | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
flex: 1, | ||
backgroundColor: "#fff", | ||
alignItems: "center", | ||
justifyContent: "center", | ||
}, | ||
map: { | ||
width: Dimensions.get("window").width, | ||
height: Dimensions.get("window").height, | ||
}, | ||
}); | ||
|
||
export default MapScreen; |
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 |
---|---|---|
|
@@ -2153,6 +2153,11 @@ | |
sudo-prompt "^9.0.0" | ||
wcwidth "^1.0.1" | ||
|
||
"@react-native-community/geolocation@^2.0.2": | ||
version "2.0.2" | ||
resolved "https://registry.yarnpkg.com/@react-native-community/geolocation/-/geolocation-2.0.2.tgz#ba8b40f560ead8d014740d1cdea970b33f19312e" | ||
integrity sha512-tTNXRCgnhJBu79mulQwzabXRpDqfh/uaDqfHVpvF0nX4NTpolpy6mvTRiFg7eWFPGRArsnZz1EYp6rHfJWGgEA== | ||
|
||
"@react-native/[email protected]": | ||
version "1.0.0" | ||
resolved "https://registry.yarnpkg.com/@react-native/assets/-/assets-1.0.0.tgz#c6f9bf63d274bafc8e970628de24986b30a55c8e" | ||
|
@@ -2277,6 +2282,11 @@ | |
"@types/node" "*" | ||
"@types/responselike" "*" | ||
|
||
"@types/geojson@^7946.0.7": | ||
version "7946.0.8" | ||
resolved "https://registry.yarnpkg.com/@types/geojson/-/geojson-7946.0.8.tgz#30744afdb385e2945e22f3b033f897f76b1f12ca" | ||
integrity sha512-1rkryxURpr6aWP7R786/UQOkJ3PcpQiWkAXBmdWc7ryFWqN6a4xfK7BtjXvFBKO9LjQ+MWQSWxYeZX1OApnArA== | ||
|
||
"@types/glob@^7.1.1": | ||
version "7.2.0" | ||
resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.2.0.tgz#bc1b5bf3aa92f25bd5dd39f35c57361bdce5b2eb" | ||
|
@@ -5319,6 +5329,14 @@ expo-keep-awake@~10.0.1: | |
resolved "https://registry.yarnpkg.com/expo-keep-awake/-/expo-keep-awake-10.0.1.tgz#9f1176216c41eee20843c8232acfdca2bc32d334" | ||
integrity sha512-kcBtoDGkm3RRe6BpKDvR7gof/ErajEia38u92pRvNRctdh+p8AFO7GQuiipyg3iMfhcCFVTCIV7h3tuA0g/yDw== | ||
|
||
expo-location@~14.0.1: | ||
version "14.0.1" | ||
resolved "https://registry.yarnpkg.com/expo-location/-/expo-location-14.0.1.tgz#28a5ab1296a103202bb7598539cf78e2f0be5991" | ||
integrity sha512-P3Mrty7uxezBFE9SwYhskeNwwHAapw/6lrLj2fYILgJkNiXv28ns5CwSNsTtJ+MfeHeV93t20qrkk7kJ30SQVw== | ||
dependencies: | ||
"@expo/config-plugins" "^4.0.2" | ||
unimodules-task-manager-interface "~7.1.0" | ||
|
||
[email protected]: | ||
version "0.5.1" | ||
resolved "https://registry.yarnpkg.com/expo-modules-autolinking/-/expo-modules-autolinking-0.5.1.tgz#44f56288d55f6a71576ddd94c18ec9ec8141207b" | ||
|
@@ -5349,6 +5367,11 @@ [email protected]: | |
compare-versions "^3.4.0" | ||
invariant "^2.2.4" | ||
|
||
expo-permissions@~13.1.0: | ||
version "13.1.0" | ||
resolved "https://registry.yarnpkg.com/expo-permissions/-/expo-permissions-13.1.0.tgz#1be8fe01476950d642ea83d383fd8912492434b9" | ||
integrity sha512-f3ngERaoeAw8236xyvw4gS89Fxd4fU2soKXQn0JPXwiDGmIXO+lIJNH3psNvAebj4DfmyQtGW4AS1itG83GHaQ== | ||
|
||
[email protected]: | ||
version "0.0.108" | ||
resolved "https://registry.yarnpkg.com/expo-pwa/-/expo-pwa-0.0.108.tgz#04ab5b8a417009f5b640352c907fd33f24db4b03" | ||
|
@@ -10203,6 +10226,18 @@ react-native-codegen@^0.0.6: | |
jscodeshift "^0.11.0" | ||
nullthrows "^1.1.1" | ||
|
||
react-native-geolocation-service@^5.3.0-beta.4: | ||
version "5.3.0-beta.4" | ||
resolved "https://registry.yarnpkg.com/react-native-geolocation-service/-/react-native-geolocation-service-5.3.0-beta.4.tgz#8061396f734028b0ecbf8316a2cda9179df19210" | ||
integrity sha512-8Z/FP1ls02fnvqXCII+dDS329lP3UigNR4eIHUjPQdHu/DRGMRCpJJuj05hcq37UJL/zVVsXnPFdLA9lCOWYCQ== | ||
|
||
[email protected]: | ||
version "0.29.4" | ||
resolved "https://registry.yarnpkg.com/react-native-maps/-/react-native-maps-0.29.4.tgz#eb4a446104ed2aca5361422d06712f26d4c0d562" | ||
integrity sha512-Td2KE8+KODcHOxfB1GBNnzFo4/89rlLiC7yTvqQZh0tGVrEzIcgSleUZRrjtq/WvSWSR4rql4AS+0VsBgDkYrw== | ||
dependencies: | ||
"@types/geojson" "^7946.0.7" | ||
|
||
[email protected]: | ||
version "3.3.2" | ||
resolved "https://registry.yarnpkg.com/react-native-safe-area-context/-/react-native-safe-area-context-3.3.2.tgz#9549a2ce580f2374edb05e49d661258d1b8bcaed" | ||
|
@@ -12038,6 +12073,11 @@ unicode-property-aliases-ecmascript@^2.0.0: | |
resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.0.0.tgz#0a36cb9a585c4f6abd51ad1deddb285c165297c8" | ||
integrity sha512-5Zfuy9q/DFr4tfO7ZPeVXb1aPoeQSdeFMLpYuFebehDAhbuevLs5yxSZmIFN1tP5F9Wl4IpJrYojg85/zgyZHQ== | ||
|
||
unimodules-task-manager-interface@~7.1.0: | ||
version "7.1.0" | ||
resolved "https://registry.yarnpkg.com/unimodules-task-manager-interface/-/unimodules-task-manager-interface-7.1.0.tgz#01a981a8ff638843ce34f83a1ed73e81f62304d5" | ||
integrity sha512-Iu6naIWWNWB69zFO6njRYj1GcfqAFnaK0hBub2zU6vvUu5A+YibZfXm5MTMq3zKfDeHrvEgVzUQszSbkjurinA== | ||
|
||
union-value@^1.0.0: | ||
version "1.0.1" | ||
resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" | ||
|