From de9d2ad3dfa19fbd4b01f0c6830fcbef6cb8edc4 Mon Sep 17 00:00:00 2001 From: xudan Date: Wed, 23 Jul 2025 14:26:53 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=20@react-native-pick?= =?UTF-8?q?er/picker=20=E4=BE=9D=E8=B5=96=EF=BC=8C=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E8=A1=A8=E5=8D=95=E4=BB=A5=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E9=80=89=E6=8B=A9=E5=8F=82=E6=95=B0=EF=BC=8C?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=BB=E5=8A=A1=E5=8D=A1=E7=89=87=E5=92=8C?= =?UTF-8?q?=E5=BA=95=E9=83=A8=E6=93=8D=E4=BD=9C=E6=A0=8F=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 14 ++ package.json | 1 + src/components/BottomActionBar.tsx | 80 ++++++--- src/components/TaskCard.tsx | 94 ++++++----- src/components/TaskForm.tsx | 255 +++++++++++++++++++++++----- src/context/Tasks.tsx | 1 + src/context/TasksContext.tsx | 260 ++++++++++++++++------------- src/screens/TaskEditScreen.tsx | 57 ++++--- src/screens/TaskListScreen.tsx | 33 ++-- src/types/config.ts | 5 +- src/types/task.ts | 22 +-- 11 files changed, 548 insertions(+), 274 deletions(-) create mode 100644 src/context/Tasks.tsx diff --git a/package-lock.json b/package-lock.json index 3d38cf6..6e4a376 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "0.0.1", "dependencies": { "@react-native-async-storage/async-storage": "^2.2.0", + "@react-native-picker/picker": "^2.11.1", "@react-native/new-app-screen": "0.80.1", "@react-navigation/bottom-tabs": "^7.4.2", "@react-navigation/native": "^7.1.14", @@ -2989,6 +2990,19 @@ "node": ">=10" } }, + "node_modules/@react-native-picker/picker": { + "version": "2.11.1", + "resolved": "https://registry.npmmirror.com/@react-native-picker/picker/-/picker-2.11.1.tgz", + "integrity": "sha512-ThklnkK4fV3yynnIIRBkxxjxR4IFbdMNJVF6tlLdOJ/zEFUEFUEdXY0KmH0iYzMwY8W4/InWsLiA7AkpAbnexA==", + "license": "MIT", + "workspaces": [ + "example" + ], + "peerDependencies": { + "react": "*", + "react-native": "*" + } + }, "node_modules/@react-native/assets-registry": { "version": "0.80.1", "resolved": "https://registry.npmmirror.com/@react-native/assets-registry/-/assets-registry-0.80.1.tgz", diff --git a/package.json b/package.json index 4d49da3..0b06553 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ }, "dependencies": { "@react-native-async-storage/async-storage": "^2.2.0", + "@react-native-picker/picker": "^2.11.1", "@react-native/new-app-screen": "0.80.1", "@react-navigation/bottom-tabs": "^7.4.2", "@react-navigation/native": "^7.1.14", diff --git a/src/components/BottomActionBar.tsx b/src/components/BottomActionBar.tsx index a0b86d0..8cc9f4e 100644 --- a/src/components/BottomActionBar.tsx +++ b/src/components/BottomActionBar.tsx @@ -1,13 +1,11 @@ import React from 'react'; -import { View, StyleSheet } from 'react-native'; -import { Button, useTheme } from '@rneui/themed'; +import { View, StyleSheet, TouchableOpacity, Text } from 'react-native'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; interface BottomActionBarProps { onRun: () => void; onSave: () => void; onUndo: () => void; - onRestore: () => void; onBack: () => void; isSaveDisabled?: boolean; } @@ -16,34 +14,78 @@ const BottomActionBar: React.FC = ({ onRun, onSave, onUndo, - onRestore, onBack, isSaveDisabled = true, }) => { - const { theme } = useTheme(); - return ( - -