-
Notifications
You must be signed in to change notification settings - Fork 214
Expand file tree
/
Copy pathprofile-fields.jsx
More file actions
36 lines (31 loc) · 1.07 KB
/
profile-fields.jsx
File metadata and controls
36 lines (31 loc) · 1.07 KB
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
/*
* 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 {SimpleGrid, Stack} from '@chakra-ui/react'
import useProfileFields from '../../components/forms/useProfileFields'
import Field from '../../components/field'
const ProfileFields = ({form, prefix = ''}) => {
const fields = useProfileFields({form, prefix})
return (
<Stack gap={5}>
<SimpleGrid columns={[1, 1, 1, 2]} gap={5}>
<Field {...fields.firstName} />
<Field {...fields.lastName} />
</SimpleGrid>
<Field {...fields.email} />
<Field {...fields.phone} />
</Stack>
)
}
ProfileFields.propTypes = {
/** Object returned from `useForm` */
form: PropTypes.object.isRequired,
/** Optional prefix for field names */
prefix: PropTypes.string
}
export default ProfileFields