Skip to content

Commit c3ecc57

Browse files
authored
Merge pull request #639 from dannycolin/remove-prop-types
Remove deprecated prop-types
2 parents ad67037 + 1259947 commit c3ecc57

File tree

16 files changed

+14
-188
lines changed

16 files changed

+14
-188
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@
8787
"postcss-safe-parser": "5.0.2",
8888
"prettier": "^2.0.0",
8989
"prompts": "2.4.2",
90-
"prop-types": "^15.6.1",
9190
"qs": "^6.5.2",
9291
"ramda": "^0.28.0",
9392
"react": "18",

src/components/Dashboard/index.jsx

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import CloseIcon from 'mdi-react/CloseIcon';
1010
import ArrowLeftIcon from 'mdi-react/ArrowLeftIcon';
1111
import { Link } from 'react-router-dom';
1212
import classNames from 'classnames';
13-
import { bool, node, string, object } from 'prop-types';
1413
import AppBar from '../AppBar';
1514
import Sidebar from '../Sidebar';
1615

@@ -194,28 +193,3 @@ class Dashboard extends Component {
194193
);
195194
}
196195
}
197-
Dashboard.propTypes = {
198-
/*
199-
* The title to be put in the AppBar
200-
*/
201-
title: string,
202-
/*
203-
* Boolean to render the sidebar
204-
*/
205-
withSidebar: bool,
206-
/*
207-
* The custom header to be put in the AppBar
208-
*/
209-
header: node,
210-
/*
211-
* The style to be used by the Component
212-
*/
213-
classes: object,
214-
};
215-
216-
Dashboard.defaultProps = {
217-
classes: null,
218-
withSidebar: false,
219-
title: null,
220-
header: null,
221-
};

src/components/DataTable/index.jsx

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import TableCell from '@material-ui/core/TableCell';
66
import TableHead from '@material-ui/core/TableHead';
77
import TableRow from '@material-ui/core/TableRow';
88
import TableSortLabel from '@material-ui/core/TableSortLabel';
9-
import { arrayOf, func, string, oneOf, object } from 'prop-types';
109

1110
@withStyles((theme) => ({
1211
table: {
@@ -67,44 +66,4 @@ class DataTable extends Component {
6766
);
6867
}
6968
}
70-
DataTable.propTypes = {
71-
/**
72-
* A function to execute for each row to render in the table.
73-
* Will be passed a datum from the table data. The function
74-
* should return the JSX necessary to render the given row.
75-
*/
76-
renderRow: func,
77-
/**
78-
* A function to execute when a column header is clicked.
79-
* Will receive a single argument which is the column name.
80-
* This can be used to handle sorting.
81-
*/
82-
onHeaderClick: func,
83-
/**
84-
* A header name to sort on.
85-
*/
86-
sortByHeader: string,
87-
/**
88-
* The sorting direction.
89-
*/
90-
sortDirection: oneOf(['desc', 'asc']),
91-
/**
92-
* A list of header names to use on the table starting from the left.
93-
*/
94-
headers: arrayOf(string),
95-
/**
96-
* A list of objects to display. Each element in the list is represented
97-
* by a row and each element's key-value pair represents a column.
98-
*/
99-
items: arrayOf(object).isRequired,
100-
};
101-
102-
DataTable.defaultProps = {
103-
sortByHeader: null,
104-
sortDirection: 'desc',
105-
headers: null,
106-
onHeaderClick: null,
107-
renderRow: null,
108-
};
109-
11069
export default DataTable;

src/components/ErrorPanel/ErrorBox.jsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React from 'react';
2-
import { instanceOf } from 'prop-types';
32
import { RedBoxError } from 'redbox-react';
43
import ErrorStackParser from 'error-stack-parser';
54
import { withStyles } from '@material-ui/core/styles';
@@ -53,6 +52,3 @@ class ErrorBox extends RedBoxError {
5352
}
5453
}
5554
}
56-
ErrorBox.propTypes = {
57-
error: instanceOf(Error).isRequired,
58-
};

src/components/ErrorPanel/index.jsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React, { Component } from 'react';
2-
import { instanceOf, oneOfType, string } from 'prop-types';
32
import classNames from 'classnames';
43
import Markdown from 'react-markdown';
54
import { withStyles } from '@material-ui/core/styles';
@@ -80,9 +79,3 @@ class ErrorPanel extends Component {
8079
);
8180
}
8281
}
83-
ErrorPanel.propTypes = {
84-
/**
85-
* Error to display
86-
*/
87-
error: oneOfType([string, instanceOf(Error)]).isRequired,
88-
};

src/components/ProjectCard/index.jsx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React, { Component } from 'react';
2-
import { string, shape } from 'prop-types';
32
import { withStyles } from '@material-ui/core/styles';
43
import { Link } from 'react-router-dom';
54
import Card from '@material-ui/core/Card';
@@ -79,11 +78,3 @@ class ProjectCard extends Component {
7978
);
8079
}
8180
}
82-
ProjectCard.propTypes = {
83-
project: shape({
84-
name: string.isRequired,
85-
summary: string,
86-
fileName: string.isRequired,
87-
icon: string,
88-
}).isRequired,
89-
};

src/components/ProjectIcon/index.jsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React, { Component } from 'react';
2-
import { string } from 'prop-types';
32
import { withStyles } from '@material-ui/core/styles';
43
import WebIcon from 'mdi-react/WebIcon';
54

@@ -121,7 +120,3 @@ class ProjectIcon extends Component {
121120
}
122121
}
123122
}
124-
ProjectIcon.propTypes = {
125-
// The name of the icon to display, from the case statement above.
126-
icon: string,
127-
};

src/components/ProjectIntroductionCard/index.jsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React, { Component } from 'react';
22
import classNames from 'classnames';
3-
import { string } from 'prop-types';
43
import { withStyles } from '@material-ui/core/styles';
54
import Card from '@material-ui/core/Card';
65
import CardActions from '@material-ui/core/CardActions';
@@ -73,6 +72,3 @@ class ProjectIntroductionCard extends Component {
7372
);
7473
}
7574
}
76-
ProjectIntroductionCard.propTypes = {
77-
introduction: string.isRequired,
78-
};

src/components/SearchBox/index.jsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React, { Component } from 'react';
2-
import { func, string } from 'prop-types';
32
import { withStyles } from '@material-ui/core/styles';
43
import { fade } from '@material-ui/core/styles/colorManipulator';
54
import MagnifyIcon from 'mdi-react/MagnifyIcon';
@@ -72,7 +71,3 @@ class Search extends Component {
7271
);
7372
}
7473
}
75-
Search.propTypes = {
76-
value: string.isRequired,
77-
onChange: func.isRequired,
78-
};

src/components/Sidebar/GoIcon.jsx

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React, { PureComponent } from 'react';
2-
import { number, string } from 'prop-types';
32

43
export default class GoIcon extends PureComponent {
54
render() {
@@ -8,8 +7,8 @@ export default class GoIcon extends PureComponent {
87
return (
98
<svg
109
className={className}
11-
width={size}
12-
fill={fill}
10+
width={size || 24}
11+
fill={fill || 'currentColor'}
1312
version="1.1"
1413
x="0px"
1514
y="0px"
@@ -23,13 +22,3 @@ export default class GoIcon extends PureComponent {
2322
);
2423
}
2524
}
26-
27-
GoIcon.propTypes = {
28-
size: number,
29-
fill: string,
30-
};
31-
32-
GoIcon.defaultProps = {
33-
size: 24,
34-
fill: 'currentColor',
35-
};

0 commit comments

Comments
 (0)