File tree 5 files changed +26
-4
lines changed
packages/ra-ui-materialui/src/form
5 files changed +26
-4
lines changed Original file line number Diff line number Diff line change @@ -66,3 +66,13 @@ export const StackProps = () => (
66
66
</ SimpleForm >
67
67
</ Wrapper >
68
68
) ;
69
+
70
+ export const NoToolbar = ( ) => (
71
+ < Wrapper >
72
+ < SimpleForm toolbar = { false } >
73
+ < TextInput source = "title" fullWidth />
74
+ < TextInput source = "author" />
75
+ < NumberInput source = "year" />
76
+ </ SimpleForm >
77
+ </ Wrapper >
78
+ ) ;
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ export const SimpleForm = (props: SimpleFormProps) => {
52
52
{ children }
53
53
</ Stack >
54
54
</ Component >
55
- { toolbar }
55
+ { toolbar !== false ? toolbar : null }
56
56
</ Form >
57
57
) ;
58
58
} ;
Original file line number Diff line number Diff line change @@ -78,3 +78,15 @@ export const CustomLayout = () => (
78
78
</ TabbedForm >
79
79
</ Wrapper >
80
80
) ;
81
+
82
+ export const NoToolbar = ( ) => (
83
+ < Wrapper >
84
+ < TabbedForm toolbar = { false } >
85
+ < FormTab label = "main" >
86
+ < TextInput source = "title" fullWidth />
87
+ < TextInput source = "author" sx = { { width : '50%' } } />
88
+ < NumberInput source = "year" sx = { { width : '50%' } } />
89
+ </ FormTab >
90
+ </ TabbedForm >
91
+ </ Wrapper >
92
+ ) ;
Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ export interface TabbedFormProps
125
125
resource ?: string ;
126
126
syncWithLocation ?: boolean ;
127
127
tabs ?: ReactElement ;
128
- toolbar ?: ReactElement ;
128
+ toolbar ?: ReactElement | false ;
129
129
warnWhenUnsavedChanges ?: boolean ;
130
130
}
131
131
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ export const TabbedFormView = (props: TabbedFormViewProps): ReactElement => {
98
98
: null ;
99
99
} ) }
100
100
</ Component >
101
- { toolbar }
101
+ { toolbar !== false ? toolbar : null }
102
102
</ Root >
103
103
) ;
104
104
} ;
@@ -130,7 +130,7 @@ export interface TabbedFormViewProps {
130
130
formRootPathname ?: string ;
131
131
syncWithLocation ?: boolean ;
132
132
tabs ?: ReactElement ;
133
- toolbar ?: ReactElement ;
133
+ toolbar ?: ReactElement | false ;
134
134
sx ?: SxProps ;
135
135
}
136
136
You can’t perform that action at this time.
0 commit comments