From 8e145cc62ec8d2c6e8b1f7d2d8ff1efc255afcb6 Mon Sep 17 00:00:00 2001 From: Peace Date: Mon, 8 Sep 2025 17:28:28 +0900 Subject: [PATCH] mfe --- lite.todo/app/(tabs)/_layout.tsx | 71 +++++++++---------- lite.todo/app/(tabs)/done.tsx | 6 +- lite.todo/app/(tabs)/index.tsx | 66 +++++++++-------- lite.todo/app/_layout.tsx | 15 ++-- .../{TodoList.tsx => todo-list.tsx} | 22 ++++-- lite.todo/package-lock.json | 27 +++++++ lite.todo/package.json | 1 + lite.todo/store/todoProvider.tsx | 1 + 8 files changed, 129 insertions(+), 80 deletions(-) rename lite.todo/components/{TodoList.tsx => todo-list.tsx} (76%) diff --git a/lite.todo/app/(tabs)/_layout.tsx b/lite.todo/app/(tabs)/_layout.tsx index 39629d1..206ba45 100755 --- a/lite.todo/app/(tabs)/_layout.tsx +++ b/lite.todo/app/(tabs)/_layout.tsx @@ -1,45 +1,42 @@ import { Tabs } from "expo-router"; import { MaterialIcons } from "@expo/vector-icons"; -import { TodosProvider } from "@/store/todoProvider"; export default function TabLayout() { return ( - - + ( + + ), }} - > - ( - - ), - }} - /> - ( - - ), - }} - /> - - + /> + ( + + ), + }} + /> + ); } diff --git a/lite.todo/app/(tabs)/done.tsx b/lite.todo/app/(tabs)/done.tsx index 5417039..8d50bfe 100755 --- a/lite.todo/app/(tabs)/done.tsx +++ b/lite.todo/app/(tabs)/done.tsx @@ -1,4 +1,4 @@ -import TodoList from "@/components/TodoList"; +import TodoList from "@/components/todo-list"; import { Button, ButtonText } from "@/components/ui/button"; import { GS } from "@/components/ui/gluestack-ui-provider/gluestack-ui-token"; import { HStack } from "@/components/ui/hstack"; @@ -11,8 +11,8 @@ export default function DoneTab() { const { doneTodos, toggle, remove, clearDone } = useTodosCtx(); return ( - - + + 완료한 일 diff --git a/lite.todo/app/(tabs)/index.tsx b/lite.todo/app/(tabs)/index.tsx index 526bc58..ed39a74 100755 --- a/lite.todo/app/(tabs)/index.tsx +++ b/lite.todo/app/(tabs)/index.tsx @@ -1,4 +1,4 @@ -import TodoList from "@/components/TodoList"; +import TodoList from "@/components/todo-list"; import { Button, ButtonText } from "@/components/ui/button"; import { GS } from "@/components/ui/gluestack-ui-provider/gluestack-ui-token"; import { HStack } from "@/components/ui/hstack"; @@ -7,11 +7,12 @@ import { Text } from "@/components/ui/text"; import { VStack } from "@/components/ui/vstack"; import { useTodosCtx } from "@/store/todoProvider"; import { useState } from "react"; -import { KeyboardAvoidingView, Platform } from "react-native"; +import { KeyboardAvoidingView, Platform, View } from "react-native"; import { SafeAreaView } from "react-native-safe-area-context"; export default function ActiveTab() { - const { activeTodos, leftCount, add, toggle, completeAll } = useTodosCtx(); + const { todos, activeTodos, leftCount, add, toggle, completeAll, clearDone } = + useTodosCtx(); const [title, setTitle] = useState(""); const onAdd = () => { @@ -20,33 +21,38 @@ export default function ActiveTab() { }; return ( - - - - 할일 - {/* 확인 창 */} - - {/* 입력 창 */} - - - - - - - - + + + + 할 일 + + + {/* 입력 창 */} + + + + + + + + {/* 확인 창 */} + + + ); } diff --git a/lite.todo/app/_layout.tsx b/lite.todo/app/_layout.tsx index 6dd8451..d271037 100755 --- a/lite.todo/app/_layout.tsx +++ b/lite.todo/app/_layout.tsx @@ -5,15 +5,18 @@ import { Stack } from "expo-router"; import { GluestackUIProvider } from "@/components/ui/gluestack-ui-provider"; import "@/global.css"; +import { TodosProvider } from "@/store/todoProvider"; export default function App() { return ( - - - - null }} /> - - + + + + + null }} /> + + + ); } diff --git a/lite.todo/components/TodoList.tsx b/lite.todo/components/todo-list.tsx similarity index 76% rename from lite.todo/components/TodoList.tsx rename to lite.todo/components/todo-list.tsx index 76f6407..a5aa796 100755 --- a/lite.todo/components/TodoList.tsx +++ b/lite.todo/components/todo-list.tsx @@ -12,16 +12,24 @@ import { import { Button, ButtonText } from "./ui/button"; import { GS } from "./ui/gluestack-ui-provider/gluestack-ui-token"; import { CheckIcon, CloseIcon, Icon } from "@/components/ui/icon"; +import * as Animatable from "react-native-animatable"; type Props = { data: Todo[]; onToggle: (id: string) => void; onRemove?: (id: string) => void; + className?: string; }; -export default function TodoList({ data, onToggle, onRemove }: Props) { +export default function TodoList({ + data, + onToggle, + onRemove, + className, +}: Props) { return ( it.id} contentContainerStyle={{ paddingBottom: 80 }} @@ -33,9 +41,15 @@ export default function TodoList({ data, onToggle, onRemove }: Props) { onChange={(_isChecked) => onToggle(item.id)} value={item.title} > - - - + + + + + {item.title} diff --git a/lite.todo/package-lock.json b/lite.todo/package-lock.json index 76259f8..7066a20 100755 --- a/lite.todo/package-lock.json +++ b/lite.todo/package-lock.json @@ -26,6 +26,7 @@ "react-aria": "^3.33.0", "react-dom": "^19.1.1", "react-native": "0.79.6", + "react-native-animatable": "^1.4.0", "react-native-reanimated": "^4.1.0", "react-native-safe-area-context": "5.4.0", "react-native-screens": "~4.11.1", @@ -9340,6 +9341,23 @@ "node": ">= 6" } }, + "node_modules/prop-types": { + "version": "15.8.1", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", + "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.13.1" + } + }, + "node_modules/prop-types/node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "license": "MIT" + }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", @@ -9618,6 +9636,15 @@ } } }, + "node_modules/react-native-animatable": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/react-native-animatable/-/react-native-animatable-1.4.0.tgz", + "integrity": "sha512-DZwaDVWm2NBvBxf7I0wXKXLKb/TxDnkV53sWhCvei1pRyTX3MVFpkvdYBknNBqPrxYuAIlPxEp7gJOidIauUkw==", + "license": "MIT", + "dependencies": { + "prop-types": "^15.8.1" + } + }, "node_modules/react-native-css-interop": { "version": "0.1.22", "resolved": "https://registry.npmjs.org/react-native-css-interop/-/react-native-css-interop-0.1.22.tgz", diff --git a/lite.todo/package.json b/lite.todo/package.json index a6fc506..4598a73 100755 --- a/lite.todo/package.json +++ b/lite.todo/package.json @@ -27,6 +27,7 @@ "react-aria": "^3.33.0", "react-dom": "^19.1.1", "react-native": "0.79.6", + "react-native-animatable": "^1.4.0", "react-native-reanimated": "^4.1.0", "react-native-safe-area-context": "5.4.0", "react-native-screens": "~4.11.1", diff --git a/lite.todo/store/todoProvider.tsx b/lite.todo/store/todoProvider.tsx index df6e090..2d22316 100755 --- a/lite.todo/store/todoProvider.tsx +++ b/lite.todo/store/todoProvider.tsx @@ -6,6 +6,7 @@ type TodosContextValue = ReturnType; const TodosContext = createContext(null); export function TodosProvider({ children }: { children: React.ReactNode }) { + console.log("[TODO_PROVIDER] MOUNTED!"); const store = useTodos(); return ( {children}