Skip to content

Commit

Permalink
Merge pull request #1587 from ever-co/improve/timer-screen-input-disable
Browse files Browse the repository at this point in the history
disabled the input so users can't change active task when timer is ru…
  • Loading branch information
evereq authored Oct 19, 2023
2 parents b98add1 + 78db05c commit 255e527
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import TaskSize from "../../../../components/TaskSize"
import { RTuseTaskInput } from "../../../../services/hooks/features/useTaskInput"
import TaskLabels from "../../../../components/TaskLabels"
import IssuesModal from "../../../../components/IssuesModal"
import { useStores } from "../../../../models"

const TimerTaskSection = observer(
({ taskInput, outsideClick }: { taskInput: RTuseTaskInput; outsideClick: () => unknown }) => {
Expand All @@ -44,6 +45,9 @@ const TimerTaskSection = observer(

const [combxShow, setCombxShow] = useState<boolean>(false)
const inputRef = useRef<TextInput>(null)
const {
TimerStore: { localTimerStatus },
} = useStores()

const closeCombox = useCallback(() => {
setCombxShow(false)
Expand Down Expand Up @@ -88,14 +92,19 @@ const TimerTaskSection = observer(
placeholderTextColor={colors.tertiary}
style={[
styles.textInput,
{ backgroundColor: colors.background, color: colors.primary, width: "80%" },
{
backgroundColor: colors.background,
color: colors.primary,
width: "80%",
opacity: localTimerStatus.running ? 0.5 : 1,
},
]}
placeholder={translate("myWorkScreen.taskFieldPlaceholder")}
defaultValue={activeTask ? activeTask.title : ""}
autoFocus={false}
autoCapitalize="none"
autoCorrect={false}
editable={true}
editable={!localTimerStatus.running}
onFocus={() => setEditMode(true)}
// onBlur={() => setEditMode(false)}
onChangeText={(newText) => setQuery(newText)}
Expand Down

0 comments on commit 255e527

Please sign in to comment.