fix(presence-label):styles

This commit is contained in:
hristoterezov 2018-07-09 17:18:09 -05:00 committed by Hristo Terezov
parent 00d1edcdef
commit 9331b0870b
5 changed files with 21 additions and 22 deletions

View File

@ -627,7 +627,6 @@
padding-left: 10px; padding-left: 10px;
padding-right: 10px; padding-right: 10px;
} }
#remotePresenceMessage .no-presence,
#remoteConnectionMessage { #remoteConnectionMessage {
display: none; display: none;
} }

View File

@ -429,11 +429,8 @@ export default class LargeVideoManager {
<Provider store = { APP.store }> <Provider store = { APP.store }>
<I18nextProvider i18n = { i18next }> <I18nextProvider i18n = { i18next }>
<PresenceLabel <PresenceLabel
noContentStyles = { {
className: 'presence-label no-presence'
} }
participantID = { id } participantID = { id }
styles = { { className: 'presence-label' } } /> className = 'presence-label' />
</I18nextProvider> </I18nextProvider>
</Provider>, </Provider>,
presenceLabelContainer.get(0)); presenceLabelContainer.get(0));

View File

@ -574,11 +574,8 @@ RemoteVideo.prototype.addPresenceLabel = function() {
<Provider store = { APP.store }> <Provider store = { APP.store }>
<I18nextProvider i18n = { i18next }> <I18nextProvider i18n = { i18next }>
<PresenceLabel <PresenceLabel
noContentStyles = { {
className: 'presence-label no-presence'
} }
participantID = { this.id } participantID = { this.id }
styles = { { className: 'presence-label' } } /> className = 'presence-label' />
</I18nextProvider> </I18nextProvider>
</Provider>, </Provider>,
presenceLabelContainer); presenceLabelContainer);

View File

@ -64,7 +64,7 @@ class CalleeInfo extends Component<Props> {
<Container { ...this._style('ringing__status') }> <Container { ...this._style('ringing__status') }>
<PresenceLabel <PresenceLabel
defaultPresence = { status } defaultPresence = { status }
styles = { this._style('ringing__text') } /> { ...this._style('ringing__text') } />
</Container> </Container>
<Container { ...this._style('ringing__name') }> <Container { ...this._style('ringing__name') }>
<Text <Text

View File

@ -36,17 +36,17 @@ class PresenceLabel extends Component {
*/ */
_presence: PropTypes.string, _presence: PropTypes.string,
/**
* Class name for the presence label.
*/
className: PropTypes.string,
/** /**
* Default presence status that will be displayed if user's presence * Default presence status that will be displayed if user's presence
* status is not available. * status is not available.
*/ */
defaultPresence: PropTypes.string, defaultPresence: PropTypes.string,
/**
* Styles for the case where there isn't any content to be shown.
*/
noContentStyles: PropTypes.object,
/** /**
* The ID of the participant whose presence status shoul display. * The ID of the participant whose presence status shoul display.
*/ */
@ -55,7 +55,7 @@ class PresenceLabel extends Component {
/** /**
* Styles for the presence label. * Styles for the presence label.
*/ */
styles: PropTypes.object, style: PropTypes.object,
/** /**
* Invoked to obtain translated strings. * Invoked to obtain translated strings.
@ -70,14 +70,20 @@ class PresenceLabel extends Component {
* @returns {ReactElement} * @returns {ReactElement}
*/ */
render() { render() {
const { _presence, styles, noContentStyles } = this.props; const text = this._getPresenceText();
const combinedStyles = _presence ? styles : noContentStyles;
if (text === null) {
return null;
}
const { style, className } = this.props;
return ( return (
<Text { ...combinedStyles }> <Text
{ this._getPresenceText() } className = { className }
</Text> { ...style }>
); { text }
</Text>);
} }
/** /**