mirror of
https://github.com/vale981/accounts-ui
synced 2025-03-04 17:31:41 -05:00
Improved code style.
This commit is contained in:
parent
2691611f34
commit
81ce433149
3 changed files with 25 additions and 4 deletions
|
@ -3,7 +3,14 @@ import { Accounts } from 'meteor/accounts-base';
|
|||
|
||||
export class Button extends React.Component {
|
||||
render () {
|
||||
const { label, href = null, type, disabled = false, className, onClick } = this.props;
|
||||
const {
|
||||
label,
|
||||
href = null,
|
||||
type,
|
||||
disabled = false,
|
||||
className,
|
||||
onClick
|
||||
} = this.props;
|
||||
if (type == 'link') {
|
||||
return <a href={ href } className={ className } onClick={ onClick }>{ label }</a>;
|
||||
}
|
||||
|
|
|
@ -33,12 +33,25 @@ export class Field extends React.Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
const { id, hint, label, type = 'text', onChange, className = "field", defaultValue = "" } = this.props;
|
||||
const {
|
||||
id,
|
||||
hint,
|
||||
label,
|
||||
type = 'text',
|
||||
onChange,
|
||||
required = false,
|
||||
className = "field",
|
||||
defaultValue = ""
|
||||
} = this.props;
|
||||
const { mount = true } = this.state;
|
||||
return mount ? (
|
||||
<div className={ className }>
|
||||
<label htmlFor={ id }>{ label }</label>
|
||||
<input id={ id } type={ type } onChange={ onChange } placeholder={ hint } defaultValue={ defaultValue } />
|
||||
<input id={ id }
|
||||
type={ type }
|
||||
onChange={ onChange }
|
||||
placeholder={ hint }
|
||||
defaultValue={ defaultValue } />
|
||||
</div>
|
||||
) : null;
|
||||
}
|
||||
|
|
|
@ -5,7 +5,8 @@ export class FormMessage extends React.Component {
|
|||
render () {
|
||||
let { message, type, className = "message", style = {} } = this.props;
|
||||
return message ? (
|
||||
<div style={ style } className={[ className, type ].join(' ')}>{ message }</div>
|
||||
<div style={ style }
|
||||
className={[ className, type ].join(' ')}>{ message }</div>
|
||||
) : null;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue