From 12847cc46c014a1bccbef97edb93ec008664f7d6 Mon Sep 17 00:00:00 2001 From: suddenlyoranges Date: Thu, 9 Apr 2026 21:39:42 +0100 Subject: [PATCH] refactored app theme changed texts to suit dark theme. --- .../screens/global/GlobalCacheViewScreen.js | 27 +-- .../screens/global/GlobalEventsScreen.js | 49 +++-- .../screens/global/GlobalLeaderboardScreen.js | 171 ++++++++++-------- .../screens/global/GlobalMapScreen.js | 97 ++++++---- .../screens/global/GlobalProfileScreen.js | 4 +- 5 files changed, 204 insertions(+), 144 deletions(-) diff --git a/src/components/screens/global/GlobalCacheViewScreen.js b/src/components/screens/global/GlobalCacheViewScreen.js index 257244c..bd8d58a 100644 --- a/src/components/screens/global/GlobalCacheViewScreen.js +++ b/src/components/screens/global/GlobalCacheViewScreen.js @@ -1,10 +1,10 @@ -import {useEffect} from "react"; -import {StyleSheet, Text, View} from "react-native"; +import { useEffect } from "react"; +import { StyleSheet, Text, View } from "react-native"; import Screen from "../../layout/Screen"; -import {Button, ButtonTray} from "../../UI/Button"; +import { Button, ButtonTray } from "../../UI/Button"; import Card from "../../UI/Card"; -import {getSession} from "../../../hooks/SessionStore"; -import {GAME_MODE} from "../../../utils/gameConstants"; +import { getSession } from "../../../hooks/SessionStore"; +import { GAME_MODE } from "../../../utils/gameConstants"; const GlobalCacheViewScreen = ({ navigation, route }) => { // Initialisations --------------------- @@ -67,7 +67,8 @@ const GlobalCacheViewScreen = ({ navigation, route }) => { {!initIsFound ? ( - Claim this cache from the Global Map while within 30m and facing it. + Claim this cache from the Global Map while within 30m and facing + it. ) : null} @@ -91,7 +92,7 @@ const styles = StyleSheet.create({ title: { fontSize: 22, fontWeight: "700", - color: "#111827", + color: "#cdd6f4", }, statusBadge: { alignSelf: "flex-start", @@ -100,15 +101,15 @@ const styles = StyleSheet.create({ borderRadius: 12, }, badgeFound: { - backgroundColor: "#d1fae5", + backgroundColor: "#1e3a2f", }, badgeOpen: { - backgroundColor: "#fef3c7", + backgroundColor: "#3d3117", }, statusText: { fontSize: 13, fontWeight: "600", - color: "#374151", + color: "#cdd6f4", }, detailRow: { gap: 2, @@ -116,17 +117,17 @@ const styles = StyleSheet.create({ label: { fontSize: 12, fontWeight: "600", - color: "#6b7280", + color: "#a6adc8", textTransform: "uppercase", letterSpacing: 0.5, }, value: { fontSize: 15, - color: "#111827", + color: "#cdd6f4", }, claimHint: { marginTop: 6, - color: "#2563eb", + color: "#89b4fa", fontSize: 13, fontWeight: "600", }, diff --git a/src/components/screens/global/GlobalEventsScreen.js b/src/components/screens/global/GlobalEventsScreen.js index e069645..6ae1e3d 100644 --- a/src/components/screens/global/GlobalEventsScreen.js +++ b/src/components/screens/global/GlobalEventsScreen.js @@ -1,21 +1,17 @@ -import {useCallback, useEffect, useRef, useState} from "react"; -import {ActivityIndicator, StyleSheet, Text, View} from "react-native"; +import { useCallback, useEffect, useRef, useState } from "react"; +import { ActivityIndicator, StyleSheet, Text, View } from "react-native"; import Screen from "../../layout/Screen"; -import {Button, ButtonTray} from "../../UI/Button"; +import { Button, ButtonTray } from "../../UI/Button"; import EventList from "../../../entity/event/EventList"; import useGlobalHook from "../../../hooks/useGlobalHook"; -import {getSession, setGlobalSession} from "../../../hooks/SessionStore"; -import {GAME_MODE} from "../../../utils/gameConstants"; +import { getSession, setGlobalSession } from "../../../hooks/SessionStore"; +import { GAME_MODE } from "../../../utils/gameConstants"; const GlobalEventsScreen = ({ navigation }) => { // Initialisations --------------------- - const { - getPublicEvents, - getPlayersByEvent, - joinEvent, - isGlobalApiReady, - } = useGlobalHook(); + const { getPublicEvents, getPlayersByEvent, joinEvent, isGlobalApiReady } = + useGlobalHook(); const session = getSession(); const globalApiRef = useRef({ getPublicEvents, @@ -45,7 +41,9 @@ const GlobalEventsScreen = ({ navigation }) => { if (!globalApiRef.current.isGlobalApiReady()) { setEvents([]); - setError("Global API URL is not configured yet. Add it in src/components/API/api.json."); + setError( + "Global API URL is not configured yet. Add it in src/components/API/api.json.", + ); setIsLoading(false); return; } @@ -68,7 +66,9 @@ const GlobalEventsScreen = ({ navigation }) => { setJoining(event.EventID); if (!globalApiRef.current.isGlobalApiReady()) { - setError("Global API URL is not configured yet. Add it in src/components/API/api.json."); + setError( + "Global API URL is not configured yet. Add it in src/components/API/api.json.", + ); setJoining(null); return; } @@ -82,7 +82,10 @@ const GlobalEventsScreen = ({ navigation }) => { }; // Check if already a player - const players = await globalApiRef.current.getPlayersByEvent(event.EventID, {forceRefresh: true}); + const players = await globalApiRef.current.getPlayersByEvent( + event.EventID, + { forceRefresh: true }, + ); const existing = (players || []).find( (p) => String(p.PlayerUserID) === String(globalUserId), ); @@ -110,7 +113,10 @@ const GlobalEventsScreen = ({ navigation }) => { } // If create fails due duplicate race/server behavior, recover by re-reading players. - const refreshedPlayers = await globalApiRef.current.getPlayersByEvent(event.EventID, {forceRefresh: true}); + const refreshedPlayers = await globalApiRef.current.getPlayersByEvent( + event.EventID, + { forceRefresh: true }, + ); const recovered = (refreshedPlayers || []).find( (p) => String(p.PlayerUserID) === String(globalUserId), ); @@ -131,7 +137,10 @@ const GlobalEventsScreen = ({ navigation }) => { -