From: Thibaud Moustier Date: Mon, 23 Feb 2026 14:18:14 +0000 (+0100) Subject: Mobile : push après récup main clean X-Git-Url: https://git.digitality.be/?a=commitdiff_plain;h=b3b0d20c2085e36aa714dac29b4eb486387b401f;p=pdw25-26 Mobile : push après récup main clean --- diff --git a/mobile-ui/src/components/ActionsCard.tsx b/mobile-ui/src/components/ActionsCard.tsx new file mode 100644 index 0000000..f8fe47a --- /dev/null +++ b/mobile-ui/src/components/ActionsCard.tsx @@ -0,0 +1,60 @@ +import { View, Text, StyleSheet, TouchableOpacity } from "react-native"; + +type Props = { + onGoSettings: () => void; +}; + +export default function ActionsCard({ onGoSettings }: Props) { + return ( + + Actions + + + + Voir stratégie + + + + Historique + + + + Paramètres + + + + ); +} + +const styles = StyleSheet.create({ + card: { + borderWidth: 1, + borderColor: "#aaa", + padding: 12, + marginBottom: 12, + borderRadius: 6, + }, + sectionTitle: { + fontWeight: "bold", + marginBottom: 6, + fontSize: 16, + }, + row: { + flexDirection: "row", + flexWrap: "wrap", + gap: 8, + }, + button: { + backgroundColor: "#555", + paddingHorizontal: 10, + paddingVertical: 10, + borderRadius: 4, + flexGrow: 1, + flexBasis: "48%", + alignItems: "center", + }, + buttonText: { + color: "#fff", + fontWeight: "bold", + }, +}); \ No newline at end of file diff --git a/mobile-ui/src/components/MarketCard.tsx b/mobile-ui/src/components/MarketCard.tsx new file mode 100644 index 0000000..ea712ab --- /dev/null +++ b/mobile-ui/src/components/MarketCard.tsx @@ -0,0 +1,70 @@ +import { View, Text, StyleSheet } from "react-native"; +import type { DashboardSummary } from "../types/DashboardSummary"; +import type { UserSettings } from "../models/UserSettings"; +import { ui } from "./ui/uiStyles"; + +type Props = { + summary: DashboardSummary; + settings: UserSettings; +}; + +export default function MarketCard({ summary, settings }: Props) { + return ( + + Marché + + {summary.pair} + + + Prix actuel + + {summary.price.toFixed(2)} {settings.currency} + + + + + Dernière mise à jour : {new Date(summary.timestamp).toLocaleString()} + + + ); +} + +const styles = StyleSheet.create({ + card: { + borderWidth: 1, + borderColor: "#aaa", + padding: 12, + marginBottom: 12, + borderRadius: 6, + }, + sectionTitle: { + fontWeight: "bold", + marginBottom: 6, + fontSize: 16, + }, + price: { + fontSize: 26, + fontWeight: "bold", + textAlign: "center", + marginVertical: 6, + }, + priceRow: { + flexDirection: "row", + justifyContent: "space-between", + alignItems: "center", + marginVertical: 4, + }, + value: { + fontSize: 16, + }, + valueBold: { + fontSize: 16, + fontWeight: "bold", + }, + updated: { + fontSize: 12, + opacity: 0.6, + marginTop: 6, + textAlign: "center", + }, +}); \ No newline at end of file diff --git a/mobile-ui/src/components/StrategyCard.tsx b/mobile-ui/src/components/StrategyCard.tsx new file mode 100644 index 0000000..1a940e7 --- /dev/null +++ b/mobile-ui/src/components/StrategyCard.tsx @@ -0,0 +1,82 @@ +import { View, Text } from "react-native"; +import type { + DashboardSummary, + TradeDecision, + AlertLevel, +} from "../types/DashboardSummary"; +import { ui } from "./ui/uiStyles"; + +type Props = { + summary: DashboardSummary; +}; + +function getDecisionColor(decision: TradeDecision): string { + switch (decision) { + case "BUY": + return "#16a34a"; + case "SELL": + return "#dc2626"; + case "STOP_LOSS": + return "#991b1b"; + case "HOLD": + default: + return "#ca8a04"; + } +} + +function getAlertColor(level: AlertLevel): string { + switch (level) { + case "CRITICAL": + return "#b91c1c"; + case "WARNING": + return "#ca8a04"; + case "INFO": + default: + return "#2563eb"; + } +} + +/** + * StrategyCard + * ------------ + * Affiche la stratégie + décision (BUY/SELL/HOLD/STOP_LOSS) + * + niveau d'alerte (CRITICAL/WARNING/INFO) + * + confiance et raison. + * + * Les enums sont affichés en badges ("pill") pour être lisibles sur mobile. + */ +export default function StrategyCard({ summary }: Props) { + const decisionColor = getDecisionColor(summary.decision); + const alertColor = getAlertColor(summary.alertLevel); + + return ( + + Stratégie + + {summary.strategy} + + {/* Badge décision */} + + + {summary.decision} + + + + {/* Badge niveau d'alerte */} + + + {summary.alertLevel} + + + + + Confiance + + {(summary.confidence * 100).toFixed(1)} % + + + + {summary.reason} + + ); +} \ No newline at end of file diff --git a/mobile-ui/src/components/WalletCard.tsx b/mobile-ui/src/components/WalletCard.tsx new file mode 100644 index 0000000..4fbcb88 --- /dev/null +++ b/mobile-ui/src/components/WalletCard.tsx @@ -0,0 +1,55 @@ +import { View, Text, StyleSheet } from "react-native"; +import type { UserSettings } from "../models/UserSettings"; + +type Props = { + settings: UserSettings; +}; + +export default function WalletCard({ settings }: Props) { + return ( + + Portefeuille + + + Valeur totale + 10 000 {settings.currency} + + + Step 1 : mono-utilisateur / mono-crypto + + ); +} + +const styles = StyleSheet.create({ + card: { + borderWidth: 1, + borderColor: "#aaa", + padding: 12, + marginBottom: 12, + borderRadius: 6, + }, + sectionTitle: { + fontWeight: "bold", + marginBottom: 6, + fontSize: 16, + }, + priceRow: { + flexDirection: "row", + justifyContent: "space-between", + alignItems: "center", + marginVertical: 4, + }, + value: { + fontSize: 16, + }, + valueBold: { + fontSize: 16, + fontWeight: "bold", + }, + updated: { + fontSize: 12, + opacity: 0.6, + marginTop: 6, + textAlign: "center", + }, +}); \ No newline at end of file diff --git a/mobile-ui/src/components/ui/uiStyles.ts b/mobile-ui/src/components/ui/uiStyles.ts new file mode 100644 index 0000000..3f2233f --- /dev/null +++ b/mobile-ui/src/components/ui/uiStyles.ts @@ -0,0 +1,84 @@ +import { StyleSheet } from "react-native"; + +export const ui = StyleSheet.create({ + screen: { + backgroundColor: "#f6f7fb", + }, + + card: { + backgroundColor: "#fff", + borderRadius: 14, + padding: 14, + marginBottom: 12, + + // ombre iOS + shadowColor: "#000", + shadowOpacity: 0.08, + shadowRadius: 10, + shadowOffset: { width: 0, height: 4 }, + + // ombre Android + elevation: 3, + }, + + title: { + fontSize: 16, + fontWeight: "700", + marginBottom: 10, + }, + + muted: { + opacity: 0.65, + fontSize: 12, + }, + + rowBetween: { + flexDirection: "row", + justifyContent: "space-between", + alignItems: "center", + }, + + value: { + fontSize: 16, + }, + + valueBold: { + fontSize: 16, + fontWeight: "700", + }, + + bigCenter: { + fontSize: 28, + fontWeight: "800", + textAlign: "center", + marginVertical: 6, + }, + + badge: { + alignSelf: "center", + paddingHorizontal: 12, + paddingVertical: 6, + borderRadius: 999, + marginTop: 6, + }, + + badgeText: { + fontWeight: "800", + fontSize: 12, + letterSpacing: 0.3, + }, + + button: { + backgroundColor: "#111827", + paddingVertical: 12, + borderRadius: 12, + alignItems: "center", + flexGrow: 1, + flexBasis: "48%", + }, + + buttonText: { + color: "#fff", + fontWeight: "800", + }, +}); \ No newline at end of file