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

Commit 6973ba7

Browse files
committed
refactor(naming): PropTypes -> T
1 parent 924748d commit 6973ba7

File tree

64 files changed

+328
-332
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+328
-332
lines changed

components/A/index.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
import React from 'react'
9-
import PropTypes from 'prop-types'
9+
import T from 'prop-types'
1010
import styled from 'styled-components'
1111

1212
export const StyledA = styled.a`
@@ -26,13 +26,9 @@ const A = ({ href, target, children }) => (
2626
)
2727

2828
A.propTypes = {
29-
href: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired,
30-
children: PropTypes.oneOfType([
31-
PropTypes.string,
32-
PropTypes.arrayOf(PropTypes.node),
33-
PropTypes.node,
34-
]).isRequired,
35-
target: PropTypes.string,
29+
href: T.oneOfType([T.string, T.object]).isRequired,
30+
children: T.oneOfType([T.string, T.arrayOf(T.node), T.node]).isRequired,
31+
target: T.string,
3632
}
3733

3834
A.defaultProps = {

components/AdderCell/index.js

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

77
import React from 'react'
8-
import PropTypes from 'prop-types'
8+
import T from 'prop-types'
99

1010
import { ICON_CMD } from '@config'
1111

@@ -25,7 +25,7 @@ const AdderCell = ({ onAdd }) => (
2525

2626
AdderCell.propTypes = {
2727
// https://www.npmjs.com/package/prop-types
28-
onAdd: PropTypes.func,
28+
onAdd: T.func,
2929
}
3030

3131
AdderCell.defaultProps = {

components/AvatarsRow/index.js

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

77
import React from 'react'
8-
import PropTypes from 'prop-types'
8+
import T from 'prop-types'
99
import R from 'ramda'
1010
import { Tooltip } from 'antd'
1111

@@ -61,19 +61,19 @@ const AvatarsRow = ({
6161
}
6262

6363
AvatarsRow.propTypes = {
64-
users: PropTypes.arrayOf(
65-
PropTypes.shape({
66-
id: PropTypes.string,
67-
avatar: PropTypes.string,
68-
nickname: PropTypes.string,
69-
extra_id: PropTypes.string,
64+
users: T.arrayOf(
65+
T.shape({
66+
id: T.string,
67+
avatar: T.string,
68+
nickname: T.string,
69+
extra_id: T.string,
7070
})
7171
),
72-
total: PropTypes.number.isRequired,
73-
height: PropTypes.string,
74-
limit: PropTypes.number,
75-
onUserSelect: PropTypes.func,
76-
onTotalSelect: PropTypes.func,
72+
total: T.number.isRequired,
73+
height: T.string,
74+
limit: T.number,
75+
onUserSelect: T.func,
76+
onTotalSelect: T.func,
7777
}
7878

7979
AvatarsRow.defaultProps = {

components/BannerCountBrief/index.js

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

77
import React from 'react'
8-
import PropTypes from 'prop-types'
8+
import T from 'prop-types'
99

1010
import { makeDebugger, toPercentNum } from '@utils'
1111

@@ -69,10 +69,10 @@ const BannerCountBrief = ({ filteredCount, totalCount, thread, unit }) => (
6969
)
7070

7171
BannerCountBrief.propTypes = {
72-
filteredCount: PropTypes.number,
73-
totalCount: PropTypes.number.isRequired,
74-
unit: PropTypes.string,
75-
thread: PropTypes.string,
72+
filteredCount: T.number,
73+
totalCount: T.number.isRequired,
74+
unit: T.string,
75+
thread: T.string,
7676
}
7777

7878
BannerCountBrief.defaultProps = {

components/CategoriesCell/index.js

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

77
import React from 'react'
8-
import PropTypes from 'prop-types'
8+
import T from 'prop-types'
99
import R from 'ramda'
1010
import { Icon } from 'antd'
1111

@@ -67,9 +67,9 @@ export default CategoriesCell
6767

6868
CategoriesCell.propTypes = {
6969
// https://www.npmjs.com/package/prop-types
70-
source: PropTypes.object.isRequired,
71-
onDelete: PropTypes.func.isRequired,
72-
onAdd: PropTypes.func.isRequired,
70+
source: T.object.isRequired,
71+
onDelete: T.func.isRequired,
72+
onAdd: T.func.isRequired,
7373
}
7474

7575
CategoriesCell.defaultProps = {

components/ColorCell/index.js

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

77
import React from 'react'
8-
import PropTypes from 'prop-types'
8+
import T from 'prop-types'
99

1010
import { makeDebugger } from '@utils'
1111

@@ -25,7 +25,7 @@ const ColorCellComponent = ({ color }) => {
2525

2626
ColorCellComponent.propTypes = {
2727
// https://www.npmjs.com/package/prop-types
28-
color: PropTypes.string,
28+
color: T.string,
2929
}
3030

3131
ColorCellComponent.defaultProps = {

components/CommunityCell/index.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import React from 'react'
88
import R from 'ramda'
9-
import PropTypes from 'prop-types'
9+
import T from 'prop-types'
1010
import ReactTooltip from 'react-tooltip'
1111

1212
import { ICON_CMD } from '@config'
@@ -100,23 +100,23 @@ const CommunityCell = props => (
100100
CommunityCell.propTypes = {
101101
// https://www.npmjs.com/package/prop-types
102102
/* eslint-disable */
103-
data: PropTypes.shape({
104-
id: PropTypes.string,
105-
logo: PropTypes.string,
106-
title: PropTypes.string,
103+
data: T.shape({
104+
id: T.string,
105+
logo: T.string,
106+
title: T.string,
107107
}),
108108

109-
array: PropTypes.arrayOf(
110-
PropTypes.shape({
111-
logo: PropTypes.string,
112-
title: PropTypes.string,
109+
array: T.arrayOf(
110+
T.shape({
111+
logo: T.string,
112+
title: T.string,
113113
})
114114
),
115-
withSetter: PropTypes.bool,
116-
thread: PropTypes.string,
117-
source: PropTypes.object,
118-
onDelete: PropTypes.func,
119-
onAdd: PropTypes.func,
115+
withSetter: T.bool,
116+
thread: T.string,
117+
source: T.object,
118+
onDelete: T.func,
119+
onAdd: T.func,
120120
/* eslint-enable */
121121
}
122122

components/CommunityMatrix/index.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import React from 'react'
88
import R from 'ramda'
9-
import PropTypes from 'prop-types'
9+
import T from 'prop-types'
1010
import ReactTooltip from 'react-tooltip'
1111

1212
import { ICON_CMD } from '@config'
@@ -93,19 +93,19 @@ class CommunityMatrix extends React.Component {
9393

9494
CommunityMatrix.propTypes = {
9595
// https://www.npmjs.com/package/prop-types
96-
data: PropTypes.shape({
96+
data: T.shape({
9797
// TODO add shape
98-
entries: PropTypes.array.isRequired,
99-
pageNumber: PropTypes.number.isRequired,
100-
pageSize: PropTypes.number.isRequired,
101-
totalCount: PropTypes.number.isRequired,
98+
entries: T.array.isRequired,
99+
pageNumber: T.number.isRequired,
100+
pageSize: T.number.isRequired,
101+
totalCount: T.number.isRequired,
102102
}),
103-
array: PropTypes.array,
104-
onSelect: PropTypes.func,
105-
onAddOnSelect: PropTypes.func,
106-
activeRaw: PropTypes.string,
107-
lens: PropTypes.arrayOf(PropTypes.string),
108-
hasAddon: PropTypes.bool,
103+
array: T.array,
104+
onSelect: T.func,
105+
onAddOnSelect: T.func,
106+
activeRaw: T.string,
107+
lens: T.arrayOf(T.string),
108+
hasAddon: T.bool,
109109
}
110110

111111
CommunityMatrix.defaultProps = {

components/ContentFilter/index.js

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

77
import React from 'react'
8-
import PropTypes from 'prop-types'
8+
import T from 'prop-types'
99
import { Button, Row, Col, Tag } from 'antd'
1010
import { ICON_CMD } from '@config'
1111
import { makeDebugger, isEmptyValue } from '@utils'
@@ -163,11 +163,11 @@ const ContentFilter = ({ onSelect, activeWhen, activeSort, activeLength }) => (
163163

164164
ContentFilter.propTypes = {
165165
// https://www.npmjs.com/package/prop-types
166-
activeWhen: PropTypes.string,
167-
activeSort: PropTypes.string,
168-
activeLength: PropTypes.string,
166+
activeWhen: T.string,
167+
activeSort: T.string,
168+
activeLength: T.string,
169169

170-
onSelect: PropTypes.func.isRequired,
170+
onSelect: T.func.isRequired,
171171
}
172172

173173
ContentFilter.defaultProps = {

components/ContentsCountCell/index.js

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

77
import React from 'react'
8-
import PropTypes from 'prop-types'
8+
import T from 'prop-types'
99

1010
import { makeDebugger } from '@utils'
1111
import { Wrapper, Content, Label, Count } from './styles'
@@ -39,11 +39,11 @@ const ContentsCountCell = ({
3939
}
4040

4141
ContentsCountCell.propTypes = {
42-
data: PropTypes.shape({
43-
postsCount: PropTypes.number,
44-
jobsCount: PropTypes.number,
45-
videosCount: PropTypes.number,
46-
reposCount: PropTypes.number,
42+
data: T.shape({
43+
postsCount: T.number,
44+
jobsCount: T.number,
45+
videosCount: T.number,
46+
reposCount: T.number,
4747
}),
4848
}
4949

0 commit comments

Comments
 (0)