From f817a56c1e035effb7a424b29e42a59537b6d561 Mon Sep 17 00:00:00 2001 From: Thibaud Moustier Date: Wed, 25 Feb 2026 16:51:27 +0100 Subject: [PATCH] Mobile : retrait de ActionCard + mis a jour UI Dashboard --- Wallette/mobile/App.tsx | 53 ++++++++++++------- .../mobile/src/components/ActionsCard.tsx | 40 -------------- .../mobile/src/screens/DashboardScreen.tsx | 45 +++++++++------- 3 files changed, 60 insertions(+), 78 deletions(-) delete mode 100644 Wallette/mobile/src/components/ActionsCard.tsx diff --git a/Wallette/mobile/App.tsx b/Wallette/mobile/App.tsx index d662a45..8f9403f 100644 --- a/Wallette/mobile/App.tsx +++ b/Wallette/mobile/App.tsx @@ -1,6 +1,6 @@ import { NavigationContainer } from "@react-navigation/native"; import { createNativeStackNavigator } from "@react-navigation/native-stack"; -import { TouchableOpacity, View } from "react-native"; +import { TouchableOpacity } from "react-native"; import { Ionicons } from "@expo/vector-icons"; import DashboardScreen from "./src/screens/DashboardScreen"; @@ -10,6 +10,7 @@ import AlertsScreen from "./src/screens/AlertsScreen"; import StrategyScreen from "./src/screens/StrategyScreen"; import WalletScreen from "./src/screens/WalletScreen"; +// Types des routes (pour éviter les erreurs de navigation) export type RootStackParamList = { Dashboard: undefined; Settings: undefined; @@ -31,28 +32,42 @@ export default function App() { options={({ navigation }) => ({ title: "Dashboard", headerRight: () => ( - - navigation.navigate("Alerts")}> - - - - navigation.navigate("History")}> - - - - navigation.navigate("Settings")}> - - - + navigation.navigate("Settings")}> + + ), })} /> - - - - - + + + + + + + + + ); diff --git a/Wallette/mobile/src/components/ActionsCard.tsx b/Wallette/mobile/src/components/ActionsCard.tsx deleted file mode 100644 index d49b260..0000000 --- a/Wallette/mobile/src/components/ActionsCard.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import { View, Text, TouchableOpacity } from "react-native"; -import { ui } from "./ui/uiStyles"; - -type Props = { - onGoSettings: () => void; - onGoHistory: () => void; - onGoAlerts: () => void; -}; - -/** - * ActionsCard - * ----------- - * Regroupe les actions rapides de l'utilisateur. - * Pour l'instant : - * - Voir stratégie (placeholder) - * - Historique (placeholder) - * - Paramètres (navigation réelle via callback) - * - Alertes (navigation réelle via callback) - */ -export default function ActionsCard({ onGoSettings, onGoHistory, onGoAlerts }: Props) { - return ( - - Actions - - - - Alertes - - - - Historique - - - - Paramètres - - - - ); -} \ No newline at end of file diff --git a/Wallette/mobile/src/screens/DashboardScreen.tsx b/Wallette/mobile/src/screens/DashboardScreen.tsx index 1efa648..8bd123a 100644 --- a/Wallette/mobile/src/screens/DashboardScreen.tsx +++ b/Wallette/mobile/src/screens/DashboardScreen.tsx @@ -9,6 +9,7 @@ import { import { useState, useCallback, useEffect, useMemo } from "react"; import { SafeAreaView } from "react-native-safe-area-context"; import { useFocusEffect, useNavigation } from "@react-navigation/native"; +import { Ionicons } from "@expo/vector-icons"; import type { DashboardSummary } from "../types/DashboardSummary"; import { fetchDashboardSummary } from "../services/dashboardService"; @@ -29,18 +30,12 @@ import type { WalletState } from "../models/Wallet"; /** * DashboardScreen (WF-01) — Responsive + No-scroll goal * ---------------------------------------------------- - * - Navigation via header icons (Alerts / History / Settings) dans App.tsx - * - Cartes cliquables : + * - Cartes cliquables (chevron subtil) : * * Portefeuille -> Wallet * * Urgence -> Alertes * * Prix BTC -> Historique * - Conseiller : bouton -> Stratégie * - Socket.IO non bloquant + notifications locales - * - * Portefeuille (Step 1): - * - Quantité BTC stockée localement (AsyncStorage) - * - Valeur totale = quantity * prix BTC - * - Ligne info: "BTC @ prix actuel" */ export default function DashboardScreen() { const { height } = useWindowDimensions(); @@ -218,6 +213,10 @@ export default function DashboardScreen() { ); } + const Chevron = () => ( + + ); + return ( Wallet */} navigation.navigate("Wallet" as never)}> - Portefeuille + + Portefeuille + + Quantité BTC : @@ -271,7 +273,6 @@ export default function DashboardScreen() { - {/* ✅ Ligne informative : BTC @ prix actuel */} BTC @ {summary.price.toFixed(2)} {settings.currency} @@ -281,7 +282,10 @@ export default function DashboardScreen() { {/* 3) URGENCE — cliquable => Alertes */} navigation.navigate("Alerts" as never)}> - Urgence + + Urgence + + {urgentAlert ? ( @@ -300,10 +304,6 @@ export default function DashboardScreen() { Socket : {socketConnected ? "connecté ✅" : "déconnecté ⚠️"} {socketError ? ` — ${socketError}` : ""} - - - Appuie pour ouvrir “Alertes” - @@ -311,7 +311,10 @@ export default function DashboardScreen() { navigation.navigate("History" as never)}> - Prix BTC + + Prix BTC + + - - - Appuie pour ouvrir “Historique” - @@ -405,6 +404,13 @@ const styles = StyleSheet.create({ marginTop: 10, }, + // ✅ header row + chevron icon + headerRow: { + flexDirection: "row", + justifyContent: "space-between", + alignItems: "center", + }, + urgentBox: { borderWidth: 1, borderColor: "#e5e7eb", @@ -426,6 +432,7 @@ const styles = StyleSheet.create({ alignItems: "center", marginBottom: 8, }, + refreshBtn: { paddingHorizontal: 12, paddingVertical: 8, -- 2.50.1