diff --git a/apps/mobile/app/screens/Authenticated/ProfileScreen/components/ListCardItem.tsx b/apps/mobile/app/screens/Authenticated/ProfileScreen/components/ListCardItem.tsx index de7d9e097..960bfb20a 100644 --- a/apps/mobile/app/screens/Authenticated/ProfileScreen/components/ListCardItem.tsx +++ b/apps/mobile/app/screens/Authenticated/ProfileScreen/components/ListCardItem.tsx @@ -25,6 +25,8 @@ import { secondsToTime } from '../../../../helpers/date'; import { useTaskStatistics } from '../../../../services/hooks/features/useTaskStatics'; import { useStores } from '../../../../models'; import IssuesModal from '../../../../components/IssuesModal'; +import { SettingScreenNavigationProp } from '../../../../navigators/AuthenticatedNavigator'; +import { useNavigation } from '@react-navigation/native'; export type ListItemProps = { active?: boolean; @@ -61,6 +63,12 @@ export const ListItemContent: React.FC = observer((props) => { return (activeTaskTotalStat?.duration * 100) / props.task?.estimate || 0; }, [timerStatus, props.activeAuthTask, activeTaskTotalStat]); + const navigation = useNavigation>(); + + const navigateToTask = (taskId: string) => { + !editTitle && navigation.navigate('TaskScreen', { taskId }); + }; + return ( { @@ -97,12 +105,20 @@ export const ListItemContent: React.FC = observer((props) => { - - - + navigateToTask(props.task?.id)}> + + + + + + - - + {!enableEstimate ? ( setEnableEstimate(true)}> unknown; task: ITeamTask; + navigateToTask: (taskId: string) => void; } -const TaskTitleDisplay: FC = ({ editMode, setEditMode, task }) => { +const TaskTitleDisplay: FC = ({ editMode, setEditMode, task, navigateToTask }) => { const { colors } = useAppTheme(); const { updateTask } = useTeamTasks(); const [taskTitle, setTaskTitle] = useState(task.title); @@ -60,7 +61,7 @@ const TaskTitleDisplay: FC = ({ editMode, setEditMode, task }) => { } return ( - setEditMode(true)}> + setEditMode(true)} onPress={() => navigateToTask(task?.id)}> #{task.number} @@ -72,7 +73,7 @@ const TaskTitleDisplay: FC = ({ editMode, setEditMode, task }) => { - + ); };