mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-27 09:35:56 -05:00
remove ‘noformsy` option on inputs
This commit is contained in:
parent
6787ae03ce
commit
b510d154df
5 changed files with 28 additions and 11 deletions
|
@ -29,14 +29,13 @@ var Input = React.createClass({
|
|||
},
|
||||
render: function () {
|
||||
var classes = classNames(
|
||||
'input',
|
||||
this.state.status,
|
||||
this.props.className
|
||||
);
|
||||
return (this.props.type === 'submit' || this.props.noformsy ?
|
||||
<input {... this.props} className={classes} /> :
|
||||
return (
|
||||
<FRCInput {... this.props}
|
||||
className={classes}
|
||||
className="input"
|
||||
rowClassName={classes}
|
||||
onValid={this.onValid}
|
||||
onInvalid={this.onInvalid} />
|
||||
);
|
||||
|
|
|
@ -13,4 +13,10 @@
|
|||
display: inline-block;
|
||||
margin-bottom: .75rem;
|
||||
}
|
||||
|
||||
&.no-label {
|
||||
label {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ var api = require('../../../lib/api');
|
|||
var Avatar = require('../../avatar/avatar.jsx');
|
||||
var Button = require('../../forms/button.jsx');
|
||||
var Dropdown = require('../../dropdown/dropdown.jsx');
|
||||
var Form = require('../../forms/form.jsx');
|
||||
var Input = require('../../forms/input.jsx');
|
||||
var log = require('../../../lib/log.js');
|
||||
var Login = require('../../login/login.jsx');
|
||||
|
@ -170,6 +171,9 @@ var Navigation = React.createClass({
|
|||
this.props.dispatch(sessionActions.refreshSession());
|
||||
this.closeRegistration();
|
||||
},
|
||||
onSearchSubmit: function (formData) {
|
||||
window.location.href = '/search/projects?q=' + formData.q;
|
||||
},
|
||||
render: function () {
|
||||
var classes = classNames({
|
||||
'logged-in': this.props.session.session.user
|
||||
|
@ -216,14 +220,14 @@ var Navigation = React.createClass({
|
|||
</li>
|
||||
|
||||
<li className="search">
|
||||
<form action="/search/projects" method="get">
|
||||
<Form onSubmit={this.onSearchSubmit}>
|
||||
<Button type="submit" className="btn-search" />
|
||||
<Input type="text"
|
||||
className="no-label"
|
||||
aria-label={formatMessage({id: 'general.search'})}
|
||||
placeholder={formatMessage({id: 'general.search'})}
|
||||
name="q"
|
||||
noformsy />
|
||||
</form>
|
||||
name="q" />
|
||||
</Form>
|
||||
</li>
|
||||
{this.props.session.status === sessionActions.Status.FETCHED ? (
|
||||
this.props.session.session.user ? [
|
||||
|
|
|
@ -47,12 +47,18 @@
|
|||
width: 100%;
|
||||
}
|
||||
|
||||
form {
|
||||
.form {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
input,
|
||||
button {
|
||||
.row {
|
||||
.help-block {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.input,
|
||||
.button {
|
||||
display: inline-block;
|
||||
margin-top: 5px;
|
||||
outline: none;
|
||||
|
|
|
@ -315,6 +315,7 @@ module.exports = {
|
|||
<div className="gender-input">
|
||||
<Input name="user.genderOther"
|
||||
type="text"
|
||||
className="no-label"
|
||||
disabled={this.state.otherDisabled}
|
||||
required={!this.state.otherDisabled}
|
||||
help={null} />
|
||||
|
@ -499,6 +500,7 @@ module.exports = {
|
|||
</div>
|
||||
<div className="other-input">
|
||||
<Input type="text"
|
||||
className="no-label"
|
||||
name="organization.other"
|
||||
disabled={this.state.otherDisabled}
|
||||
required="isFalse"
|
||||
|
|
Loading…
Reference in a new issue