From 036c178e7b0e665a15a592e43f132f3e2e6a50e8 Mon Sep 17 00:00:00 2001
From: Santo Cariotti <santo@dcariotti.me>
Date: Thu, 12 Sep 2024 12:00:07 +0200
Subject: Get all the three areas for an alert

---
 app/(tabs)/alerts/index.tsx | 21 ++++-----------------
 1 file changed, 4 insertions(+), 17 deletions(-)

(limited to 'app/(tabs)/alerts/index.tsx')

diff --git a/app/(tabs)/alerts/index.tsx b/app/(tabs)/alerts/index.tsx
index 9ba2cce..214839e 100644
--- a/app/(tabs)/alerts/index.tsx
+++ b/app/(tabs)/alerts/index.tsx
@@ -19,8 +19,6 @@ interface AlertData {
   id: string;
   userId: string;
   createdAt: string;
-  area: string;
-  level: string;
 }
 
 export default function AlertsScreen() {
@@ -42,7 +40,7 @@ export default function AlertsScreen() {
             'Content-Type': 'application/json',
           },
           body: JSON.stringify({
-            query: `{ alerts { id, userId, createdAt, area, level } }`,
+            query: `{ alerts { id, userId, createdAt } }`,
           }),
         }
       );
@@ -115,18 +113,7 @@ export default function AlertsScreen() {
 
   const renderAlert = ({ item }: { item: AlertData }) => (
     <ThemedView style={styles.alertContainer}>
-      <View
-        style={[
-          styles.alertBox,
-          {
-            backgroundColor: item.level === 'ONE'
-              ? '#27ae60'
-              : item.level === 'TWO'
-              ? '#e67e22'
-              : '#c0392b',
-          },
-        ]}
-      >
+      <View style={styles.alertBox}>
         <Link
           href={`/alerts/${item.id}`}
           style={{ width: '100%' }}
@@ -135,7 +122,6 @@ export default function AlertsScreen() {
             <Ionicons
               name="calendar-outline"
               size={18}
-              color="white"
               style={styles.icon}
             />
             <ThemedText style={styles.dateText}>
@@ -190,6 +176,7 @@ const styles = StyleSheet.create({
     shadowOffset: { width: 0, height: 2 },
     shadowOpacity: 0.1,
     shadowRadius: 4,
+    backgroundColor: '#fff'
   },
   dateRow: {
     flexDirection: 'row',
@@ -199,7 +186,7 @@ const styles = StyleSheet.create({
     marginRight: 8,
   },
   dateText: {
-    color: '#fff',
+    color: '#000',
   },
   listContent: {
     paddingBottom: 32,
-- 
cgit v1.2.3-18-g5258