From 38a868a962b11e262b7b47525a5182be40e77287 Mon Sep 17 00:00:00 2001 From: Riccardo Mancini Date: Wed, 16 Sep 2026 15:11:55 +0200 Subject: [PATCH] Add back button to dashboard header The dashboard is a hidden tab screen with the tab bar hidden, so on iOS there was no way to return home (no hardware back, no swipe gesture on tabs). Match the construction-site header pattern. Co-Authored-By: Claude Opus 5 --- app/(protected)/dashboard/index.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/(protected)/dashboard/index.tsx b/app/(protected)/dashboard/index.tsx index 8b33391..4eefd8e 100644 --- a/app/(protected)/dashboard/index.tsx +++ b/app/(protected)/dashboard/index.tsx @@ -2,7 +2,8 @@ import React, { useState, useEffect, useMemo, useRef } from 'react'; import { View, Text, ScrollView, TouchableOpacity, ActivityIndicator, Dimensions } from 'react-native'; import { SafeAreaView } from 'react-native-safe-area-context'; import { StatusBar } from 'expo-status-bar'; -import { ChevronDown, ChevronUp, LayoutDashboard } from 'lucide-react-native'; +import { useRouter } from 'expo-router'; +import { ChevronDown, ChevronLeft, ChevronUp, LayoutDashboard } from 'lucide-react-native'; import api from '@/utils/api'; import EchartWrapper from '@/components/EchartWrapper'; import { @@ -22,6 +23,7 @@ const TOOLTIP_BASE = { const screenWidth = Dimensions.get("window").width; export default function DashboardScreen() { + const router = useRouter(); const [chartData, setChartData] = useState({ costiRicavi: null, @@ -206,7 +208,13 @@ export default function DashboardScreen() { - + router.navigate('/')} + className="p-2 -ml-2 rounded-full active:bg-white/20 w-12 items-center justify-center" + > + + + Grafici e Statistiche Dashboard