fix: Disable quick timer actions for viewers

pull/304/head
Maksim Eltyshev 3 years ago
parent e1a0b635ea
commit e3d00c8791

@ -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>
)} )}

@ -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>

Loading…
Cancel
Save