diff --git a/apps/mobile/app/components/TeamDropdown/DropDownSection.tsx b/apps/mobile/app/components/TeamDropdown/DropDownSection.tsx index e6711ae90..cb4e6ed5d 100644 --- a/apps/mobile/app/components/TeamDropdown/DropDownSection.tsx +++ b/apps/mobile/app/components/TeamDropdown/DropDownSection.tsx @@ -41,10 +41,18 @@ const DropDownSection: FC = observer(function DropDownSection({ const others = teams.filter((t) => t.id !== activeTeamId); - const { colors } = useAppTheme(); + const { colors, dark } = useAppTheme(); return ( {/* diff --git a/apps/mobile/app/screens/Authenticated/TeamScreen/components/ListCardItem.tsx b/apps/mobile/app/screens/Authenticated/TeamScreen/components/ListCardItem.tsx index 8e5b3c98c..fbcfb0d65 100644 --- a/apps/mobile/app/screens/Authenticated/TeamScreen/components/ListCardItem.tsx +++ b/apps/mobile/app/screens/Authenticated/TeamScreen/components/ListCardItem.tsx @@ -2,7 +2,7 @@ /* eslint-disable react-native/no-color-literals */ /* eslint-disable react-native/no-inline-styles */ import React, { useState } from 'react'; -import { View, ViewStyle, TouchableOpacity, StyleSheet, TouchableWithoutFeedback, Platform } from 'react-native'; +import { View, ViewStyle, TouchableOpacity, StyleSheet, TouchableWithoutFeedback } from 'react-native'; import { Ionicons, Entypo } from '@expo/vector-icons'; // COMPONENTS @@ -87,14 +87,7 @@ export const ListItemContent: React.FC = observer(({ memberInfo, - { - if (Platform.OS === 'android' && taskEdition.estimateEditMode) { - event.stopPropagation(); - taskEdition.setEstimateEditMode(false); - } - }} - > + = observer(({ memberInfo, {memberInfo.memberTask && taskEdition.estimateEditMode ? ( - + unknown; currentTask: ITeamTask; setEstimateTime?: (value: number) => unknown; + timerScreen?: boolean; } -const EstimateTime: FC = ({ setEditEstimate, currentTask, setEstimateTime }) => { +const EstimateTime: FC = ({ setEditEstimate, currentTask, setEstimateTime, timerScreen }) => { // Hooks const { updateTask } = useTeamTasks(); - const { colors } = useAppTheme(); + const { colors, dark } = useAppTheme(); // STATES const textInputRef = useRef(null); @@ -26,6 +28,18 @@ const EstimateTime: FC = ({ setEditEstimate, currentTask, setEstimateTime const [isLoading, setIsLoading] = useState(false); const [showCheckIcon, setShowCheckIcon] = useState(false); + const clickOutsideTaskEstimationInputRef = useClickOutside(() => outsideClickInTimerScreen()); + + const outsideClickInTimerScreen = () => { + setShowCheckIcon(false); + textInputRef?.current?.blur(); + const { h, m } = secondsToTime(currentTask?.estimate || 0); + setEstimate({ + hours: h.toString(), + minutes: m.toString() + }); + }; + useEffect(() => { const { h, m } = secondsToTime(currentTask?.estimate || 0); setEstimate({ @@ -127,7 +141,7 @@ const EstimateTime: FC = ({ setEditEstimate, currentTask, setEstimateTime }; return ( - + = ({ setEditEstimate, currentTask, setEstimateTime {' m'} - {showCheckIcon && handleSubmit()} />} - {isLoading ? : null} + {showCheckIcon && ( + handleSubmit()} + style={timerScreen ? { position: 'absolute', right: -24 } : undefined} + /> + )} + {isLoading && ( + + )} ); }; diff --git a/apps/mobile/app/screens/Authenticated/TimerScreen/components/TimerTaskSection.tsx b/apps/mobile/app/screens/Authenticated/TimerScreen/components/TimerTaskSection.tsx index a13d39315..b61f29370 100644 --- a/apps/mobile/app/screens/Authenticated/TimerScreen/components/TimerTaskSection.tsx +++ b/apps/mobile/app/screens/Authenticated/TimerScreen/components/TimerTaskSection.tsx @@ -160,7 +160,8 @@ const TimerTaskSection = observer( > {translate('myWorkScreen.estimateLabel')} :{' '} - + + { if (form.workspaces.length === 1) { setSelectedWorkspace(0); - form.workspaces[0].current_teams.length === 1 && - setSelectedTeam(form.workspaces[0].current_teams[0].team_id); + } + if (form.workspaces.length === 1 && form.workspaces[0].current_teams.length === 1) { + setSelectedTeam(form.workspaces[0].current_teams[0].team_id); + } + if (form.workspaces.length === 1 && form.workspaces[0].current_teams.length <= 1) { setTimeout(() => { document.getElementById('continue-to-workspace')?.click(); }, 100);