@@ -4,50 +4,39 @@ import {
4
4
ReferenceInput ,
5
5
AutocompleteInput ,
6
6
BooleanInput ,
7
- required ,
8
7
} from 'react-admin' ;
9
8
import { Divider , Box } from '@mui/material' ;
10
9
11
- export const ContactInputs = ( ) => {
12
- return (
13
- < Box flex = "1" mt = { - 1 } >
14
- < Box display = "flex" width = { 430 } >
15
- < TextInput
16
- source = "first_name"
17
- validate = { required ( ) }
18
- fullWidth
19
- />
20
- < Spacer />
21
- < TextInput source = "last_name" validate = { required ( ) } fullWidth />
22
- </ Box >
23
- < Box display = "flex" width = { 430 } >
24
- < TextInput source = "title" fullWidth />
25
- < Spacer />
26
- < ReferenceInput source = "company_id" reference = "companies" >
27
- < AutocompleteInput
28
- optionText = "name"
29
- fullWidth
30
- validate = { required ( ) }
31
- />
32
- </ ReferenceInput >
33
- </ Box >
34
- < Divider />
35
- < Box mt = { 2 } width = { 430 } >
36
- < TextInput source = "email" fullWidth />
37
- </ Box >
38
- < Box display = "flex" width = { 430 } >
39
- < TextInput source = "phone_number1" fullWidth />
40
- < Spacer />
41
- < TextInput source = "phone_number2" fullWidth />
42
- </ Box >
43
- < Divider />
44
- < Box mt = { 2 } width = { 430 } >
45
- < TextInput source = "background" multiline fullWidth />
46
- < TextInput source = "avatar" fullWidth />
47
- < BooleanInput source = "has_newsletter" />
48
- </ Box >
10
+ export const ContactInputs = ( ) => (
11
+ < Box flex = "1" mt = { - 1 } >
12
+ < Box display = "flex" width = { 430 } >
13
+ < TextInput source = "first_name" fullWidth />
14
+ < Spacer />
15
+ < TextInput source = "last_name" fullWidth />
49
16
</ Box >
50
- ) ;
51
- } ;
17
+ < Box display = "flex" width = { 430 } >
18
+ < TextInput source = "title" fullWidth />
19
+ < Spacer />
20
+ < ReferenceInput source = "company_id" reference = "companies" >
21
+ < AutocompleteInput optionText = "name" fullWidth />
22
+ </ ReferenceInput >
23
+ </ Box >
24
+ < Divider />
25
+ < Box mt = { 2 } width = { 430 } >
26
+ < TextInput source = "email" fullWidth />
27
+ </ Box >
28
+ < Box display = "flex" width = { 430 } >
29
+ < TextInput source = "phone_number1" fullWidth />
30
+ < Spacer />
31
+ < TextInput source = "phone_number2" fullWidth />
32
+ </ Box >
33
+ < Divider />
34
+ < Box mt = { 2 } width = { 430 } >
35
+ < TextInput source = "background" multiline fullWidth />
36
+ < TextInput source = "avatar" fullWidth />
37
+ < BooleanInput source = "has_newsletter" />
38
+ </ Box >
39
+ </ Box >
40
+ ) ;
52
41
53
42
const Spacer = ( ) => < Box width = { 20 } component = "span" /> ;
0 commit comments