src/entities/PageChangeAnimation/index.tsx
last analyzed

Complexity

Total Complexity 0
Complexity/F 0

Size

Lines of Code 40
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 0
eloc 29
mnd 0
bc 0
fnc 0
dl 0
loc 40
bpm 0
cpm 0
noi 14
c 0
b 0
f 0
1
import { FC, ReactNode } from 'react'
2
import { SwitchTransition, CSSTransition } from 'react-transition-group'
3
4
interface IProps {
5
  mode?: 'out-in' | 'in-out'
0 ignored issues
show
introduced by
propType "mode" is not required, but has no corresponding defaultProps declaration.
Loading history...
6
  classNames: string
7
  keyProp: number | string
8
  timeout: number
9
  children: ReactNode
10
}
11
12
const PageChangeAnimation: FC<IProps> = ({
0 ignored issues
show
introduced by
Function component is not a function declaration
Loading history...
13
  children,
14
  classNames,
15
  keyProp,
16
  mode = 'out-in',
17
  timeout,
18
}) => (
19
  <SwitchTransition mode={mode}>
0 ignored issues
show
introduced by
Expected indentation of 4 space characters but found 2.
Loading history...
introduced by
JSX not allowed in files with extension '.tsx'
Loading history...
20
    <CSSTransition
0 ignored issues
show
introduced by
Expected indentation of 6 space characters but found 4.
Loading history...
21
      key={keyProp}
0 ignored issues
show
introduced by
Expected indentation of 8 space characters but found 6.
Loading history...
22
      onExited={() =>
0 ignored issues
show
introduced by
Expected indentation of 8 space characters but found 6.
Loading history...
introduced by
JSX props should not use arrow functions
Loading history...
introduced by
JSX attribute values should not contain functions created in the same scope
Loading history...
23
        setTimeout(
24
          () =>
25
            window.scrollTo({
26
              top: 0,
27
              behavior: 'smooth',
28
            }),
29
          420,
30
        )
31
      }
0 ignored issues
show
introduced by
Unexpected newline before '}'.
Loading history...
32
      timeout={timeout}
0 ignored issues
show
introduced by
Expected indentation of 8 space characters but found 6.
Loading history...
33
      classNames={classNames}
0 ignored issues
show
introduced by
Expected indentation of 8 space characters but found 6.
Loading history...
introduced by
Props should be sorted alphabetically
Loading history...
34
    >
35
      {children}
0 ignored issues
show
introduced by
Expected indentation of 8 space characters but found 6.
Loading history...
36
    </CSSTransition>
37
  </SwitchTransition>
38
)
39
40
export { PageChangeAnimation }
41