@@ -11,7 +11,7 @@ import { getCLISetRegistry, getCLIChangePassword, getCLISetConfigRegistry } from
1111import { NODE_MANAGER } from '../../utils/constants' ;
1212
1313/* eslint react/prop-types:0 */
14- function TabContainer ( { children } ) {
14+ function TabContainer ( { children } ) : JSX . Element {
1515 return (
1616 < CommandContainer >
1717 < Typography component = "div" style = { { padding : 0 , minHeight : 170 } } >
@@ -26,11 +26,16 @@ class RegistryInfoContent extends Component<Props, State> {
2626 tabPosition : 0 ,
2727 } ;
2828
29- public render ( ) {
29+ public render ( ) : JSX . Element {
3030 return < div > { this . renderTabs ( ) } </ div > ;
3131 }
3232
33- private renderTabs ( ) {
33+ private handleChange = ( event : any , tabPosition : number ) => {
34+ event . preventDefault ( ) ;
35+ this . setState ( { tabPosition } ) ;
36+ } ;
37+
38+ private renderTabs ( ) : JSX . Element {
3439 const { scope, registryUrl } = this . props ;
3540 const { tabPosition } = this . state ;
3641
@@ -48,7 +53,7 @@ class RegistryInfoContent extends Component<Props, State> {
4853 ) ;
4954 }
5055
51- private renderNpmTab ( scope : string , registryUrl : string ) {
56+ private renderNpmTab ( scope : string , registryUrl : string ) : JSX . Element {
5257 return (
5358 < React . Fragment >
5459 < CopyToClipBoard text = { getCLISetConfigRegistry ( `${ NODE_MANAGER . npm } set` , scope , registryUrl ) } />
@@ -58,7 +63,7 @@ class RegistryInfoContent extends Component<Props, State> {
5863 ) ;
5964 }
6065
61- private renderPNpmTab ( scope : string , registryUrl : string ) {
66+ private renderPNpmTab ( scope : string , registryUrl : string ) : JSX . Element {
6267 return (
6368 < React . Fragment >
6469 < CopyToClipBoard text = { getCLISetConfigRegistry ( `${ NODE_MANAGER . pnpm } set` , scope , registryUrl ) } />
@@ -68,18 +73,13 @@ class RegistryInfoContent extends Component<Props, State> {
6873 ) ;
6974 }
7075
71- private renderYarnTab ( scope : string , registryUrl : string ) {
76+ private renderYarnTab ( scope : string , registryUrl : string ) : JSX . Element {
7277 return (
7378 < React . Fragment >
7479 < CopyToClipBoard text = { getCLISetConfigRegistry ( `${ NODE_MANAGER . yarn } config set` , scope , registryUrl ) } />
7580 </ React . Fragment >
7681 ) ;
7782 }
78-
79- private handleChange = ( event : any , tabPosition : number ) => {
80- event . preventDefault ( ) ;
81- this . setState ( { tabPosition } ) ;
82- } ;
8383}
8484
8585export default RegistryInfoContent ;
0 commit comments