Skip to content

Commit 9ec9472

Browse files
author
vikasrohit
authored
Merge pull request #796 from maxceem/issue-680
#680 - fix: creating multiple challenges at a time
2 parents d9f96b9 + 78f7016 commit 9ec9472

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

src/components/Buttons/OutlineButton/Outline.module.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,12 @@
4141
}
4242
}
4343

44-
&.disable {
44+
&.disable,
45+
&[disabled] {
4546
@include roboto-light();
4647
font-weight: 300;
47-
4848
border: 1px solid $tc-gray-40;
49+
cursor: default;
4950

5051
span {
5152
color: $tc-gray-40;

src/components/Buttons/OutlineButton/index.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,15 @@ import cn from 'classnames'
66
import styles from './Outline.module.scss'
77
import _ from 'lodash'
88

9-
const OutlineButton = ({ type, text, link, onClick, url, className, submit }) => {
9+
const OutlineButton = ({ type, text, link, onClick, url, className, submit, disabled }) => {
1010
if (_.isEmpty(link) && _.isEmpty(url)) {
1111
return (
12-
<button type={submit ? 'submit' : 'button'} className={cn(styles.container, styles[type], className)} onClick={submit ? null : onClick}>
12+
<button
13+
type={submit ? 'submit' : 'button'}
14+
className={cn(styles.container, styles[type], className)}
15+
onClick={submit ? null : onClick}
16+
disabled={disabled}
17+
>
1318
<span>{text}</span>
1419
</button>
1520
)
@@ -37,7 +42,8 @@ OutlineButton.propTypes = {
3742
url: PropTypes.string,
3843
className: PropTypes.string,
3944
onClick: PropTypes.func,
40-
submit: PropTypes.bool
45+
submit: PropTypes.bool,
46+
disabled: PropTypes.bool
4147
}
4248

4349
export default OutlineButton

src/components/ChallengeEditor/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,9 @@ class ChallengeEditor extends Component {
717717
const { name, trackId, typeId } = this.state.challenge
718718
const { timelineTemplates } = metadata
719719

720+
// indicate that creating process has started
721+
this.setState({ isSaving: true })
722+
720723
// fallback template
721724
const STD_DEV_TIMELINE_TEMPLATE = _.find(timelineTemplates, { name: 'Standard Development' })
722725
const avlTemplates = this.getAvailableTimelineTemplates()
@@ -1146,7 +1149,7 @@ class ChallengeEditor extends Component {
11461149
isNew && (
11471150
<div className={styles.buttonContainer}>
11481151
<div className={styles.button}>
1149-
<OutlineButton text={'Continue Set-Up'} type={'success'} submit />
1152+
<OutlineButton text={'Continue Set-Up'} type={'success'} submit disabled={isSaving} />
11501153
</div>
11511154
</div>
11521155
)

0 commit comments

Comments
 (0)