Use prop-types
parent
f8de1584d1
commit
3095db4837
|
|
@ -1,6 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
|
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
|
||||||
import Logger from '../Logger';
|
import Logger from '../Logger';
|
||||||
import muiTheme from './muiTheme';
|
import muiTheme from './muiTheme';
|
||||||
|
|
@ -51,6 +52,6 @@ export default class App extends React.Component
|
||||||
|
|
||||||
App.propTypes =
|
App.propTypes =
|
||||||
{
|
{
|
||||||
peerId : React.PropTypes.string.isRequired,
|
peerId : PropTypes.string.isRequired,
|
||||||
roomId : React.PropTypes.string.isRequired
|
roomId : PropTypes.string.isRequired
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
import IconButton from 'material-ui/IconButton/IconButton';
|
import IconButton from 'material-ui/IconButton/IconButton';
|
||||||
import MicOffIcon from 'material-ui/svg-icons/av/mic-off';
|
import MicOffIcon from 'material-ui/svg-icons/av/mic-off';
|
||||||
import VideoCamOffIcon from 'material-ui/svg-icons/av/videocam-off';
|
import VideoCamOffIcon from 'material-ui/svg-icons/av/videocam-off';
|
||||||
|
|
@ -141,15 +142,15 @@ export default class LocalVideo extends React.Component
|
||||||
|
|
||||||
LocalVideo.propTypes =
|
LocalVideo.propTypes =
|
||||||
{
|
{
|
||||||
peerId : React.PropTypes.string.isRequired,
|
peerId : PropTypes.string.isRequired,
|
||||||
stream : React.PropTypes.object,
|
stream : PropTypes.object,
|
||||||
resolution : React.PropTypes.string,
|
resolution : PropTypes.string,
|
||||||
multipleWebcams : React.PropTypes.bool.isRequired,
|
multipleWebcams : PropTypes.bool.isRequired,
|
||||||
webcamType : React.PropTypes.string,
|
webcamType : PropTypes.string,
|
||||||
connectionState : React.PropTypes.string,
|
connectionState : PropTypes.string,
|
||||||
isActiveSpeaker : React.PropTypes.bool.isRequired,
|
isActiveSpeaker : PropTypes.bool.isRequired,
|
||||||
onMicMute : React.PropTypes.func.isRequired,
|
onMicMute : PropTypes.func.isRequired,
|
||||||
onWebcamToggle : React.PropTypes.func.isRequired,
|
onWebcamToggle : PropTypes.func.isRequired,
|
||||||
onWebcamChange : React.PropTypes.func.isRequired,
|
onWebcamChange : PropTypes.func.isRequired,
|
||||||
onResolutionChange : React.PropTypes.func.isRequired
|
onResolutionChange : PropTypes.func.isRequired
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
import IconButton from 'material-ui/IconButton/IconButton';
|
import IconButton from 'material-ui/IconButton/IconButton';
|
||||||
import VolumeOffIcon from 'material-ui/svg-icons/av/volume-off';
|
import VolumeOffIcon from 'material-ui/svg-icons/av/volume-off';
|
||||||
import VideoOffIcon from 'material-ui/svg-icons/av/videocam-off';
|
import VideoOffIcon from 'material-ui/svg-icons/av/videocam-off';
|
||||||
|
|
@ -128,10 +129,10 @@ export default class RemoteVideo extends React.Component
|
||||||
|
|
||||||
RemoteVideo.propTypes =
|
RemoteVideo.propTypes =
|
||||||
{
|
{
|
||||||
peer : React.PropTypes.object.isRequired,
|
peer : PropTypes.object.isRequired,
|
||||||
stream : React.PropTypes.object.isRequired,
|
stream : PropTypes.object.isRequired,
|
||||||
fullsize : React.PropTypes.bool,
|
fullsize : PropTypes.bool,
|
||||||
isActiveSpeaker : React.PropTypes.bool.isRequired,
|
isActiveSpeaker : PropTypes.bool.isRequired,
|
||||||
onDisableVideo : React.PropTypes.func.isRequired,
|
onDisableVideo : PropTypes.func.isRequired,
|
||||||
onEnableVideo : React.PropTypes.func.isRequired
|
onEnableVideo : PropTypes.func.isRequired
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
import ClipboardButton from 'react-clipboard.js';
|
import ClipboardButton from 'react-clipboard.js';
|
||||||
import browser from 'bowser';
|
import browser from 'bowser';
|
||||||
import TransitionAppear from './TransitionAppear';
|
import TransitionAppear from './TransitionAppear';
|
||||||
|
|
@ -496,8 +497,8 @@ export default class Room extends React.Component
|
||||||
|
|
||||||
Room.propTypes =
|
Room.propTypes =
|
||||||
{
|
{
|
||||||
peerId : React.PropTypes.string.isRequired,
|
peerId : PropTypes.string.isRequired,
|
||||||
roomId : React.PropTypes.string.isRequired,
|
roomId : PropTypes.string.isRequired,
|
||||||
onNotify : React.PropTypes.func.isRequired,
|
onNotify : PropTypes.func.isRequired,
|
||||||
onHideNotification : React.PropTypes.func.isRequired
|
onHideNotification : PropTypes.func.isRequired
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
import browser from 'bowser';
|
import browser from 'bowser';
|
||||||
import Logger from '../Logger';
|
import Logger from '../Logger';
|
||||||
|
|
||||||
|
|
@ -492,6 +493,6 @@ export default class Stats extends React.Component
|
||||||
|
|
||||||
Stats.propTypes =
|
Stats.propTypes =
|
||||||
{
|
{
|
||||||
stats : React.PropTypes.object.isRequired,
|
stats : PropTypes.object.isRequired,
|
||||||
onClose : React.PropTypes.func.isRequired
|
onClose : PropTypes.func.isRequired
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ReactCSSTransitionGroup from 'react-addons-css-transition-group';
|
import PropTypes from 'prop-types';
|
||||||
|
import TransitionGroup from 'react-transition-group/TransitionGroup';
|
||||||
|
|
||||||
const DEFAULT_DURATION = 1000;
|
const DEFAULT_DURATION = 1000;
|
||||||
|
|
||||||
|
|
@ -18,7 +19,7 @@ export default class TransitionAppear extends React.Component
|
||||||
let duration = props.hasOwnProperty('duration') ? props.duration : DEFAULT_DURATION;
|
let duration = props.hasOwnProperty('duration') ? props.duration : DEFAULT_DURATION;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ReactCSSTransitionGroup
|
<TransitionGroup
|
||||||
component={FakeTransitionWrapper}
|
component={FakeTransitionWrapper}
|
||||||
transitionName='transition'
|
transitionName='transition'
|
||||||
transitionAppear={!!duration}
|
transitionAppear={!!duration}
|
||||||
|
|
@ -27,15 +28,15 @@ export default class TransitionAppear extends React.Component
|
||||||
transitionLeave={false}
|
transitionLeave={false}
|
||||||
>
|
>
|
||||||
{this.props.children}
|
{this.props.children}
|
||||||
</ReactCSSTransitionGroup>
|
</TransitionGroup>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TransitionAppear.propTypes =
|
TransitionAppear.propTypes =
|
||||||
{
|
{
|
||||||
children : React.PropTypes.any,
|
children : PropTypes.any,
|
||||||
duration : React.PropTypes.number
|
duration : PropTypes.number
|
||||||
};
|
};
|
||||||
|
|
||||||
class FakeTransitionWrapper extends React.Component
|
class FakeTransitionWrapper extends React.Component
|
||||||
|
|
@ -55,5 +56,5 @@ class FakeTransitionWrapper extends React.Component
|
||||||
|
|
||||||
FakeTransitionWrapper.propTypes =
|
FakeTransitionWrapper.propTypes =
|
||||||
{
|
{
|
||||||
children : React.PropTypes.any
|
children : PropTypes.any
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
import Logger from '../Logger';
|
import Logger from '../Logger';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
import hark from 'hark';
|
import hark from 'hark';
|
||||||
|
|
@ -229,10 +230,10 @@ export default class Video extends React.Component
|
||||||
|
|
||||||
Video.propTypes =
|
Video.propTypes =
|
||||||
{
|
{
|
||||||
stream : React.PropTypes.object.isRequired,
|
stream : PropTypes.object.isRequired,
|
||||||
resolution : React.PropTypes.string,
|
resolution : PropTypes.string,
|
||||||
muted : React.PropTypes.bool,
|
muted : PropTypes.bool,
|
||||||
videoDisabled : React.PropTypes.bool,
|
videoDisabled : PropTypes.bool,
|
||||||
mirror : React.PropTypes.bool,
|
mirror : PropTypes.bool,
|
||||||
onResolutionChange : React.PropTypes.func
|
onResolutionChange : PropTypes.func
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue