File tree Expand file tree Collapse file tree 5 files changed +22
-7
lines changed
packages/chrome-devtools/src Expand file tree Collapse file tree 5 files changed +22
-7
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ const App = (props: RootComponentProps) => {
18
18
handleSnapshot,
19
19
handleProxyAddress,
20
20
customValueValidate,
21
+ headerSlot,
21
22
} = props ;
22
23
const [ module , setModule ] = useState ( window . __FEDERATION__ ?. moduleInfo || { } ) ;
23
24
@@ -39,6 +40,7 @@ const App = (props: RootComponentProps) => {
39
40
handleSnapshot = { handleSnapshot }
40
41
handleProxyAddress = { handleProxyAddress }
41
42
customValueValidate = { customValueValidate }
43
+ headerSlot = { headerSlot }
42
44
/>
43
45
) : (
44
46
< Empty description = { 'No ModuleInfo Detected' } />
Original file line number Diff line number Diff line change 45
45
}
46
46
}
47
47
48
+ & .headerSlot {
49
+ display : flex ;
50
+ align-items : center ;
51
+ }
52
+
48
53
& .badge {
49
54
display : flex ;
50
55
transform : scale (1.6 );
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ interface FormProps {
45
45
validateForm : any ;
46
46
enableHMR : string ;
47
47
onHMRChange : ( on : boolean ) => void ;
48
+ headerSlot ?: ReactNode ;
48
49
}
49
50
const FormComponent = ( props : FormProps & RootComponentProps ) => {
50
51
const {
@@ -222,13 +223,16 @@ const FormComponent = (props: FormProps & RootComponentProps) => {
222
223
< div className = { styles . status } >
223
224
< Badge color = { condition . color } className = { styles . badge } />
224
225
< span className = { styles . message } > { condition . message } </ span >
225
- < Switch
226
- checked = { enableHMR === 'enable' }
227
- checkedText = { 'Enable HMR' }
228
- uncheckedText = { 'Disable HMR' }
229
- onChange = { hmrChange }
230
- className = { styles . switch }
231
- />
226
+ < span className = { styles . headerSlot } >
227
+ { props . headerSlot }
228
+ < Switch
229
+ checked = { enableHMR === 'enable' }
230
+ checkedText = { 'Enable HMR' }
231
+ uncheckedText = { 'Disable HMR' }
232
+ onChange = { hmrChange }
233
+ className = { styles . switch }
234
+ />
235
+ </ span >
232
236
</ div >
233
237
</ div >
234
238
Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ const Layout = (
59
59
getVersion,
60
60
handleProxyAddress,
61
61
customValueValidate,
62
+ headerSlot,
62
63
} = props ;
63
64
const { producer } = separateType ( moduleInfo ) ;
64
65
const [ condition , setCondition ] = useState ( statusInfo . processing ) ;
@@ -219,6 +220,7 @@ const Layout = (
219
220
setVersionList = { setVersionList }
220
221
getVersion = { getVersion }
221
222
customValueValidate = { customValueValidate }
223
+ headerSlot = { headerSlot }
222
224
/>
223
225
</ Form >
224
226
Original file line number Diff line number Diff line change
1
+ import type { ReactNode } from 'react' ;
1
2
import { getModuleInfo } from '../index' ;
2
3
3
4
export interface FormItemStatus {
@@ -14,4 +15,5 @@ export interface RootComponentProps {
14
15
getVersion ?: ( moduleName : string ) => Promise < Array < string > > ;
15
16
handleProxyAddress ?: ( address : string ) => string ;
16
17
customValueValidate ?: ( schema : string ) => boolean ;
18
+ headerSlot ?: ReactNode ;
17
19
}
You can’t perform that action at this time.
0 commit comments