forked from sombochea/verdaccio-ui
fix: @typescript-eslint/no-explicit-any
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import React, { MouseEvent } from 'react';
|
||||
import capitalize from 'lodash/capitalize';
|
||||
import { Breakpoint } from '@material-ui/core/styles/createBreakpoints';
|
||||
|
||||
import { Svg, Img, ImgWrapper } from './styles';
|
||||
|
||||
@@ -57,10 +58,10 @@ export interface Props {
|
||||
name: keyof IconsMap;
|
||||
className?: string;
|
||||
onClick?: (event: MouseEvent<SVGElement | HTMLSpanElement>) => void;
|
||||
size?: 'sm' | 'md';
|
||||
size?: Breakpoint;
|
||||
pointer?: boolean;
|
||||
img?: boolean;
|
||||
modifiers?: any;
|
||||
modifiers?: null | undefined;
|
||||
}
|
||||
|
||||
const Icon: React.FC<Props> = ({ className, name, size = 'sm', img = false, pointer = false, ...props }) => {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import styled, { css } from 'react-emotion';
|
||||
import { Breakpoint } from '@material-ui/core/styles/createBreakpoints';
|
||||
|
||||
const getSize = (size: 'md' | 'sm' | string): string => {
|
||||
const getSize = (size: Breakpoint): string => {
|
||||
switch (size) {
|
||||
case 'md':
|
||||
return `
|
||||
@@ -15,7 +16,7 @@ const getSize = (size: 'md' | 'sm' | string): string => {
|
||||
}
|
||||
};
|
||||
|
||||
const commonStyle = ({ size = 'sm' as 'md' | 'sm' | string, pointer, modifiers = null }): string => css`
|
||||
const commonStyle = ({ size = 'sm' as Breakpoint, pointer, modifiers = null }): string => css`
|
||||
&& {
|
||||
display: inline-block;
|
||||
cursor: ${pointer ? 'pointer' : 'default'};
|
||||
|
||||
Reference in New Issue
Block a user