Skip to content

Commit

Permalink
improve modal, hang up confirmation
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-gavrilescu committed Aug 5, 2024
1 parent 6562d9a commit 151eb9c
Show file tree
Hide file tree
Showing 6 changed files with 115 additions and 4 deletions.
31 changes: 31 additions & 0 deletions spot-client/src/common/css/_hangup-modal.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
.hangup-modal-select {
@include centered-content;
flex-direction: column;
justify-content: center;
min-width: 360px;
text-align: center;
width: 100%;

.content {
display: flex;
flex-direction: column;
justify-content: center;
}

.footer {
align-items: center;
display: flex;
padding: 24px;
justify-content: center;
width: 100%;
}

.hangup-button {
display: block;
font-size: 19px;
}

.description {
font-size: 19px;
}
}
6 changes: 4 additions & 2 deletions spot-client/src/common/css/_modal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
height: 100%;
justify-content: center;
left: 0;
pointer-events: none;
position: fixed;
top: 0;
width: 100%;
backdrop-filter: blur(2px);

.modal-shroud {
height: 100%;
Expand All @@ -24,7 +24,9 @@
overflow: auto;
pointer-events: all;
position: relative;

border: 1px solid rgb(61, 61, 61);
box-shadow: rgba(20, 20, 20, 0.6) 0px 4px 25px 4px;
border-radius: 6px;

@media #{$mqw-tablet} {
background-color: var(--container-bg-color);
Expand Down
1 change: 1 addition & 0 deletions spot-client/src/common/css/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
@import './desktop-picker.scss';
@import './dial-pad.scss';
@import './electron.scss';
@import './hangup-modal';
@import './help-view.scss';
@import './home-view.scss';
@import './idle-cursor.scss';
Expand Down
4 changes: 4 additions & 0 deletions spot-client/src/common/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@
"rate": "Rate your experience",
"thanks": "Thanks for using {{ productName }}!"
},
"hangup": {
"confirmation" : "Are you sure you want to hang up?",
"button": "Hang up"
},
"help": {
"howToConnect": "Open {{ url }} in a desktop Google Chrome browser in the conference room to set it up and obtain a share key. Next enter the {{ codeLength }}-character share key in this app.",
"isRemote": "This app is a remote controller for a conference room."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { hangUp } from 'common/app-state';
import { showModal } from 'common/app-state';
import { CallEnd } from 'common/icons';
import PropTypes from 'prop-types';
import React from 'react';
import { connect } from 'react-redux';


import { NavButton } from './../../nav';
import HangupModal from './HangupModal';

/**
* A component for leaving a meeting in progress.
Expand Down Expand Up @@ -39,7 +40,7 @@ HangupButton.propTypes = {
function mapDispatchToProps(dispatch) {
return {
onHangup() {
dispatch(hangUp());
dispatch(showModal(HangupModal));
}
};
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import { hideModal, hangUp } from 'common/app-state';

Check failure on line 1 in spot-client/src/spot-remote/ui/components/meeting-toolbar/buttons/HangupModal.js

View workflow job for this annotation

GitHub Actions / Unit-tests

Member 'hangUp' of the import declaration should be sorted alphabetically
import { Button, Modal } from 'common/ui';

Check failure on line 2 in spot-client/src/spot-remote/ui/components/meeting-toolbar/buttons/HangupModal.js

View workflow job for this annotation

GitHub Actions / Unit-tests

There should be no empty line within import group

import PropTypes from 'prop-types';
import React from 'react';
import { withTranslation } from 'react-i18next';
import { connect } from 'react-redux';

/**
* Implements a modal to adjust the volume of the spot tv remotely.
*/
export class HangupModal extends React.Component {
static propTypes = {
onClose: PropTypes.func,
t: PropTypes.func
};

/**
* Implements React's {@link Component#render()}.
*
* @inheritdoc
* @returns {ReactElement}
*/
render() {
const { t } = this.props;

return (
<Modal
onClose = { this.props.onClose }
qaId = 'hangup-modal'>
<div className = 'hangup-modal-select'>
<div className = 'content'>
<div className = 'description'>
{ t('hangup.confirmation') }
</div>
</div>
<div className = 'footer'>
<Button
appearance = 'primary'
className = 'hangup-button'
color='secondary'

Check failure on line 41 in spot-client/src/spot-remote/ui/components/meeting-toolbar/buttons/HangupModal.js

View workflow job for this annotation

GitHub Actions / Unit-tests

A space is required before '='

Check failure on line 41 in spot-client/src/spot-remote/ui/components/meeting-toolbar/buttons/HangupModal.js

View workflow job for this annotation

GitHub Actions / Unit-tests

A space is required after '='
onClick = { this.props.onHangup }

Check failure on line 42 in spot-client/src/spot-remote/ui/components/meeting-toolbar/buttons/HangupModal.js

View workflow job for this annotation

GitHub Actions / Unit-tests

'onHangup' is missing in props validation
qaId = 'hangup-button'>
{ t('hangup.button') }

Check failure on line 44 in spot-client/src/spot-remote/ui/components/meeting-toolbar/buttons/HangupModal.js

View workflow job for this annotation

GitHub Actions / Unit-tests

Expected indentation of 28 spaces but found 31

Check failure on line 44 in spot-client/src/spot-remote/ui/components/meeting-toolbar/buttons/HangupModal.js

View workflow job for this annotation

GitHub Actions / Unit-tests

Expected indentation of 28 space characters but found 31
</Button>
</div>

Check failure on line 46 in spot-client/src/spot-remote/ui/components/meeting-toolbar/buttons/HangupModal.js

View workflow job for this annotation

GitHub Actions / Unit-tests

Trailing spaces not allowed
</div>
</Modal>
);
}
}

/**
* Creates actions which can update Redux state.
*
* @param {Function} dispatch - The Redux dispatch function to update state.
* @private
* @returns {Object}
*/
function mapDispatchToProps(dispatch) {
return {
onClose() {
dispatch(hideModal());
},
onHangup() {
dispatch(hangUp());
dispatch(hideModal());
}
};
}

export default connect(null, mapDispatchToProps)(withTranslation()(HangupModal));

Check failure on line 72 in spot-client/src/spot-remote/ui/components/meeting-toolbar/buttons/HangupModal.js

View workflow job for this annotation

GitHub Actions / Unit-tests

Newline required at end of file but not found

0 comments on commit 151eb9c

Please sign in to comment.