Skip to content

Commit b2a15b4

Browse files
committed
fix: delete button small fixes
1 parent ab2d4cf commit b2a15b4

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

src/components/ChallengeEditor/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1500,7 +1500,7 @@ class ChallengeEditor extends Component {
15001500
</div>
15011501
<div className={styles.title}>{getTitle(isNew)}</div>
15021502
<div className={cn(styles.actionButtons, styles.actionButtonsRight)}>
1503-
{this.props.challengeDetails.status === 'New' && <PrimaryButton text={'Delete'} type={'danger'} onClick={this.deleteModalLaunch} />}
1503+
{!isNew && this.props.challengeDetails.status === 'New' && <PrimaryButton text={'Delete'} type={'danger'} onClick={this.deleteModalLaunch} />}
15041504
<PrimaryButton text={'Back'} type={'info'} submit link={`/projects/${projectDetail.id}/challenges`} />
15051505
</div>
15061506
<div className={styles.textRequired}>* Required</div>

src/components/ChallengesComponent/ChallengeCard/index.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,11 @@ const hoverComponents = (challenge, onUpdateLaunch, deleteModalLaunch) => {
103103

104104
// NEW projects never have Legacy challenge created, so don't show links and "Activate" button for them at all
105105
if (challenge.status.toUpperCase() === CHALLENGE_STATUS.NEW) {
106-
if (challenge.status.toUpperCase() === CHALLENGE_STATUS.NEW) {
107-
return (
108-
<button className={styles.deleteButton} onClick={deleteModalLaunch}>
109-
<span>Delete</span>
110-
</button>
111-
)
112-
}
106+
return (
107+
<button className={styles.deleteButton} onClick={deleteModalLaunch}>
108+
<span>Delete</span>
109+
</button>
110+
)
113111
}
114112

115113
return challenge.legacyId ? (

0 commit comments

Comments
 (0)