Switch to prop-types

pull/21833/head
David Baker 2017-08-15 08:58:08 +01:00
parent 1b66e88b6e
commit d1c54e1224
1 changed files with 8 additions and 7 deletions

View File

@ -15,6 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import PropTypes from 'prop-types';
import MatrixClientPeg from './MatrixClientPeg'; import MatrixClientPeg from './MatrixClientPeg';
import MultiInviter from './utils/MultiInviter'; import MultiInviter from './utils/MultiInviter';
import Modal from "./Modal"; import Modal from "./Modal";
@ -30,20 +31,20 @@ export const addressTypes = [
'mx', 'email', 'mx', 'email',
]; ];
// React PropType definition for an object describing // PropType definition for an object describing
// an address that can be invited to a room (which // an address that can be invited to a room (which
// could be a third party identifier or a matrix ID) // could be a third party identifier or a matrix ID)
// along with some additional information about the // along with some additional information about the
// address / target. // address / target.
export const InviteAddressType = React.PropTypes.shape({ export const InviteAddressType = PropTypes.shape({
addressType: React.PropTypes.oneOf(addressTypes).isRequired, addressType: PropTypes.oneOf(addressTypes).isRequired,
address: React.PropTypes.string.isRequired, address: PropTypes.string.isRequired,
displayName: React.PropTypes.string, displayName: PropTypes.string,
avatarMxc: React.PropTypes.string, avatarMxc: PropTypes.string,
// true if the address is known to be a valid address (eg. is a real // true if the address is known to be a valid address (eg. is a real
// user we've seen) or false otherwise (eg. is just an address the // user we've seen) or false otherwise (eg. is just an address the
// user has entered) // user has entered)
isKnown: React.PropTypes.bool, isKnown: PropTypes.bool,
}); });
export function getAddressType(inputText) { export function getAddressType(inputText) {