This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 833
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3263 from matrix-org/t3chguy/prop-types
Replace React.PropTypes with usage of the `prop-types` package
- Loading branch information
Showing
16 changed files
with
65 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
/* | ||
Copyright 2015, 2016 OpenMarket Ltd | ||
Copyright 2019 Michael Telatynski <[email protected]> | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
|
@@ -14,15 +15,14 @@ See the License for the specific language governing permissions and | |
limitations under the License. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
const React = require('react'); | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { _t } from '../../languageHandler'; | ||
|
||
module.exports = React.createClass({ | ||
displayName: 'CompatibilityPage', | ||
propTypes: { | ||
onAccept: React.PropTypes.func, | ||
onAccept: PropTypes.func, | ||
}, | ||
|
||
getDefaultProps: function() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ Copyright 2015, 2016 OpenMarket Ltd | |
Copyright 2017 Vector Creations Ltd | ||
Copyright 2017 New Vector Ltd | ||
Copyright 2018 New Vector Ltd | ||
Copyright 2019 Michael Telatynski <[email protected]> | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
|
@@ -30,9 +31,9 @@ import GroupStore from '../../stores/GroupStore'; | |
export default class RightPanel extends React.Component { | ||
static get propTypes() { | ||
return { | ||
roomId: React.PropTypes.string, // if showing panels for a given room, this is set | ||
groupId: React.PropTypes.string, // if showing panels for a given group, this is set | ||
user: React.PropTypes.object, | ||
roomId: PropTypes.string, // if showing panels for a given room, this is set | ||
groupId: PropTypes.string, // if showing panels for a given group, this is set | ||
user: PropTypes.object, | ||
}; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
/* | ||
Copyright 2015, 2016 OpenMarket Ltd | ||
Copyright 2019 Michael Telatynski <[email protected]> | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
|
@@ -25,6 +26,7 @@ const sdk = require('../../index'); | |
const dis = require('../../dispatcher'); | ||
|
||
import { linkifyAndSanitizeHtml } from '../../HtmlUtils'; | ||
import PropTypes from 'prop-types'; | ||
import Promise from 'bluebird'; | ||
import { _t } from '../../languageHandler'; | ||
import { instanceForInstanceId, protocolNameForInstanceId } from '../../utils/DirectoryUtils'; | ||
|
@@ -41,8 +43,8 @@ module.exports = React.createClass({ | |
displayName: 'RoomDirectory', | ||
|
||
propTypes: { | ||
config: React.PropTypes.object, | ||
onFinished: React.PropTypes.func.isRequired, | ||
config: PropTypes.object, | ||
onFinished: PropTypes.func.isRequired, | ||
}, | ||
|
||
getDefaultProps: function() { | ||
|
@@ -65,7 +67,7 @@ module.exports = React.createClass({ | |
}, | ||
|
||
childContextTypes: { | ||
matrixClient: React.PropTypes.object, | ||
matrixClient: PropTypes.object, | ||
}, | ||
|
||
getChildContext: function() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
/* | ||
Copyright 2019 New Vector Ltd | ||
Copyright 2019 Michael Telatynski <[email protected]> | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
|
@@ -15,6 +16,7 @@ limitations under the License. | |
*/ | ||
|
||
import React from "react"; | ||
import PropTypes from "prop-types"; | ||
import Matrix from "matrix-js-sdk"; | ||
import MatrixClientPeg from "../../MatrixClientPeg"; | ||
import sdk from "../../index"; | ||
|
@@ -24,7 +26,7 @@ import { _t } from '../../languageHandler'; | |
export default class UserView extends React.Component { | ||
static get propTypes() { | ||
return { | ||
userId: React.PropTypes.string, | ||
userId: PropTypes.string, | ||
}; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
/* | ||
Copyright 2017 OpenMarket Ltd | ||
Copyright 2018 New Vector Ltd | ||
Copyright 2019 Michael Telatynski <[email protected]> | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
|
@@ -16,6 +17,7 @@ limitations under the License. | |
*/ | ||
|
||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import sdk from '../../../index'; | ||
import SdkConfig from '../../../SdkConfig'; | ||
import Modal from '../../../Modal'; | ||
|
@@ -200,5 +202,5 @@ export default class BugReportDialog extends React.Component { | |
} | ||
|
||
BugReportDialog.propTypes = { | ||
onFinished: React.PropTypes.func.isRequired, | ||
onFinished: PropTypes.func.isRequired, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
/* | ||
Copyright 2016 Aviral Dasgupta | ||
Copyright 2019 Michael Telatynski <[email protected]> | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
|
@@ -15,6 +16,7 @@ | |
*/ | ||
|
||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import sdk from '../../../index'; | ||
import request from 'browser-request'; | ||
import { _t } from '../../../languageHandler'; | ||
|
@@ -99,7 +101,7 @@ export default class ChangelogDialog extends React.Component { | |
} | ||
|
||
ChangelogDialog.propTypes = { | ||
version: React.PropTypes.string.isRequired, | ||
newVersion: React.PropTypes.string.isRequired, | ||
onFinished: React.PropTypes.func.isRequired, | ||
version: PropTypes.string.isRequired, | ||
newVersion: PropTypes.string.isRequired, | ||
onFinished: PropTypes.func.isRequired, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
/* | ||
Copyright 2017 Vector Creations Ltd | ||
Copyright 2018 New Vector Ltd | ||
Copyright 2019 Michael Telatynski <[email protected]> | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
|
@@ -16,6 +17,7 @@ limitations under the License. | |
*/ | ||
|
||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import sdk from '../../../index'; | ||
import { _t } from '../../../languageHandler'; | ||
import Modal from '../../../Modal'; | ||
|
@@ -63,7 +65,7 @@ const WarmFuzzy = function(props) { | |
export default React.createClass({ | ||
displayName: 'SetPasswordDialog', | ||
propTypes: { | ||
onFinished: React.PropTypes.func.isRequired, | ||
onFinished: PropTypes.func.isRequired, | ||
}, | ||
|
||
getInitialState: function() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
/* | ||
Copyright 2016 OpenMarket Ltd | ||
Copyright 2019 Michael Telatynski <[email protected]> | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
|
@@ -15,6 +16,7 @@ limitations under the License. | |
*/ | ||
|
||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import MatrixClientPeg from '../../../MatrixClientPeg'; | ||
import {instanceForInstanceId} from '../../../utils/DirectoryUtils'; | ||
|
||
|
@@ -241,10 +243,10 @@ export default class NetworkDropdown extends React.Component { | |
} | ||
|
||
NetworkDropdown.propTypes = { | ||
onOptionChange: React.PropTypes.func.isRequired, | ||
protocols: React.PropTypes.object, | ||
onOptionChange: PropTypes.func.isRequired, | ||
protocols: PropTypes.object, | ||
// The room directory config. May have a 'servers' key that is a list of server names to include in the dropdown | ||
config: React.PropTypes.object, | ||
config: PropTypes.object, | ||
}; | ||
|
||
NetworkDropdown.defaultProps = { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
/* | ||
Copyright 2017 Vector Creations Ltd | ||
Copyright 2019 Michael Telatynski <[email protected]> | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
|
@@ -58,7 +59,7 @@ class MenuOption extends React.Component { | |
|
||
MenuOption.propTypes = { | ||
children: PropTypes.oneOfType([ | ||
PropTypes.arrayOf(React.PropTypes.node), | ||
PropTypes.arrayOf(PropTypes.node), | ||
PropTypes.node, | ||
]), | ||
highlighted: PropTypes.bool, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
/* | ||
Copyright 2015, 2016 OpenMarket Ltd | ||
Copyright 2019 New Vector Ltd | ||
Copyright 2019 Michael Telatynski <[email protected]> | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
|
@@ -18,6 +19,7 @@ limitations under the License. | |
|
||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import PropTypes from 'prop-types'; | ||
import dis from '../../../dispatcher'; | ||
import classNames from 'classnames'; | ||
|
||
|
@@ -28,15 +30,15 @@ module.exports = React.createClass({ | |
|
||
propTypes: { | ||
// Class applied to the element used to position the tooltip | ||
className: React.PropTypes.string, | ||
className: PropTypes.string, | ||
// Class applied to the tooltip itself | ||
tooltipClassName: React.PropTypes.string, | ||
tooltipClassName: PropTypes.string, | ||
// Whether the tooltip is visible or hidden. | ||
// The hidden state allows animating the tooltip away via CSS. | ||
// Defaults to visible if unset. | ||
visible: React.PropTypes.bool, | ||
visible: PropTypes.bool, | ||
// the react element to put into the tooltip | ||
label: React.PropTypes.node, | ||
label: PropTypes.node, | ||
}, | ||
|
||
getDefaultProps() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
/* | ||
Copyright 2015, 2016 OpenMarket Ltd | ||
Copyright 2019 Michael Telatynski <[email protected]> | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
|
@@ -14,9 +15,8 @@ See the License for the specific language governing permissions and | |
limitations under the License. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import sdk from '../../../index'; | ||
import Modal from '../../../Modal'; | ||
import PlatformPeg from '../../../PlatformPeg'; | ||
|
@@ -33,9 +33,9 @@ function checkVersion(ver) { | |
|
||
export default React.createClass({ | ||
propTypes: { | ||
version: React.PropTypes.string.isRequired, | ||
newVersion: React.PropTypes.string.isRequired, | ||
releaseNotes: React.PropTypes.string, | ||
version: PropTypes.string.isRequired, | ||
newVersion: PropTypes.string.isRequired, | ||
releaseNotes: PropTypes.string, | ||
}, | ||
|
||
displayReleaseNotes: function(releaseNotes) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
Copyright 2017 Michael Telatynski <[email protected]> | ||
Copyright 2017, 2019 Michael Telatynski <[email protected]> | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
|
@@ -14,19 +14,18 @@ See the License for the specific language governing permissions and | |
limitations under the License. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { _t } from '../../../languageHandler'; | ||
import PlatformPeg from '../../../PlatformPeg'; | ||
import AccessibleButton from '../../../components/views/elements/AccessibleButton'; | ||
|
||
export default React.createClass({ | ||
propTypes: { | ||
status: React.PropTypes.string.isRequired, | ||
status: PropTypes.string.isRequired, | ||
// Currently for error detail but will be usable for download progress | ||
// once that is a thing that squirrel passes through electron. | ||
detail: React.PropTypes.string, | ||
detail: PropTypes.string, | ||
}, | ||
|
||
getDefaultProps: function() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
Copyright 2015, 2016 OpenMarket Ltd | ||
Copyright 2017 New Vector Ltd | ||
Copyright 2019 The Matrix.org Foundation C.I.C. | ||
Copyright 2019 Michael Telatynski <[email protected]> | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
|
@@ -131,7 +132,7 @@ module.exports = withMatrixClient(React.createClass({ | |
onHeightChanged: PropTypes.func, | ||
|
||
/* a list of read-receipts we should show. Each object has a 'roomMember' and 'ts'. */ | ||
readReceipts: PropTypes.arrayOf(React.PropTypes.object), | ||
readReceipts: PropTypes.arrayOf(PropTypes.object), | ||
|
||
/* opaque readreceipt info for each userId; used by ReadReceiptMarker | ||
* to manage its animations. Should be an empty object when the room | ||
|
Oops, something went wrong.