Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit ca42c83

Browse files
authored
chore: model style && ts import adjust (#1087)
* refactor(user-reaction): add esc hint && convert to ts * chore(import): move ReactNode to top of file
1 parent e0c62f0 commit ca42c83

File tree

20 files changed

+72
-81
lines changed

20 files changed

+72
-81
lines changed

src/components/AlertBar/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
*/
66

7-
import React, { FC } from 'react'
7+
import React, { FC, ReactNode } from 'react'
88

99
import { buildLog } from '@/utils'
1010

@@ -14,7 +14,7 @@ import { Wrapper } from './styles'
1414
const log = buildLog('c:AlertBar:index')
1515

1616
type TProps = {
17-
children: React.ReactNode
17+
children: ReactNode
1818
}
1919

2020
const AlertBar: FC<TProps> = ({ children }) => {

src/components/Buttons/ArrowButton.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
*/
66

7-
import React, { FC, useRef, useState, useEffect } from 'react'
7+
import React, { FC, ReactNode, useRef, useState, useEffect } from 'react'
88

99
import type { TSIZE } from '@/spec'
1010
import { ICON } from '@/config'
@@ -17,7 +17,7 @@ import { Wrapper, Text, LeftIcon, RightIcon } from './styles/arrow_button'
1717
const log = buildLog('c:Buttons:ArrowButton')
1818

1919
type TProps = {
20-
children?: React.ReactNode
20+
children?: ReactNode
2121
onClick?: () => void
2222
size?: TSIZE
2323
direction?: 'left' | 'right'

src/components/Buttons/ArrowLink.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
*/
66

7-
import React, { FC } from 'react'
7+
import React, { FC, ReactNode } from 'react'
88

99
import type { TSIZE } from '@/spec'
1010
import { ICON_CMD } from '@/config'
@@ -18,7 +18,7 @@ const log = buildLog('c:Buttons:ArrowLink')
1818

1919
type TProps = {
2020
className?: string
21-
children?: React.ReactNode
21+
children?: ReactNode
2222
size?: TSIZE
2323
href: string
2424
target?: '_blank' | ''

src/components/Buttons/Button.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { FC, useEffect, useState } from 'react'
1+
import React, { FC, ReactNode, useEffect, useState } from 'react'
22

33
import type { TSIZE_TSM } from '@/spec'
44
import { SIZE } from '@/constant'
@@ -21,7 +21,7 @@ const clearTimerIfNeed = (timerId: number): void => {
2121
}
2222

2323
type TProps = {
24-
children?: React.ReactNode
24+
children?: ReactNode
2525
className?: string
2626
ghost?: boolean
2727
type?: 'primary' | 'red' | 'ghost'

src/components/Checker/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
*/
66

7-
import React, { FC } from 'react'
7+
import React, { FC, ReactNode } from 'react'
88

99
import type { TSIZE_SM } from '@/spec'
1010
import { ICON } from '@/config'
@@ -17,7 +17,7 @@ import { Wrapper, IconWrapper, Icon, ChildWrapper } from './styles'
1717
const log = buildLog('c:Checker:index')
1818

1919
type TProps = {
20-
children?: React.ReactNode | null
20+
children?: ReactNode | null
2121
checked?: boolean
2222
hiddenMode?: boolean
2323
size?: TSIZE_SM

src/components/CustomScroller/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { FC } from 'react'
1+
import React, { FC, ReactNode } from 'react'
22

33
import type { TSIZE_SML } from '@/spec'
44
import type { TDirection, TScrollDirection } from './spec'
@@ -8,7 +8,7 @@ import VerticalScroller from './VerticalScroller'
88

99
export type TProps = {
1010
direction: TDirection
11-
children: React.ReactNode
11+
children: ReactNode
1212
height?: string
1313
innerHeight?: string
1414
width?: string

src/components/DigestSentence/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
*/
66

7-
import React, { FC } from 'react'
7+
import React, { FC, ReactNode } from 'react'
88

99
import { ICON } from '@/config'
1010
import { buildLog } from '@/utils'
@@ -26,12 +26,12 @@ const log = buildLog('c:DigestSentence:index')
2626

2727
type TProps = {
2828
testid?: string
29-
children: React.ReactNode
30-
onPreview: () => void
29+
children: ReactNode
3130
top?: number
3231
bottom?: number
3332
left?: number
3433
right?: number
34+
onPreview: () => void
3535
}
3636

3737
const DigestSentence: FC<TProps> = ({

src/components/IconText/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
*/
66

7-
import React, { FC } from 'react'
7+
import React, { FC, ReactNode } from 'react'
88

99
import type { TSIZE } from '@/spec'
1010
import { buildLog, nilOrEmpty } from '@/utils'
@@ -18,7 +18,7 @@ const log = buildLog('c:IconText:index')
1818
type TProps = {
1919
iconSrc: string
2020
round?: boolean
21-
children: React.ReactNode
21+
children: ReactNode
2222
size?: TSIZE
2323
margin?: string
2424
}

src/components/Img/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Renders an image, enforcing the usage of the alt="" tag
66
*/
77

8-
import React from 'react'
8+
import React, { ReactNode } from 'react'
99
import { ReactSVG } from 'react-svg'
1010

1111
import { buildLog } from '@/utils'
@@ -21,7 +21,7 @@ type IProps = {
2121
alt?: string
2222
className?: string
2323
loading?: boolean
24-
fallback?: React.ReactNode | null
24+
fallback?: ReactNode | null
2525
noLazy?: boolean
2626
scrollPosition?: any
2727
// see https://www.npmjs.com/package/react-lazy-load-image-component

src/components/MasonryCards/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
*/
66

7-
import React, { FC } from 'react'
7+
import React, { FC, ReactNode } from 'react'
88
import Masonry from 'react-masonry-css'
99

1010
import { buildLog } from '@/utils'
@@ -17,7 +17,7 @@ const log = buildLog('c:MasonryCards:index')
1717
type TProps = {
1818
testid?: string
1919
column?: number
20-
children: React.ReactNode
20+
children: ReactNode
2121
}
2222

2323
const MasonryCards: FC<TProps> = ({

0 commit comments

Comments
 (0)