refactor: tooltips for time locks

This commit is contained in:
Carlos Valente
2024-10-19 13:34:01 +02:00
committed by Carlos Valente
parent ea2330e23b
commit cc5c097ddc
@@ -66,10 +66,12 @@ const TimeInputFlow = (props: EventBlockTimerProps) => {
placeholder='Start' placeholder='Start'
disabled={Boolean(linkStart)} disabled={Boolean(linkStart)}
> >
<Tooltip label='Link start to previous end' shouldWrapChildren openDelay={0}>
<InputRightElement className={activeStart} onClick={() => handleLink(!linkStart)}> <InputRightElement className={activeStart} onClick={() => handleLink(!linkStart)}>
<span className={style.timeLabel}>S</span> <span className={style.timeLabel}>S</span>
<span className={style.fourtyfive}>{linkStart ? <IoLink /> : <IoUnlink />}</span> <span className={style.fourtyfive}>{linkStart ? <IoLink /> : <IoUnlink />}</span>
</InputRightElement> </InputRightElement>
</Tooltip>
</TimeInputWithButton> </TimeInputWithButton>
<TimeInputWithButton<TimeActions> <TimeInputWithButton<TimeActions>
@@ -80,6 +82,7 @@ const TimeInputFlow = (props: EventBlockTimerProps) => {
disabled={isLockedDuration} disabled={isLockedDuration}
placeholder='End' placeholder='End'
> >
<Tooltip label='Lock end' shouldWrapChildren openDelay={0}>
<InputRightElement <InputRightElement
className={activeEnd} className={activeEnd}
onClick={() => handleChangeStrategy(TimeStrategy.LockEnd)} onClick={() => handleChangeStrategy(TimeStrategy.LockEnd)}
@@ -88,6 +91,7 @@ const TimeInputFlow = (props: EventBlockTimerProps) => {
<span className={style.timeLabel}>E</span> <span className={style.timeLabel}>E</span>
{isLockedEnd ? <IoLockClosed /> : <IoLockOpenOutline />} {isLockedEnd ? <IoLockClosed /> : <IoLockOpenOutline />}
</InputRightElement> </InputRightElement>
</Tooltip>
</TimeInputWithButton> </TimeInputWithButton>
<TimeInputWithButton<TimeActions> <TimeInputWithButton<TimeActions>
@@ -97,6 +101,7 @@ const TimeInputFlow = (props: EventBlockTimerProps) => {
disabled={isLockedEnd} disabled={isLockedEnd}
placeholder='Duration' placeholder='Duration'
> >
<Tooltip label='Lock duration' shouldWrapChildren openDelay={0}>
<InputRightElement <InputRightElement
className={activeDuration} className={activeDuration}
onClick={() => handleChangeStrategy(TimeStrategy.LockDuration)} onClick={() => handleChangeStrategy(TimeStrategy.LockDuration)}
@@ -105,6 +110,7 @@ const TimeInputFlow = (props: EventBlockTimerProps) => {
<span className={style.timeLabel}>D</span> <span className={style.timeLabel}>D</span>
{isLockedDuration ? <IoLockClosed /> : <IoLockOpenOutline />} {isLockedDuration ? <IoLockClosed /> : <IoLockOpenOutline />}
</InputRightElement> </InputRightElement>
</Tooltip>
</TimeInputWithButton> </TimeInputWithButton>
{overMidnight && ( {overMidnight && (