forked from studiointeract/accounts-ui
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Form.jsx
50 lines (46 loc) · 1.17 KB
/
Form.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import './Fields.jsx';
import './Buttons.jsx';
import './FormMessage.jsx';
import './PasswordOrService.jsx';
import './SocialButtons.jsx';
import './FormMessages.jsx';
import { Accounts } from 'meteor/accounts-base';
import PropTypes from 'prop-types';
import React from 'react';
export const Form = ({
oauthServices,
fields,
buttons,
error,
messages,
translate,
ready = true,
className
}) => (
<form
className={[className, ready ? 'ready' : null].join(' ')}
className="accounts-ui"
noValidate
onSubmit={e => {
e.preventDefault()
}}
>
<Accounts.ui.Fields fields={fields} />
<Accounts.ui.Buttons buttons={buttons} />
<Accounts.ui.PasswordOrService
oauthServices={oauthServices}
translate={translate}
/>
<Accounts.ui.SocialButtons oauthServices={oauthServices} />
<Accounts.ui.FormMessages messages={messages} />
</form>
)
Form.propTypes = {
oauthServices: PropTypes.object,
fields: PropTypes.object.isRequired,
buttons: PropTypes.object.isRequired,
translate: PropTypes.func.isRequired,
error: PropTypes.string,
ready: PropTypes.bool
};
Accounts.ui.Form = Form;