fix: remove ts ignore from some components

This commit is contained in:
Antoine Chalifour 2019-10-03 13:22:36 +02:00 committed by antoinechalifour
parent 32f4389b73
commit b1804d7644
4 changed files with 15 additions and 12 deletions

View File

@ -64,7 +64,6 @@ export default class App extends Component<{}, AppStateInterface> {
const context = { isUserLoggedIn, packages, logoUrl, user, scope };
return (
// @ts-ignore
<Container isLoading={isLoading}>
{isLoading ? <Loading /> : <AppContextProvider value={context}>{this.renderContent()}</AppContextProvider>}
{this.renderLoginModal()}

View File

@ -9,18 +9,20 @@ interface Props {
modifiers?: null | undefined;
}
interface WrapperProps {
capitalize: boolean;
weight: string;
modifiers?: null;
}
const Wrapper = styled('div')`
font-weight: ${({ weight }) => {
// @ts-ignore
return fontWeight[weight];
}};
text-transform: ${({ capitalize }) => (capitalize ? 'capitalize' : 'none')};
${({ modifiers }: Props) => modifiers && modifiers};
font-weight: ${({ weight }: WrapperProps) => fontWeight[weight]};
text-transform: ${({ capitalize }: WrapperProps) => (capitalize ? 'capitalize' : 'none')};
${({ modifiers }: WrapperProps) => modifiers};
`;
const Label: React.FC<Props> = ({ text = '', capitalize = false, weight = 'regular', ...props }) => {
return (
// @ts-ignore
<Wrapper capitalize={capitalize} weight={weight} {...props}>
{text}
</Wrapper>

View File

@ -11,15 +11,18 @@ export const Content = styled('div')({
},
});
interface ContainerProps {
isLoading: boolean;
}
export const Container = styled('div')`
&& {
display: flex;
flex-direction: column;
min-height: 100vh;
overflow: hidden;
${props =>
// @ts-ignore
props.isLoading &&
${({ isLoading }: ContainerProps) =>
isLoading &&
css`
${Content} {
background-color: #f5f6f8;

View File

@ -8,7 +8,6 @@ interface Props {
}
const Spinner: React.FC<Props> = ({ size = 50, centered = false }) => (
// @ts-ignore
<Wrapper centered={centered}>
<Circular size={size} />
</Wrapper>