1
0
mirror of https://github.com/SomboChea/ui synced 2026-01-18 09:06:14 +07:00

fix: type lint for login

This commit is contained in:
Griffithtp
2019-06-23 22:44:53 +01:00
parent 116055c5d1
commit 91e603ef21
7 changed files with 77 additions and 61 deletions

View File

@@ -67,7 +67,7 @@ const Icon: React.FC<Props> = ({ className, name, size = 'sm', img = false, poin
// @ts-ignore
const title = capitalize(name);
return img ? (
<ImgWrapper className={className} name={name} pointer={pointer} size={size} title={title} {...props}>
<ImgWrapper className={className} pointer={pointer} size={size} title={title} {...props}>
<Img alt={title} src={Icons[name]} />
</ImgWrapper>
) : (

View File

@@ -1,6 +1,6 @@
import styled, { css } from 'react-emotion';
const getSize = (size?: 'md' | 'sm') => {
const getSize = (size: 'md' | 'sm' | string): string => {
switch (size) {
case 'md':
return `
@@ -15,7 +15,7 @@ const getSize = (size?: 'md' | 'sm') => {
}
};
const commonStyle = ({ size = 'sm', pointer, modifiers }: any) => css`
const commonStyle = ({ size = 'sm' as 'md' | 'sm' | string, pointer, modifiers = null }): string => css`
&& {
display: inline-block;
cursor: ${pointer ? 'pointer' : 'default'};