Skip to content

Commit

Permalink
feat(ui) move room info from tv to remote
Browse files Browse the repository at this point in the history
  • Loading branch information
mihhu committed Aug 29, 2023
1 parent cf77004 commit 1f8b4f5
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 54 deletions.
15 changes: 14 additions & 1 deletion spot-client/src/common/app-state/spot-tv/selectors.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { getDisplayName } from 'common/app-state';

/**
* A selector which returns the current view that is being displayed on Spot-TV.
*
Expand Down Expand Up @@ -66,12 +68,23 @@ export function getRemoteJoinCode(state) {
* to be displayed while in a meeting.
*
* @param {Object} state - The Redux state.
* @returns {boolean}
* @returns {string|undefined}
*/
export function getRemoteSpotTVRoomName(state) {
return state.spotTv.roomName;
}

/**
* A selector which returns either the remotely or the locally configured name to use for the Spot-TV
* to be displayed while in a meeting.
*
* @param {Object} state - The Redux state.
* @returns {string|undefined}
*/
export function getSpotRoomName(state) {
return getRemoteSpotTVRoomName(state) || getDisplayName(state);
}

/**
* Returns a tenant name advertised by Spot TV.
*
Expand Down
4 changes: 0 additions & 4 deletions spot-client/src/common/css/_home-view.scss
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@
}
}

~ .info-footer {
display: none;
}

.spot-home-footer {
text-align: center;

Expand Down
19 changes: 0 additions & 19 deletions spot-client/src/common/css/_temp.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,6 @@
margin-bottom: 5px;
}

.info-footer {
background: rgba(0, 0, 0, 0.3);
bottom: 0;
display: flex;
font-size: 1rem;
justify-content: flex-end;
padding: 10px;
position: fixed;
white-space: pre;
width: 100%;
z-index: $z-index-foreground;

pointer-events: none;

.join-info {
pointer-events: all;
}
}

.meeting-frame {
/**
* The background color matching jitsi-meet is used to intentionally hide
Expand Down
6 changes: 6 additions & 0 deletions spot-client/src/common/css/page-layouts/_in-call-view.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,17 @@

.in-call-name,
.in-call-invited-phone {
word-wrap: break-word;
font-size: $font-size-medium-plus;
margin-top: 100px;
text-align: center;
}

.in-call-meeting-url {
margin-top: 5px;
word-wrap: break-word;
}

.in-call-name-with-phone {
font-size: $font-size-medium;
text-align: center;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,3 @@
text-shadow: 0px 4px rgba(0, 0, 0, 0.4);
}
}

.setup ~ .info-footer {
display: none;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,4 @@
font-size: $font-size-medium-plus;
padding: 32px 16px;
text-align: center;

~ .info-footer {
display: none;
}
}
8 changes: 2 additions & 6 deletions spot-client/src/common/ui/components/room-name/room-name.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import {
getDisplayName,
getRemoteSpotTVRoomName
} from 'common/app-state';
import { getSpotRoomName } from 'common/app-state';
import PropTypes from 'prop-types';
import React from 'react';
import { connect } from 'react-redux';


/**
* Displays the currently configured Spot-Room name.
*/
Expand Down Expand Up @@ -40,7 +36,7 @@ export class RoomName extends React.Component {
*/
function mapStateToProps(state) {
return {
roomName: getRemoteSpotTVRoomName(state) || getDisplayName(state)
roomName: getSpotRoomName(state)
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ export default class MeetingHeader extends React.Component {
static propTypes = {
invitedPhoneNumber: PropTypes.string,
meetingDisplayName: PropTypes.string,
meetingUrl: PropTypes.string
meetingUrl: PropTypes.string,
spotRoomName: PropTypes.string
};

/**
Expand All @@ -24,7 +25,8 @@ export default class MeetingHeader extends React.Component {
const {
invitedPhoneNumber,
meetingDisplayName,
meetingUrl
meetingUrl,
spotRoomName
} = this.props;
const { host, meetingName, path } = parseMeetingUrl(meetingUrl);

Expand All @@ -36,6 +38,7 @@ export default class MeetingHeader extends React.Component {
{ meetingDisplayName || meetingName }
</div>
<div className = 'in-call-meeting-url' >
{ spotRoomName && `${spotRoomName} | ` }
{ `${host}${path}/${meetingName}` }
</div>
</div>
Expand Down
11 changes: 8 additions & 3 deletions spot-client/src/spot-remote/ui/views/remote-views/in-call.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
getInMeetingStatus,
getInvitedPhoneNumber,
getMeetingCancelTimeout,
getSpotRoomName,
hangUp,
hideModal
} from 'common/app-state';
Expand Down Expand Up @@ -43,6 +44,7 @@ export class InCall extends React.Component {
onShowScreenshareModal: PropTypes.func,
onSubmitPassword: PropTypes.func,
showPasswordPrompt: PropTypes.bool,
spotRoomName: PropTypes.string,
t: PropTypes.func
};

Expand Down Expand Up @@ -115,7 +117,8 @@ export class InCall extends React.Component {
invitedPhoneNumber,
kicked,
meetingDisplayName,
showPasswordPrompt
showPasswordPrompt,
spotRoomName
} = this.props;

if (kicked) {
Expand Down Expand Up @@ -153,7 +156,8 @@ export class InCall extends React.Component {
<MeetingHeader
invitedPhoneNumber = { invitedPhoneNumber }
meetingDisplayName = { meetingDisplayName }
meetingUrl = { inMeeting } />
meetingUrl = { inMeeting }
spotRoomName = { spotRoomName } />
<MeetingToolbar meetingUrl = { inMeeting } />
</div>
);
Expand Down Expand Up @@ -181,7 +185,8 @@ function mapStateToProps(state) {
kicked,
meetingCancelTimeout: getMeetingCancelTimeout(state),
meetingDisplayName,
showPasswordPrompt: needPassword
showPasswordPrompt: needPassword,
spotRoomName: getSpotRoomName(state)
};
}

Expand Down
10 changes: 7 additions & 3 deletions spot-client/src/spot-remote/ui/views/share/stop-share.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getInMeetingStatus, getInvitedPhoneNumber } from 'common/app-state';
import { getInMeetingStatus, getInvitedPhoneNumber, getSpotRoomName } from 'common/app-state';
import { ScreenShare } from 'common/icons';
import { Button, LoadingIcon } from 'common/ui';
import PropTypes from 'prop-types';
Expand All @@ -19,6 +19,7 @@ export class StopShare extends React.Component {
invitedPhoneNumber: PropTypes.string,
meetingDisplayName: PropTypes.string,
onStopScreenshare: PropTypes.func,
spotRoomName: PropTypes.string,
t: PropTypes.func
};

Expand All @@ -34,6 +35,7 @@ export class StopShare extends React.Component {
inMeeting,
invitedPhoneNumber,
onStopScreenshare,
spotRoomName,
t
} = this.props;

Expand All @@ -48,7 +50,8 @@ export class StopShare extends React.Component {
<MeetingHeader
invitedPhoneNumber = { invitedPhoneNumber }
meetingDisplayName = { meetingDisplayName }
meetingUrl = { inMeeting } />
meetingUrl = { inMeeting }
spotRoomName = { spotRoomName } />
<div className = 'stop-share-title'>
{ t('screenshare.isSharingScreen') }
</div>
Expand Down Expand Up @@ -82,7 +85,8 @@ function mapStateToProps(state) {
return {
inMeeting,
invitedPhoneNumber: formatPhoneNumber(getInvitedPhoneNumber(state)),
meetingDisplayName
meetingDisplayName,
spotRoomName: getSpotRoomName(state)
};
}

Expand Down
9 changes: 1 addition & 8 deletions spot-client/src/spot-tv/ui/views/spot-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ import PropTypes from 'prop-types';
import React from 'react';
import { connect } from 'react-redux';


import { JoinInfo } from './../components';

/**
* A React Component representing a single screen in Spot-TV. Wraps {@code View}
* to include notifying this component's parent of the current displayed view.
Expand Down Expand Up @@ -47,7 +44,7 @@ class SpotView extends React.Component {
* @inheritdoc
*/
render() {
const { children, remoteControlServer, spotRoomName } = this.props;
const { children, remoteControlServer } = this.props;
const childComponents = React.Children.map(children, child =>
React.cloneElement(
child,
Expand All @@ -57,10 +54,6 @@ class SpotView extends React.Component {
return (
<View { ...this.props }>
{ childComponents }
<div className = 'info-footer'>
{ spotRoomName && `${spotRoomName} | ` }
<JoinInfo showDomain = { true } />
</div>
</View>
);
}
Expand Down

0 comments on commit 1f8b4f5

Please sign in to comment.