]> git.digitality.be Git - pdw25-26/commitdiff
Mobile : retrait de ActionCard + mis a jour UI Dashboard
authorThibaud Moustier <thibaudmoustier0@gmail.com>
Wed, 25 Feb 2026 15:51:27 +0000 (16:51 +0100)
committerThibaud Moustier <thibaudmoustier0@gmail.com>
Wed, 25 Feb 2026 15:51:27 +0000 (16:51 +0100)
Wallette/mobile/App.tsx
Wallette/mobile/src/components/ActionsCard.tsx [deleted file]
Wallette/mobile/src/screens/DashboardScreen.tsx

index d662a45dccb0d51db56acb374f8a1f684fda82db..8f9403ff4f5030d083c2464201f265c112703819 100644 (file)
@@ -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: () => (
-              <View style={{ flexDirection: "row", gap: 12 }}>
-                <TouchableOpacity onPress={() => navigation.navigate("Alerts")}>
-                  <Ionicons name="notifications-outline" size={22} color="#0f172a" />
-                </TouchableOpacity>
-
-                <TouchableOpacity onPress={() => navigation.navigate("History")}>
-                  <Ionicons name="time-outline" size={22} color="#0f172a" />
-                </TouchableOpacity>
-
-                <TouchableOpacity onPress={() => navigation.navigate("Settings")}>
-                  <Ionicons name="settings-outline" size={22} color="#0f172a" />
-                </TouchableOpacity>
-              </View>
+              <TouchableOpacity onPress={() => navigation.navigate("Settings")}>
+                <Ionicons name="settings-outline" size={22} color="#0f172a" />
+              </TouchableOpacity>
             ),
           })}
         />
 
-        <Stack.Screen name="Wallet" component={WalletScreen} options={{ title: "Portefeuille" }} />
-        <Stack.Screen name="Strategy" component={StrategyScreen} options={{ title: "Stratégie" }} />
-        <Stack.Screen name="Alerts" component={AlertsScreen} options={{ title: "Alertes" }} />
-        <Stack.Screen name="History" component={HistoryScreen} options={{ title: "Historique" }} />
-        <Stack.Screen name="Settings" component={SettingsScreen} options={{ title: "Paramètres" }} />
+        <Stack.Screen
+          name="Wallet"
+          component={WalletScreen}
+          options={{ title: "Portefeuille" }}
+        />
+
+        <Stack.Screen
+          name="Strategy"
+          component={StrategyScreen}
+          options={{ title: "Stratégie" }}
+        />
+
+        <Stack.Screen
+          name="Alerts"
+          component={AlertsScreen}
+          options={{ title: "Alertes" }}
+        />
+
+        <Stack.Screen
+          name="History"
+          component={HistoryScreen}
+          options={{ title: "Historique" }}
+        />
+
+        <Stack.Screen
+          name="Settings"
+          component={SettingsScreen}
+          options={{ title: "Paramètres" }}
+        />
       </Stack.Navigator>
     </NavigationContainer>
   );
diff --git a/Wallette/mobile/src/components/ActionsCard.tsx b/Wallette/mobile/src/components/ActionsCard.tsx
deleted file mode 100644 (file)
index d49b260..0000000
+++ /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 (
-    <View style={ui.card}>
-      <Text style={ui.title}>Actions</Text>
-
-      <View style={[ui.rowBetween, { flexWrap: "wrap", gap: 8 }]}>
-        <TouchableOpacity style={ui.button} onPress={onGoAlerts}>
-          <Text style={ui.buttonText}>Alertes</Text>
-        </TouchableOpacity>
-
-        <TouchableOpacity style={ui.button} onPress={onGoHistory}>
-          <Text style={ui.buttonText}>Historique</Text>
-        </TouchableOpacity>
-
-        <TouchableOpacity style={ui.button} onPress={onGoSettings}>
-          <Text style={ui.buttonText}>Paramètres</Text>
-        </TouchableOpacity>
-      </View>
-    </View>
-  );
-}
\ No newline at end of file
index 1efa64830d506bbb22016ef041160b075baa654b..8bd123a3a4b64874a67011bbff7e0e3a5ad77192 100644 (file)
@@ -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 = () => (
+    <Ionicons name="chevron-forward-outline" size={18} color="#0f172a" style={{ opacity: 0.35 }} />
+  );
+
   return (
     <SafeAreaView style={styles.safeArea}>
       <ScrollView
@@ -257,7 +256,10 @@ export default function DashboardScreen() {
         {/* 2) PORTEFEUILLE — cliquable => Wallet */}
         <TouchableOpacity activeOpacity={0.85} onPress={() => navigation.navigate("Wallet" as never)}>
           <View style={[ui.card, compact && styles.cardCompact]}>
-            <Text style={[ui.title, compact && styles.titleCompact]}>Portefeuille</Text>
+            <View style={styles.headerRow}>
+              <Text style={[ui.title, compact && styles.titleCompact]}>Portefeuille</Text>
+              <Chevron />
+            </View>
 
             <View style={ui.rowBetween}>
               <Text style={ui.value}>Quantité BTC :</Text>
@@ -271,7 +273,6 @@ export default function DashboardScreen() {
               </Text>
             </View>
 
-            {/* ✅ Ligne informative : BTC @ prix actuel */}
             <Text style={[ui.muted, { marginTop: 6 }]} numberOfLines={1}>
               BTC @ {summary.price.toFixed(2)} {settings.currency}
             </Text>
@@ -281,7 +282,10 @@ export default function DashboardScreen() {
         {/* 3) URGENCE — cliquable => Alertes */}
         <TouchableOpacity activeOpacity={0.85} onPress={() => navigation.navigate("Alerts" as never)}>
           <View style={[ui.card, compact && styles.cardCompact]}>
-            <Text style={[ui.title, compact && styles.titleCompact]}>Urgence</Text>
+            <View style={styles.headerRow}>
+              <Text style={[ui.title, compact && styles.titleCompact]}>Urgence</Text>
+              <Chevron />
+            </View>
 
             {urgentAlert ? (
               <View style={[styles.urgentBox, compact && styles.urgentBoxCompact]}>
@@ -300,10 +304,6 @@ export default function DashboardScreen() {
               Socket : {socketConnected ? "connecté ✅" : "déconnecté ⚠️"}
               {socketError ? ` — ${socketError}` : ""}
             </Text>
-
-            <Text style={[ui.muted, { marginTop: 6 }]} numberOfLines={1}>
-              Appuie pour ouvrir “Alertes”
-            </Text>
           </View>
         </TouchableOpacity>
 
@@ -311,7 +311,10 @@ export default function DashboardScreen() {
         <TouchableOpacity activeOpacity={0.85} onPress={() => navigation.navigate("History" as never)}>
           <View style={[ui.card, compact && styles.cardCompact]}>
             <View style={styles.priceHeaderRow}>
-              <Text style={[ui.title, compact && styles.titleCompact]}>Prix BTC</Text>
+              <View style={styles.headerRow}>
+                <Text style={[ui.title, compact && styles.titleCompact]}>Prix BTC</Text>
+                <Chevron />
+              </View>
 
               <TouchableOpacity
                 style={[styles.refreshBtn, refreshing && styles.refreshBtnDisabled, compact && styles.refreshBtnCompact]}
@@ -334,10 +337,6 @@ export default function DashboardScreen() {
                 </Text>
               </View>
             </View>
-
-            <Text style={[ui.muted, { marginTop: 6 }]} numberOfLines={1}>
-              Appuie pour ouvrir “Historique”
-            </Text>
           </View>
         </TouchableOpacity>
       </ScrollView>
@@ -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,