1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-18 20:59:44 +02:00

fix: Disable quick timer actions for viewers

This commit is contained in:
Maksim Eltyshev 2022-09-28 18:38:03 +02:00
parent ef76b887af
commit a17c03ff2f
2 changed files with 14 additions and 12 deletions

View file

@ -125,7 +125,7 @@ const Card = React.memo(
startedAt={timer.startedAt} startedAt={timer.startedAt}
total={timer.total} total={timer.total}
size="tiny" size="tiny"
onClick={handleToggleTimerClick} onClick={canEdit ? handleToggleTimerClick : undefined}
/> />
</span> </span>
)} )}

View file

@ -298,17 +298,19 @@ const CardModal = React.memo(
<Timer startedAt={timer.startedAt} total={timer.total} /> <Timer startedAt={timer.startedAt} total={timer.total} />
)} )}
</span> </span>
<button {canEdit && (
onClick={handleToggleTimerClick} <button
type="button" onClick={handleToggleTimerClick}
className={classNames(styles.attachment, styles.dueDate)} type="button"
> className={classNames(styles.attachment, styles.dueDate)}
<Icon >
name={timer.startedAt ? 'pause' : 'play'} <Icon
size="small" name={timer.startedAt ? 'pause' : 'play'}
className={styles.addAttachment} size="small"
/> className={styles.addAttachment}
</button> />
</button>
)}
</div> </div>
)} )}
</div> </div>