diff --git a/src/components/Developers/Developers.tsx b/src/components/Developers/Developers.tsx index 5881d77..7913d7c 100644 --- a/src/components/Developers/Developers.tsx +++ b/src/components/Developers/Developers.tsx @@ -13,11 +13,11 @@ interface Props { } class Developers extends Component { - state = { + public state = { visibleDevs: 6, }; - render() { + public render() { return ( {({ packageMeta }: any) => { @@ -30,11 +30,11 @@ class Developers extends Component { ); } - handleLoadMore = () => { + public handleLoadMore = () => { this.setState(prev => ({ visibleDevs: prev.visibleDevs + 6 })); }; - renderDevelopers = (developers, packageMeta) => { + private renderDevelopers = (developers, packageMeta) => { const { type } = this.props; const { visibleDevs } = this.state; return ( @@ -54,7 +54,7 @@ class Developers extends Component { ); }; - renderLinkForMail(email, avatarComponent, packageName, version) { + private renderLinkForMail(email, avatarComponent, packageName, version) { if (!email || isEmail(email) === false) { return avatarComponent; } @@ -65,7 +65,7 @@ class Developers extends Component { ); } - renderDeveloperDetails = ({ name, avatar, email }, packageMeta) => { + private renderDeveloperDetails = ({ name, avatar, email }, packageMeta) => { const { name: packageName, version } = packageMeta.latest; const avatarComponent = ; diff --git a/src/components/Dist/Dist.tsx b/src/components/Dist/Dist.tsx index 4921f2e..381fff0 100644 --- a/src/components/Dist/Dist.tsx +++ b/src/components/Dist/Dist.tsx @@ -7,7 +7,7 @@ import { Heading, DistListItem, DistChips } from './styles'; import fileSizeSI from '../../utils/file-size'; class Dist extends Component { - render() { + public render() { return ( {(context: any) => { @@ -17,7 +17,7 @@ class Dist extends Component { ); } - renderChips(dist: any, license: string) { + private renderChips(dist: any, license: string) { const distDict = { 'file-count': dist.fileCount, size: dist.unpackedSize && fileSizeSI(dist.unpackedSize), @@ -43,7 +43,7 @@ class Dist extends Component { return chipsList; } - renderDist = ({ packageMeta }: any) => { + private renderDist = ({ packageMeta }: any) => { const { dist = {}, license } = packageMeta.latest; return ( diff --git a/src/components/RegistryInfoContent/RegistryInfoContent.tsx b/src/components/RegistryInfoContent/RegistryInfoContent.tsx index 9d64b76..7ea2b9a 100644 --- a/src/components/RegistryInfoContent/RegistryInfoContent.tsx +++ b/src/components/RegistryInfoContent/RegistryInfoContent.tsx @@ -22,15 +22,15 @@ function TabContainer({ children }) { } class RegistryInfoContent extends Component { - state = { + public state = { tabPosition: 0, }; - render() { + public render() { return
{this.renderTabs()}
; } - renderTabs() { + private renderTabs() { const { scope, registryUrl } = this.props; const { tabPosition } = this.state; @@ -48,7 +48,7 @@ class RegistryInfoContent extends Component { ); } - renderNpmTab(scope: string, registryUrl: string) { + private renderNpmTab(scope: string, registryUrl: string) { return ( @@ -58,7 +58,7 @@ class RegistryInfoContent extends Component { ); } - renderPNpmTab(scope: string, registryUrl: string) { + private renderPNpmTab(scope: string, registryUrl: string) { return ( @@ -68,7 +68,7 @@ class RegistryInfoContent extends Component { ); } - renderYarnTab(scope: string, registryUrl: string) { + private renderYarnTab(scope: string, registryUrl: string) { return ( @@ -76,7 +76,7 @@ class RegistryInfoContent extends Component { ); } - handleChange = (event: any, tabPosition: number) => { + private handleChange = (event: any, tabPosition: number) => { event.preventDefault(); this.setState({ tabPosition }); }; diff --git a/src/utils/asyncComponent.tsx b/src/utils/asyncComponent.tsx index af57a35..b687f6b 100644 --- a/src/utils/asyncComponent.tsx +++ b/src/utils/asyncComponent.tsx @@ -2,10 +2,10 @@ import React from 'react'; export function asyncComponent(getComponent) { return class AsyncComponent extends React.Component { - static Component = null; - state = { Component: AsyncComponent.Component }; + public static Component = null; + public state = { Component: AsyncComponent.Component }; - componentDidMount() { + public componentDidMount() { const { Component } = this.state; if (!Component) { getComponent() @@ -19,7 +19,8 @@ export function asyncComponent(getComponent) { }); } } - render() { + + public render() { const { Component } = this.state; if (Component) { // eslint-disable-next-line verdaccio/jsx-spread