Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 34 additions & 37 deletions packages/webapp/src/components/Task/TaskReadOnly/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,24 +177,40 @@ export default function PureTaskReadOnly({
(canCompleteTask || canAbandonTask) &&
isCurrent && (
<>
<Button
data-cy="taskReadOnly-abandon"
color={'secondary'}
onClick={onAbandon}
fullLength
disabled={!canAbandonTask}
>
{t('TASK.ABANDON.ABANDON')}
</Button>
<Button
data-cy="taskReadOnly-complete"
color={'primary'}
onClick={onComplete}
fullLength
disabled={!canCompleteTask}
>
{t('common:MARK_COMPLETE')}
</Button>
<div className={styles.footerContainer}>
<div className={styles.deleteButtonWrapper}>
{isAdmin && isCurrent && !isDeleting && (
<IconLink
className={styles.deleteText}
onClick={preDelete}
isIconClickable
icon={<TrashIcon className={styles.trashIcon} />}
>
{t('TASK.DELETE.DELETE_TASK')}
</IconLink>
)}
</div>
<div className={styles.buttonGroup}>
<Button
data-cy="taskReadOnly-abandon"
color={'secondary'}
onClick={onAbandon}
fullLength
disabled={!canAbandonTask}
>
{t('TASK.ABANDON.ABANDON')}
</Button>
<Button
data-cy="taskReadOnly-complete"
color={'primary'}
onClick={onComplete}
fullLength
disabled={!canCompleteTask}
>
{t('common:MARK_COMPLETE')}
</Button>
</div>
</div>
</>
)
}
Expand Down Expand Up @@ -461,25 +477,6 @@ export default function PureTaskReadOnly({
/>
)}

{isAdmin && isCurrent && !isDeleting && (
<IconLink
className={styles.deleteText}
style={{ color: 'var(--grey600)' }}
icon={
<TrashIcon
style={{
fill: 'var(--grey600)',
stroke: 'var(--grey600)',
transform: 'translate(0px, 6px)',
}}
/>
}
onClick={preDelete}
isIconClickable
>
{t('TASK.DELETE.DELETE_TASK')}
</IconLink>
)}
{isDeleting && isTaskType(taskType, 'PLANT_TASK') && (
<DeleteBox
color="warning"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,15 @@

.rating {
display: table-row;
}

}
.deleteText {
display: flex;
align-items: center;
justify-content: flex-start;
color: var(--grey600);
padding-bottom: 16px;

gap: 5px;
span {
text-decoration: none;
}
Expand Down Expand Up @@ -102,3 +106,22 @@
.section {
margin-bottom: 24px;
}
.footerContainer {
width: 100%;
display: flex;
flex-direction: column;
align-items: stretch;
}
.buttonGroup {
display: flex;
gap: 16px;
width: 100%;
}
.buttonGroup button {
flex: 1;
}

.trashIcon {
fill: var(--grey600);
stroke: var(--grey600);
}
Loading