* feat(nav): make navbar static make the navbar in react layout and the static layout stick to the top of the screen * feat(challenges): Make classic view flex Classic view now uses flex to control it's height. This was necessary to control view and allow navbar to be static on other pages. This breaks mobile view and other non-classic challenge views * feat(app): Add logic to make screen expand on tablet * fix(app): let routes define their content structure * fix(less): use American spelling of gray * fix(classic-preview): make preview smaller to prevent scroll * feat(classic-frame): Make frame border less distinct * fix(challenges): scope test suite less to challenges * feat(challenges): make generic ChallengeTitle component
34 lines
885 B
JavaScript
34 lines
885 B
JavaScript
import React, { PropTypes } from 'react';
|
|
import { HelpBlock, FormGroup, FormControl } from 'react-bootstrap';
|
|
import { getValidationState, DOMOnlyProps } from '../../utils/form';
|
|
|
|
const propTypes = {
|
|
placeholder: PropTypes.string,
|
|
solution: PropTypes.object
|
|
};
|
|
|
|
export default function SolutionInput({ solution, placeholder }) {
|
|
const validationState = getValidationState(solution);
|
|
return (
|
|
<FormGroup
|
|
controlId='solution'
|
|
validationState={ validationState }
|
|
>
|
|
<FormControl
|
|
name='solution'
|
|
placeholder={ placeholder }
|
|
type='url'
|
|
{ ...DOMOnlyProps(solution) }
|
|
/>
|
|
{
|
|
validationState === 'error' ?
|
|
<HelpBlock>Make sure you provide a proper URL.</HelpBlock> :
|
|
null
|
|
}
|
|
</FormGroup>
|
|
);
|
|
}
|
|
|
|
SolutionInput.displayName = 'SolutionInput';
|
|
SolutionInput.propTypes = propTypes;
|