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) => {
1818 handleSnapshot,
1919 handleProxyAddress,
2020 customValueValidate,
21+ headerSlot,
2122 } = props ;
2223 const [ module , setModule ] = useState ( window . __FEDERATION__ ?. moduleInfo || { } ) ;
2324
@@ -39,6 +40,7 @@ const App = (props: RootComponentProps) => {
3940 handleSnapshot = { handleSnapshot }
4041 handleProxyAddress = { handleProxyAddress }
4142 customValueValidate = { customValueValidate }
43+ headerSlot = { headerSlot }
4244 />
4345 ) : (
4446 < Empty description = { 'No ModuleInfo Detected' } />
Original file line number Diff line number Diff line change 4545 }
4646 }
4747
48+ & .headerSlot {
49+ display : flex ;
50+ align-items : center ;
51+ }
52+
4853 & .badge {
4954 display : flex ;
5055 transform : scale (1.6 );
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ interface FormProps {
4545 validateForm : any ;
4646 enableHMR : string ;
4747 onHMRChange : ( on : boolean ) => void ;
48+ headerSlot ?: ReactNode ;
4849}
4950const FormComponent = ( props : FormProps & RootComponentProps ) => {
5051 const {
@@ -222,13 +223,16 @@ const FormComponent = (props: FormProps & RootComponentProps) => {
222223 < div className = { styles . status } >
223224 < Badge color = { condition . color } className = { styles . badge } />
224225 < 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 >
232236 </ div >
233237 </ div >
234238
Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ const Layout = (
5959 getVersion,
6060 handleProxyAddress,
6161 customValueValidate,
62+ headerSlot,
6263 } = props ;
6364 const { producer } = separateType ( moduleInfo ) ;
6465 const [ condition , setCondition ] = useState ( statusInfo . processing ) ;
@@ -219,6 +220,7 @@ const Layout = (
219220 setVersionList = { setVersionList }
220221 getVersion = { getVersion }
221222 customValueValidate = { customValueValidate }
223+ headerSlot = { headerSlot }
222224 />
223225 </ Form >
224226
Original file line number Diff line number Diff line change 1+ import type { ReactNode } from 'react' ;
12import { getModuleInfo } from '../index' ;
23
34export interface FormItemStatus {
@@ -14,4 +15,5 @@ export interface RootComponentProps {
1415 getVersion ?: ( moduleName : string ) => Promise < Array < string > > ;
1516 handleProxyAddress ?: ( address : string ) => string ;
1617 customValueValidate ?: ( schema : string ) => boolean ;
18+ headerSlot ?: ReactNode ;
1719}
You can’t perform that action at this time.
0 commit comments