diff --git a/app/assets/styles/blink/_ReadyBox.scss b/app/assets/styles/blink/_ReadyBox.scss index f913d2c..a77c0ef 100644 --- a/app/assets/styles/blink/_ReadyBox.scss +++ b/app/assets/styles/blink/_ReadyBox.scss @@ -1,94 +1,95 @@ @import './variables'; .wholeContainer { flex: 1; flex-direction: column; justify-content: center; } .container { margin: 0 auto; width: 90%; padding-top: 20px; } .landscapeTitle { color: white; font-size: 20px; height: 0%; } .portraitTitle { color: white; font-size: 20px; } .footer { flex: 1; justify-content: flex-end; padding-bottom: 15px; } .button { background-color: rgba(#6DAA63, .9); margin: 10px; padding-top: 2px; padding-left: 1px; } .iosButton { background-color: rgba(#6DAA63, .9); margin: 10px; padding-top: 4px; padding-left: 1px; } .androidButton { background-color: rgba(#6DAA63, .9); margin: 10px; padding-top: 1px; padding-left: 1px; } .conferenceButton { background-color: rgba(#4572a6, 1); margin: 10px; } .landscapeUriButtonGroup { flex-direction: row; + justify-content: space-between; } .portraitUriButtonGroup { flex-direction: column; } .buttonGroup { flex-direction: row; padding-top: 10px; justify-content: center; } .uriInputBox { align: left; padding-top: 10px; width: 100%; } .landscapeUriInputBox { align: left; padding-top: 10px; - width: 70%; + width: 350px; } .portraitUriInputBox { align: left; padding-top: 10px; width: 100%; } .history { - flex: 9; width: 100%; + flex: 9; } diff --git a/app/assets/styles/blink/_RegisterBox.scss b/app/assets/styles/blink/_RegisterBox.scss index 2064cc9..6ecf2f5 100644 --- a/app/assets/styles/blink/_RegisterBox.scss +++ b/app/assets/styles/blink/_RegisterBox.scss @@ -1,7 +1,9 @@ .registerBox { - padding: 30px; + flex: 1; + padding: 50px; + width: 100%; } .title { color: white; } diff --git a/app/assets/styles/blink/_RegisterForm.scss b/app/assets/styles/blink/_RegisterForm.scss index 4f03a82..6f58e38 100644 --- a/app/assets/styles/blink/_RegisterForm.scss +++ b/app/assets/styles/blink/_RegisterForm.scss @@ -1,22 +1,30 @@ +.container { + flex: 1; + flex-direction: column; + margin: 0 auto; +} + .title { margin: 0 auto; color: white; margin-bottom: 10px; font-size: 18px; } .row { padding: 0px 0; + width: 300; } .button { margin-top: 30px; - margin-left: 60px; - margin-right: 60px; border-radius: 20px; + width: 200; + margin: 0 auto; + margin-top: 30px; } .input { border-radius: 0px; } diff --git a/app/components/ReadyBox.js b/app/components/ReadyBox.js index e2aba99..7f6eef3 100644 --- a/app/components/ReadyBox.js +++ b/app/components/ReadyBox.js @@ -1,193 +1,201 @@ import React, { Component, Fragment } from 'react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; // import VizSensor = require('react-visibility-sensor').default; import autoBind from 'auto-bind'; import { View, Platform} from 'react-native'; import { IconButton, Title } from 'react-native-paper'; import ConferenceModal from './ConferenceModal'; import HistoryCard from './HistoryCard'; import HistoryTileBox from './HistoryTileBox'; import FooterBox from './FooterBox'; import URIInput from './URIInput'; import config from '../config'; import utils from '../utils'; import styles from '../assets/styles/blink/_ReadyBox.scss'; class ReadyBox extends Component { constructor(props) { super(props); autoBind(this); this.state = { targetUri: this.props.missedTargetUri, showConferenceModal: false, sticky: false, }; } getTargetUri() { const defaultDomain = this.props.account.id.substring(this.props.account.id.indexOf('@') + 1); return utils.normalizeUri(this.state.targetUri, defaultDomain); } handleTargetChange(value) { if (this.state.targetUri) { let currentUri = this.getTargetUri(); if (currentUri.trim() === value.trim()) { this.setState({targetUri: ''}); } else { this.setState({targetUri: value}); } } else { this.setState({targetUri: value}); } + this.forceUpdate(); } handleTargetSelect() { if (this.props.connection === null) { this.props._notificationCenter.postSystemNotification("Server unreachable", {timeout: 2}); return; } // the user pressed enter, start a video call by default if (this.state.targetUri.endsWith(`@${config.defaultConferenceDomain}`)) { this.props.startConference(this.state.targetUri, {conference: true}); } else { this.props.startCall(this.getTargetUri(), {audio: true, video: true}); } } handleAudioCall(event) { if (this.props.connection === null) { this.props._notificationCenter.postSystemNotification("Server unreachable", {timeout: 2}); return; } event.preventDefault(); if (this.state.targetUri.endsWith(`@${config.defaultConferenceDomain}`)) { this.props.startConference(this.state.targetUri, {conference: true}); } else { this.props.startCall(this.getTargetUri(), {audio: true, video: false}); } } handleVideoCall(event) { if (this.props.connection === null) { this.props._notificationCenter.postSystemNotification("Server unreachable", {timeout: 2}); return; } event.preventDefault(); if (this.state.targetUri.endsWith(`@${config.defaultConferenceDomain}`)) { this.props.startConference(this.state.targetUri, {conference: true}); } else { this.props.startCall(this.getTargetUri(), {audio: true, video: true}); } } showConferenceModal(event) { event.preventDefault(); if (this.state.targetUri.length !== 0) { const uri = `${this.state.targetUri.split('@')[0].replace(/[\s()-]/g, '')}@${config.defaultConferenceDomain}`; this.handleConferenceCall(uri.toLowerCase()); } else { this.setState({showConferenceModal: true}); } } handleConferenceCall(targetUri) { if (this.props.connection === null) { this.props._notificationCenter.postSystemNotification("Server unreachable", {timeout: 2}); return; } this.setState({showConferenceModal: false}); if (targetUri) { this.props.startConference(targetUri, {conference: true}); } } render() { const buttonClass = (Platform.OS === 'ios') ? styles.iosButton : styles.androidButton; + const uriGroupClass = this.props.orientation === 'landscape' ? styles.landscapeUriButtonGroup : styles.portraitUriButtonGroup; + const uriClass = this.props.orientation === 'landscape' ? styles.landscapeUriInputBox : styles.portraitUriInputBox; + const titleClass = this.props.orientation === 'landscape' ? styles.landscapeTitle : styles.portraitTitle; // Join URIs from local and server history for input let history = this.props.history.concat( this.props.serverHistory.map(e => e.remoteParty) ); + history = [...new Set(history)]; //console.log('history from server is', this.props.serverHistory); return ( - Enter address or phone number - - - - - - - + Enter address or telephone number + + + + + + + + + {this.props.serverHistory.filter(historyItem => historyItem.remoteParty.startsWith(this.state.targetUri)).map((historyItem, idx) => () )} ); } } ReadyBox.propTypes = { account : PropTypes.object.isRequired, startCall : PropTypes.func.isRequired, startConference : PropTypes.func.isRequired, missedTargetUri : PropTypes.string, history : PropTypes.array, - serverHistory : PropTypes.array + serverHistory : PropTypes.array, + orientation : PropTypes.string }; export default ReadyBox;