forked from sombochea/verdaccio-ui
fix: improved typing (#174)
This commit is contained in:
committed by
Juan Picado @jotadeveloper
parent
68b7171de4
commit
e0642a9d0d
@@ -14,7 +14,7 @@ export interface AvatarDeveloper {
|
||||
|
||||
const AvatarTooltip: FC<AvatarDeveloper> = ({ name, packageName, version, avatar, email }) => {
|
||||
const avatarComponent = <Avatar aria-label={name} src={avatar} />;
|
||||
function renderLinkForMail(email, avatarComponent, packageName, version): JSX.Element {
|
||||
function renderLinkForMail(email: string, avatarComponent: JSX.Element, packageName: string, version: string): JSX.Element {
|
||||
if (!email || isEmail(email) === false) {
|
||||
return avatarComponent;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import { mount, ReactWrapper } from 'enzyme';
|
||||
|
||||
import CopyToClipBoard from './CopyToClipBoard';
|
||||
import { CopyIcon } from './styles';
|
||||
|
||||
describe('<CopyToClipBoard /> component', () => {
|
||||
let wrapper;
|
||||
let wrapper: ReactWrapper;
|
||||
|
||||
beforeEach(() => {
|
||||
wrapper = mount(<CopyToClipBoard text={'copy text'} />);
|
||||
|
||||
@@ -12,7 +12,7 @@ interface Props {
|
||||
children?: React.ReactNode;
|
||||
}
|
||||
|
||||
const renderText = (text, children): JSX.Element => {
|
||||
const renderText = (text: string, children: React.ReactNode): JSX.Element => {
|
||||
if (children) {
|
||||
return <ClipBoardCopyText>{children}</ClipBoardCopyText>;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ class Engine extends Component {
|
||||
return <Grid container={true}>{items}</Grid>;
|
||||
};
|
||||
|
||||
private renderListItems = (heading, text) => {
|
||||
private renderListItems = (heading: string, text: string) => {
|
||||
return (
|
||||
<List subheader={<Heading variant={'subtitle1'}>{text.split('-').join(' ')}</Heading>}>
|
||||
<EngineListItem button={true}>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import { mount, ReactWrapper } from 'enzyme';
|
||||
|
||||
import Footer from './Footer';
|
||||
|
||||
@@ -8,7 +8,7 @@ jest.mock('../../../package.json', () => ({
|
||||
}));
|
||||
|
||||
describe('<Footer /> component', () => {
|
||||
let wrapper;
|
||||
let wrapper: ReactWrapper;
|
||||
beforeEach(() => {
|
||||
window.VERDACCIO_VERSION = 'v.1.0.0';
|
||||
wrapper = mount(<Footer />);
|
||||
|
||||
@@ -151,7 +151,7 @@ export default class LoginModal extends Component<Partial<LoginModalProps>, Logi
|
||||
});
|
||||
};
|
||||
|
||||
public renderErrorMessage(title, description): JSX.Element {
|
||||
public renderErrorMessage(title: string, description: string): JSX.Element {
|
||||
return (
|
||||
<span>
|
||||
<div>
|
||||
@@ -162,7 +162,7 @@ export default class LoginModal extends Component<Partial<LoginModalProps>, Logi
|
||||
);
|
||||
}
|
||||
|
||||
public renderMessage(title, description): JSX.Element {
|
||||
public renderMessage(title: string, description: string): JSX.Element {
|
||||
return (
|
||||
<div className={classes.loginErrorMsg} id={'client-snackbar'}>
|
||||
<ErrorIcon className={classes.loginIcon} />
|
||||
|
||||
Reference in New Issue
Block a user