-
Notifications
You must be signed in to change notification settings - Fork 214
Expand file tree
/
Copy pathlogin-fields.jsx
More file actions
31 lines (27 loc) · 892 Bytes
/
login-fields.jsx
File metadata and controls
31 lines (27 loc) · 892 Bytes
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
/*
* Copyright (c) 2021, salesforce.com, inc.
* All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
import React from 'react'
import PropTypes from 'prop-types'
import {Stack} from '@chakra-ui/react'
import useLoginFields from '../../components/forms/useLoginFields'
import Field from '../../components/field'
const LoginFields = ({form, prefix = ''}) => {
const fields = useLoginFields({form, prefix})
return (
<Stack gap={5}>
<Field {...fields.email} />
<Field {...fields.password} />
</Stack>
)
}
LoginFields.propTypes = {
/** Object returned from `useForm` */
form: PropTypes.object.isRequired,
/** Optional prefix for field names */
prefix: PropTypes.string
}
export default LoginFields