diff --git a/App.js b/App.js index 22bab44..15a3bbc 100644 --- a/App.js +++ b/App.js @@ -14,6 +14,8 @@ import MapScreen from "./src/components/screens/MapScreen"; import LeaderboardScreen from "./src/components/screens/LeaderboardScreen"; import AdminHubScreen from "./src/components/screens/AdminHubScreen"; import ManageSubgroupsScreen from "./src/components/screens/ManageSubgroupsScreen"; +import GameSettingsScreen from "./src/components/screens/GameSettingsScreen"; +import PlayersScreen from "./src/components/screens/PlayersScreen"; const RootStack = createNativeStackNavigator(); const AuthStackNav = createNativeStackNavigator(); @@ -43,6 +45,8 @@ const GameStack = () => ( + + @@ -59,10 +63,12 @@ const AdminStack = () => ( contentStyle: { backgroundColor: '#ffffff' }, }} > + + + + - - diff --git a/app.json b/app.json index 4a8162a..fa76814 100644 --- a/app.json +++ b/app.json @@ -2,7 +2,7 @@ "expo": { "name": "MAD_Treasure_Hunt_App", "slug": "MAD_Treasure_Hunt_App", - "version": "1.0.0", + "version": "1.0.0", "orientation": "portrait", "icon": "./assets/images/icon.png", "userInterfaceStyle": "light", @@ -13,14 +13,28 @@ "backgroundColor": "#ffffff" }, "ios": { - "supportsTablet": true + "supportsTablet": true, + "infoPlist": { + "NSLocationWhenInUseUsageDescription": "This app needs your location for the treasure hunt." + } }, "android": { "adaptiveIcon": { "foregroundImage": "./assets/images/android-icon-monochrome.png", "backgroundColor": "#ffffff" }, - "edgeToEdgeEnabled": false + "config": { + "googleMaps": { + "apiKey": "AIzaSyA-G0tSzzcM5z6HyI23s8dzKDLCOrekhbw" + } + }, + "permissions": [ + "ACCESS_FINE_LOCATION", + "ACCESS_COARSE_LOCATION", + "ACCESS_FINE_LOCATION", + "ACCESS_COARSE_LOCATION" + ], + "package": "com.bobthebob.MAD_Treasure_Hunt_App" }, "web": { "favicon": "./assets/favicon.png" diff --git a/src/components/API/API.js b/src/components/API/API.js index 7b10cc3..fa6cf6e 100644 --- a/src/components/API/API.js +++ b/src/components/API/API.js @@ -1,5 +1,5 @@ -export const API_BASE_URL = 'http://api.bobby.ip-ddns.com'; //For outside Home network -//export const API_BASE_URL = 'http://192.168.8.100:3000'; //For when im home (API Endpoint is on my home server...) +//export const API_BASE_URL = 'http://api.bobby.ip-ddns.com'; //For outside Home network +export const API_BASE_URL = 'http://192.168.8.100:3000'; //For when im home (API Endpoint is on my home server...) const API = {}; API.get = (endpoint) => callFetch(endpoint, 'GET'); diff --git a/src/components/UI/Card.js b/src/components/UI/Card.js new file mode 100644 index 0000000..22d6d3f --- /dev/null +++ b/src/components/UI/Card.js @@ -0,0 +1,26 @@ +import {StyleSheet, View} from 'react-native'; + +const Card = ({children, style}) => { +// Initialisation ------------- +// State ---------------------- +// Handlers ------------------- +// View ----------------------- + + return ( + {children} + ); +}; + +const styles = StyleSheet.create({ + card: { + backgroundColor: '#ffffff', + borderRadius: 8, + padding: 12, + marginBottom: 8, + borderWidth: 1, + borderColor: '#e5e7eb', + }, +}); + +export default Card; + diff --git a/src/components/gameplay/AdminCacheEditorView.js b/src/components/gameplay/AdminCacheEditorView.js index 1880224..944106d 100644 --- a/src/components/gameplay/AdminCacheEditorView.js +++ b/src/components/gameplay/AdminCacheEditorView.js @@ -19,12 +19,9 @@ const AdminCacheEditorView = ({ userLocation, caches, onAddCache, onMoveCache }) latitudeDelta: 0.01, longitudeDelta: 0.01, }} - region={{ - ...userLocation, - latitudeDelta: 0.01, - longitudeDelta: 0.01, - }} onLongPress={(event) => onAddCache(event.nativeEvent.coordinate)} + scrollEnabled={true} + zoomEnabled={true} showsUserLocation > {(caches || []).map((cache) => ( diff --git a/src/components/gameplay/CacheCardItem.js b/src/components/gameplay/CacheCardItem.js new file mode 100644 index 0000000..7838843 --- /dev/null +++ b/src/components/gameplay/CacheCardItem.js @@ -0,0 +1,86 @@ +import {StyleSheet, Text, View} from 'react-native'; +import Card from '../UI/Card'; +import {Button} from '../UI/Button'; + +const CacheCardItem = ({cache, isAdmin, onEdit, onDelete, onSelect}) => { +// Initialisation ------------- + + const isClaimed = Boolean(cache.ClaimedByUid); + const statusText = isClaimed ? 'Claimed' : 'Available'; + const statusColor = isClaimed ? '#9ca3af' : '#16a34a'; + +// State ---------------------- +// Handlers ------------------- +// View ----------------------- + + return ( + + + {cache.clue} + {statusText} + + + {isAdmin ? ( + <> +