Skip to content

Commit e7cf20e

Browse files
committed
UI change
1 parent 39684b8 commit e7cf20e

1 file changed

Lines changed: 49 additions & 42 deletions

File tree

App/Pot-Hole-Detector-Frontend/app/(tabs)/dashboard.tsx

Lines changed: 49 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -314,48 +314,52 @@ export default function Dashboard() {
314314
<Text style={styles.loadingText}>Loading Dashboard...</Text>
315315
</View>
316316
) : (
317-
<FlatList
318-
data={recentDetections}
319-
keyExtractor={(item) => item.id.toString()}
320-
renderItem={renderRecentDetection}
321-
ListHeaderComponent={ListHeader}
322-
ListFooterComponent={
323-
<>
324-
{/* Map with Pothole Locations */}
325-
<View style={styles.mapCard}>
326-
<Text style={styles.cardTitle}>Pothole Locations in India</Text>
327-
{mapMarkers.length > 0 ? (
328-
<MapView
329-
style={styles.map}
330-
initialRegion={{
331-
latitude: 20.5937,
332-
longitude: 78.9629,
333-
latitudeDelta: 30,
334-
longitudeDelta: 30,
335-
}}
336-
>
337-
{mapMarkers.map((marker: MapMarker) => (
338-
<Marker
339-
key={marker.id}
340-
coordinate={{
341-
latitude: marker.latitude,
342-
longitude: marker.longitude,
343-
}}
344-
title={marker.title}
345-
/>
346-
))}
347-
</MapView>
348-
) : (
349-
<View style={[styles.map, styles.noMapData]}>
350-
<Text style={styles.noMapDataText}>No pothole locations to display</Text>
351-
</View>
352-
)}
353-
</View>
354-
</>
355-
}
356-
contentContainerStyle={styles.flatListContent}
357-
showsVerticalScrollIndicator={false}
358-
/>
317+
<View style={styles.contentContainer}>
318+
<FlatList
319+
data={recentDetections}
320+
keyExtractor={(item) => item.id.toString()}
321+
renderItem={renderRecentDetection}
322+
ListHeaderComponent={ListHeader}
323+
ListFooterComponent={
324+
<>
325+
{/* Map with Pothole Locations */}
326+
<View style={styles.mapCard}>
327+
<Text style={styles.cardTitle}>Pothole Locations in India</Text>
328+
{mapMarkers.length > 0 ? (
329+
<MapView
330+
style={styles.map}
331+
initialRegion={{
332+
latitude: 20.5937,
333+
longitude: 78.9629,
334+
latitudeDelta: 30,
335+
longitudeDelta: 30,
336+
}}
337+
>
338+
{mapMarkers.map((marker: MapMarker) => (
339+
<Marker
340+
key={marker.id}
341+
coordinate={{
342+
latitude: marker.latitude,
343+
longitude: marker.longitude,
344+
}}
345+
title={marker.title}
346+
/>
347+
))}
348+
</MapView>
349+
) : (
350+
<View style={[styles.map, styles.noMapData]}>
351+
<Text style={styles.noMapDataText}>No pothole locations to display</Text>
352+
</View>
353+
)}
354+
</View>
355+
{/* Add bottom padding to account for BottomNav */}
356+
<View style={{ height: 80 }} />
357+
</>
358+
}
359+
contentContainerStyle={styles.flatListContent}
360+
showsVerticalScrollIndicator={false}
361+
/>
362+
</View>
359363
)}
360364
<BottomNav />
361365
</View>
@@ -367,6 +371,9 @@ const styles = StyleSheet.create({
367371
flex: 1,
368372
backgroundColor: '#fff',
369373
},
374+
contentContainer: {
375+
flex: 1,
376+
},
370377
safeArea: {
371378
flex: 1,
372379
backgroundColor: '#EFEFEF',

0 commit comments

Comments
 (0)