Peace 2 weeks ago
parent 8e145cc62e
commit 6fa7d875db
  1. 7
      lite.todo/app/(tabs)/done.tsx
  2. 6
      lite.todo/app/(tabs)/index.tsx
  3. 2
      lite.todo/app/_layout.tsx
  4. 16
      lite.todo/components/todo-list.tsx
  5. 2
      lite.todo/package.json

@ -14,7 +14,12 @@ export default function DoneTab() {
<SafeAreaView className="flex-1 px-4 py-1 bg-white dark:bg-neutral-900"> <SafeAreaView className="flex-1 px-4 py-1 bg-white dark:bg-neutral-900">
<VStack className="flex-1 gap-3"> <VStack className="flex-1 gap-3">
<Text className="text-2xl font-bold"> </Text> <Text className="text-2xl font-bold"> </Text>
<TodoList data={doneTodos} onToggle={toggle} onRemove={remove} /> <TodoList
data={doneTodos}
onToggle={toggle}
onRemove={remove}
emptyMessage="모두 완료하셨습니다."
/>
<HStack className="justify-end"> <HStack className="justify-end">
<Button <Button
className="flex-1" className="flex-1"

@ -44,14 +44,14 @@ export default function ActiveTab() {
</HStack> </HStack>
{/* 확인 창 */} {/* 확인 창 */}
<TodoList data={todos} onToggle={toggle} /> <TodoList data={activeTodos} onToggle={toggle} />
<Button {/* <Button
variant={GS.variant.outline} variant={GS.variant.outline}
action={GS.action.secondary} action={GS.action.secondary}
onPress={clearDone} onPress={clearDone}
> >
<ButtonText> </ButtonText> <ButtonText> </ButtonText>
</Button> </Button> */}
</VStack> </VStack>
</SafeAreaView> </SafeAreaView>
); );

@ -11,8 +11,8 @@ export default function App() {
return ( return (
<TodosProvider> <TodosProvider>
<GluestackUIProvider mode="light"> <GluestackUIProvider mode="light">
<StatusBar style="auto" />
<SafeAreaView style={{ flex: 1 }}> <SafeAreaView style={{ flex: 1 }}>
<StatusBar style="auto" />
<Stack screenOptions={{ header: () => null }} /> <Stack screenOptions={{ header: () => null }} />
</SafeAreaView> </SafeAreaView>
</GluestackUIProvider> </GluestackUIProvider>

@ -19,12 +19,14 @@ type Props = {
onToggle: (id: string) => void; onToggle: (id: string) => void;
onRemove?: (id: string) => void; onRemove?: (id: string) => void;
className?: string; className?: string;
emptyMessage?: string;
}; };
export default function TodoList({ export default function TodoList({
data, data,
onToggle, onToggle,
onRemove, onRemove,
emptyMessage,
className, className,
}: Props) { }: Props) {
return ( return (
@ -41,15 +43,15 @@ export default function TodoList({
onChange={(_isChecked) => onToggle(item.id)} onChange={(_isChecked) => onToggle(item.id)}
value={item.title} value={item.title}
> >
<Animatable.View {/* <Animatable.View
animation={item.done ? "bounce" : undefined} animation={item.done ? "bounce" : undefined}
duration={300} duration={300}
useNativeDriver useNativeDriver
> > */}
<CheckboxIndicator> <CheckboxIndicator>
<CheckboxIcon as={CheckIcon} /> <CheckboxIcon as={CheckIcon} />
</CheckboxIndicator> </CheckboxIndicator>
</Animatable.View> {/* </Animatable.View> */}
<CheckboxLabel className="data-[checked=true]:line-through"> <CheckboxLabel className="data-[checked=true]:line-through">
{item.title} {item.title}
</CheckboxLabel> </CheckboxLabel>
@ -76,7 +78,7 @@ export default function TodoList({
}} }}
ListEmptyComponent={ ListEmptyComponent={
<Text className="text-neutral-400 mt-6 text-center"> <Text className="text-neutral-400 mt-6 text-center">
. {emptyMessage ?? "할 일이 없습니다."}
</Text> </Text>
} }
/> />

@ -3,7 +3,7 @@
"version": "1.0.0", "version": "1.0.0",
"main": "expo-router/entry", "main": "expo-router/entry",
"scripts": { "scripts": {
"start": "expo start --offline", "start": "expo start",
"android": "expo start --android --offline", "android": "expo start --android --offline",
"ios": "expo start --ios --offline", "ios": "expo start --ios --offline",
"web": "expo start --web --offline" "web": "expo start --web --offline"

Loading…
Cancel
Save