@@ -52,89 +52,83 @@ const ProductTitle = () => {
5252 ) : null ;
5353} ;
5454
55- const ProductEdit = ( ) => {
56- return (
57- < Edit title = { < ProductTitle /> } >
58- < TabbedForm >
59- < TabbedForm . Tab
60- label = "resources.products.tabs.image"
61- sx = { { maxWidth : '40em' , minHeight : 48 } }
62- iconPosition = "start"
63- icon = { < PhotoCameraIcon /> }
64- >
65- < Poster />
66- < TextInput source = "image" validate = { req } />
67- < TextInput source = "thumbnail" validate = { req } />
68- </ TabbedForm . Tab >
69- < TabbedForm . Tab
70- label = "resources.products.tabs.details"
71- path = "details"
72- sx = { { maxWidth : '40em' , minHeight : 48 } }
73- iconPosition = "start"
74- icon = { < AspectRatioIcon /> }
75- >
76- < ProductEditDetails />
77- </ TabbedForm . Tab >
78- < TabbedForm . Tab
79- label = "resources.products.tabs.description"
80- path = "description"
81- sx = { { maxWidth : '40em' , minHeight : 48 } }
82- iconPosition = "start"
83- icon = { < EditNoteIcon /> }
84- >
85- < RichTextInput
86- source = "description"
87- label = ""
88- validate = { req }
89- />
90- </ TabbedForm . Tab >
91- < TabbedForm . Tab
92- label = "resources.products.tabs.reviews"
93- count = {
94- < ReferenceManyCount
95- reference = "reviews"
96- target = "product_id"
97- sx = { { lineHeight : 'inherit' } }
98- />
99- }
100- path = "reviews"
101- sx = { { minHeight : 48 } }
102- iconPosition = "start"
103- icon = { < ReviewIcon /> }
104- >
105- < ReferenceManyField
55+ const ProductEdit = ( ) => (
56+ < Edit title = { < ProductTitle /> } >
57+ < TabbedForm >
58+ < TabbedForm . Tab
59+ label = "resources.products.tabs.image"
60+ sx = { { maxWidth : '40em' , minHeight : 48 } }
61+ iconPosition = "start"
62+ icon = { < PhotoCameraIcon /> }
63+ >
64+ < Poster />
65+ < TextInput source = "image" validate = { req } />
66+ < TextInput source = "thumbnail" validate = { req } />
67+ </ TabbedForm . Tab >
68+ < TabbedForm . Tab
69+ label = "resources.products.tabs.details"
70+ path = "details"
71+ sx = { { maxWidth : '40em' , minHeight : 48 } }
72+ iconPosition = "start"
73+ icon = { < AspectRatioIcon /> }
74+ >
75+ < ProductEditDetails />
76+ </ TabbedForm . Tab >
77+ < TabbedForm . Tab
78+ label = "resources.products.tabs.description"
79+ path = "description"
80+ sx = { { maxWidth : '40em' , minHeight : 48 } }
81+ iconPosition = "start"
82+ icon = { < EditNoteIcon /> }
83+ >
84+ < RichTextInput source = "description" label = "" validate = { req } />
85+ </ TabbedForm . Tab >
86+ < TabbedForm . Tab
87+ label = "resources.products.tabs.reviews"
88+ count = {
89+ < ReferenceManyCount
10690 reference = "reviews"
10791 target = "product_id"
108- pagination = { < Pagination /> }
92+ sx = { { lineHeight : 'inherit' } }
93+ />
94+ }
95+ path = "reviews"
96+ sx = { { minHeight : 48 } }
97+ iconPosition = "start"
98+ icon = { < ReviewIcon /> }
99+ >
100+ < ReferenceManyField
101+ reference = "reviews"
102+ target = "product_id"
103+ pagination = { < Pagination /> }
104+ >
105+ < Datagrid
106+ sx = { {
107+ width : '100%' ,
108+ '& .column-comment' : {
109+ maxWidth : '20em' ,
110+ overflow : 'hidden' ,
111+ textOverflow : 'ellipsis' ,
112+ whiteSpace : 'nowrap' ,
113+ } ,
114+ } }
109115 >
110- < Datagrid
111- sx = { {
112- width : '100%' ,
113- '& .column-comment' : {
114- maxWidth : '20em' ,
115- overflow : 'hidden' ,
116- textOverflow : 'ellipsis' ,
117- whiteSpace : 'nowrap' ,
118- } ,
119- } }
120- >
121- < DateField source = "date" />
122- < CustomerReferenceField source = "customer_id" />
123- < StarRatingField
124- label = "resources.reviews.fields.rating"
125- source = "rating"
126- />
127- < TextField source = "comment" />
128- < TextField source = "status" />
129- < EditButton />
130- </ Datagrid >
131- < CreateRelatedReviewButton />
132- </ ReferenceManyField >
133- </ TabbedForm . Tab >
134- </ TabbedForm >
135- </ Edit >
136- ) ;
137- } ;
116+ < DateField source = "date" />
117+ < CustomerReferenceField source = "customer_id" />
118+ < StarRatingField
119+ label = "resources.reviews.fields.rating"
120+ source = "rating"
121+ />
122+ < TextField source = "comment" />
123+ < TextField source = "status" />
124+ < EditButton />
125+ </ Datagrid >
126+ < CreateRelatedReviewButton />
127+ </ ReferenceManyField >
128+ </ TabbedForm . Tab >
129+ </ TabbedForm >
130+ </ Edit >
131+ ) ;
138132
139133const req = [ required ( ) ] ;
140134
0 commit comments