From c990ce243b298722207aa6f6e7bfcc1e6743cd32 Mon Sep 17 00:00:00 2001 From: Marcusrehbock Date: Tue, 1 Sep 2026 23:24:32 +1000 Subject: [PATCH] refactor(projects): reuse cardEdges for the project list --- app/src/app/projects.tsx | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/app/src/app/projects.tsx b/app/src/app/projects.tsx index efc2ed1..03fd6f4 100644 --- a/app/src/app/projects.tsx +++ b/app/src/app/projects.tsx @@ -2,10 +2,10 @@ import { useRouter } from "expo-router"; import { useState } from "react"; import { FlatList, Pressable, StyleSheet, Text, TextInput, View } from "react-native"; import Icon from "../components/Icon"; -import { Empty, Pill, Separator } from "../components/ui"; +import { cardEdges, Empty, Pill, Separator } from "../components/ui"; import { haptic } from "../lib/haptics"; import { activeProjects, createProject, openTaskCount } from "../lib/store"; -import { C, radius, shadow, space, type } from "../lib/theme"; +import { C, radius, space, type } from "../lib/theme"; import { useStore } from "../lib/useStore"; export default function Projects() { @@ -42,8 +42,7 @@ export default function Projects() { [ s.row, - index === 0 && s.first, - index === projects.length - 1 && s.last, + ...cardEdges(index, projects.length), pressed && { backgroundColor: C.surface2 }, ]} onPress={() => router.push(`/project/${item.id}`)} @@ -92,13 +91,6 @@ const s = StyleSheet.create({ gap: space.md, paddingVertical: space.md + 2, paddingHorizontal: space.lg, - backgroundColor: C.surface, - }, - first: { borderTopLeftRadius: radius.lg, borderTopRightRadius: radius.lg }, - last: { - borderBottomLeftRadius: radius.lg, - borderBottomRightRadius: radius.lg, - ...shadow.card, }, title: { ...type.row, color: C.text }, meta: { ...type.meta, color: C.muted, marginTop: 2 },