chore(ui): migrate more code to typescript

This commit is contained in:
Łukasz Mierzwa
2020-06-29 16:14:53 +01:00
committed by Łukasz Mierzwa
parent 55170f8812
commit 4d4dd111c1
36 changed files with 392 additions and 205 deletions

View File

@@ -1,9 +1,12 @@
import React from "react";
import React, { FC, ReactNode } from "react";
import PropTypes from "prop-types";
import { CSSTransition } from "react-transition-group";
const DropdownSlide = ({ children, duration, ...props }) => (
const DropdownSlide: FC<{
children: ReactNode;
duration: number;
}> = ({ children, duration, ...props }) => (
<CSSTransition
classNames="components-animation-slide"
timeout={150}

View File

@@ -1,9 +1,13 @@
import React from "react";
import React, { FC, ReactNode } from "react";
import PropTypes from "prop-types";
import { CSSTransition } from "react-transition-group";
const MountModal = ({ children, duration, ...props }) => (
const MountModal: FC<{
children: ReactNode;
in: boolean;
unmountOnExit?: boolean;
}> = ({ children, ...props }) => (
<CSSTransition
classNames="components-animation-modal"
timeout={200}
@@ -19,9 +23,12 @@ MountModal.propTypes = {
children: PropTypes.node.isRequired,
};
const MountModalBackdrop = ({ children, duration, ...props }) => (
const MountModalBackdrop: FC<{
children: ReactNode;
in?: boolean;
unmountOnExit?: boolean;
}> = ({ children, ...props }) => (
<CSSTransition
in={true}
classNames="components-animation-backdrop"
timeout={200}
appear={true}