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