Skip to content

Commit bd8ca10

Browse files
committed
migration
1 parent 2b5463a commit bd8ca10

File tree

3 files changed

+11
-14
lines changed

3 files changed

+11
-14
lines changed
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// @flow
21

32
import withEnterAnimation from './withEnterAnimation';
43

front/src/hoc/withEnterAnimation/styled/AnimatedDiv.js renamed to front/src/hoc/withEnterAnimation/styled/AnimatedDiv.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
// @flow
2-
3-
// @region imports
4-
import styled, { keyframes, css } from 'styled-components';
5-
// #endregion
1+
import styled, { keyframes, css, ThemeProps } from 'styled-components';
62

73
const fadeIn = keyframes`
84
from {
@@ -14,7 +10,12 @@ const fadeIn = keyframes`
1410
}
1511
`;
1612

17-
const AnimatedDiv = styled.div`
13+
type Props = {
14+
readonly theme: ThemeProps<any>;
15+
readonly viewEnter: boolean;
16+
};
17+
18+
const AnimatedDiv = styled.div<Props>`
1819
${({ viewEnter }) =>
1920
viewEnter &&
2021
css`

front/src/hoc/withEnterAnimation/withEnterAnimation.js renamed to front/src/hoc/withEnterAnimation/withEnterAnimation.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
// @flow
2-
3-
// #region imports
41
import React, { Component } from 'react';
2+
// @ts-ignore
53
import wrapDisplayName from 'recompose/wrapDisplayName';
64
import AnimatedDiv from './styled/AnimatedDiv';
7-
// #endregion
85

9-
// #region flow types
6+
// #region types
107
type Props = any;
118

129
type State = any;
@@ -19,7 +16,7 @@ function withEnterAnimation() {
1916
const { ...passProps } = this.props;
2017

2118
return (
22-
<AnimatedDiv viewEnter={true}>
19+
<AnimatedDiv viewEnter>
2320
<BaseComponent {...passProps} />
2421
</AnimatedDiv>
2522
);
@@ -29,7 +26,7 @@ function withEnterAnimation() {
2926
/* eslint-disable no-process-env */
3027
if (process.env.NODE_ENV !== 'production') {
3128
// HOC would obfuscate component name, this trick is helpful for dev (we don't care in production)
32-
WithEnterAnimation.displayName = wrapDisplayName(
29+
(WithEnterAnimation as any).displayName = wrapDisplayName(
3330
BaseComponent,
3431
'withEnterAnimation',
3532
);

0 commit comments

Comments
 (0)