-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1452 from topcoder-platform/multiround
Multiround
- Loading branch information
Showing
18 changed files
with
524 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
src/components/ChallengeEditor/ChallengeType-Field/ChallengeType-Field.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
@import "../../../styles/includes"; | ||
|
||
.row { | ||
box-sizing: border-box; | ||
display: flex; | ||
flex-direction: row; | ||
margin: 30px 30px 0 30px; | ||
align-content: space-between; | ||
justify-content: flex-start; | ||
|
||
.field { | ||
@include upto-sm { | ||
display: block; | ||
padding-bottom: 10px; | ||
} | ||
|
||
label { | ||
@include roboto-bold(); | ||
|
||
font-size: 16px; | ||
line-height: 19px; | ||
font-weight: 500; | ||
color: $tc-gray-80; | ||
} | ||
|
||
&.col1 { | ||
max-width: 185px; | ||
min-width: 185px; | ||
margin-right: 14px; | ||
white-space: nowrap; | ||
display: flex; | ||
align-items: center; | ||
flex-grow: 1; | ||
|
||
span { | ||
color: $tc-red; | ||
} | ||
} | ||
|
||
&.col2.error { | ||
color: $tc-red; | ||
margin-top: -25px; | ||
} | ||
&.col2 { | ||
align-self: flex-end; | ||
width: 80%; | ||
margin-bottom: auto; | ||
margin-top: auto; | ||
display: flex; | ||
flex-direction: row; | ||
max-width: 600px; | ||
min-width: 600px; | ||
} | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
src/components/ChallengeEditor/ChallengeType-Field/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import _ from 'lodash' | ||
import React from 'react' | ||
import PropTypes from 'prop-types' | ||
import Select from '../../Select' | ||
import cn from 'classnames' | ||
import styles from './ChallengeType-Field.module.scss' | ||
|
||
const ChallengeTypeField = ({ types, onUpdateSelect, challenge, disabled }) => { | ||
return ( | ||
<> | ||
<div className={styles.row}> | ||
<div className={cn(styles.field, styles.col1)}> | ||
<label htmlFor='type'>Challenge Type <span>*</span> :</label> | ||
</div> | ||
<div className={cn(styles.field, styles.col2, { [styles.disabled]: disabled })}> | ||
<Select | ||
name='challenge_type' | ||
options={_.map(types, type => ({ label: type, value: type }))} | ||
placeholder='Challenge Type' | ||
isClearable={false} | ||
onChange={(e) => onUpdateSelect(e.value, false, 'challengeType')} | ||
isDisabled={disabled} | ||
/> | ||
</div> | ||
</div> | ||
{ challenge.submitTriggered && !challenge.challengeType && <div className={styles.row}> | ||
<div className={cn(styles.field, styles.col1)} /> | ||
<div className={cn(styles.field, styles.col2, styles.error)}> | ||
Challenge Type is required field | ||
</div> | ||
</div> } | ||
</> | ||
) | ||
} | ||
|
||
ChallengeTypeField.defaultProps = { | ||
types: [], | ||
disabled: false | ||
} | ||
|
||
ChallengeTypeField.propTypes = { | ||
types: PropTypes.arrayOf(PropTypes.shape()).isRequired, | ||
onUpdateSelect: PropTypes.func.isRequired, | ||
challenge: PropTypes.shape().isRequired, | ||
disabled: PropTypes.bool | ||
} | ||
|
||
export default ChallengeTypeField |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
overflow: auto; | ||
|
||
&.isPrivate { | ||
max-height: 205px; | ||
max-height: 400px; | ||
} | ||
|
||
:global { | ||
|
Oops, something went wrong.