diff --git a/app/assets/styles/blink/_CallMeMaybeModal.scss b/app/assets/styles/blink/_CallMeMaybeModal.scss index 8dc09a8..429e628 100644 --- a/app/assets/styles/blink/_CallMeMaybeModal.scss +++ b/app/assets/styles/blink/_CallMeMaybeModal.scss @@ -1,21 +1,21 @@ .title { - padding: 5px; + padding: 0px; font-size: 30px; text-align: center; } .body { - padding: 10px; + padding: 5px; font-size: 16px; text-align: center; } .container { - padding: 30px; - margin: 10px; + padding: 10px; + margin: 00px; } .iconContainer { flex-direction: row; justify-content: center; } diff --git a/app/components/CallMeMaybeModal.js b/app/components/CallMeMaybeModal.js index a8a5024..8bf674f 100644 --- a/app/components/CallMeMaybeModal.js +++ b/app/components/CallMeMaybeModal.js @@ -1,112 +1,122 @@ import React, { Component } from 'react'; import { View } from 'react-native'; import PropTypes from 'prop-types'; import { Dialog, Title, Surface, Portal, IconButton, Text } from 'react-native-paper'; import autoBind from 'auto-bind'; import { openComposer } from 'react-native-email-link'; import KeyboardAwareDialog from './KeyBoardAwareDialog'; import Share from 'react-native-share'; const DialogType = Platform.OS === 'ios' ? KeyboardAwareDialog : Dialog; import utils from '../utils'; import styles from '../assets/styles/blink/_CallMeMaybeModal.scss'; class CallMeMaybeModal extends Component { constructor(props) { super(props); autoBind(this); } handleClipboardButton(event) { utils.copyToClipboard(this.props.callUrl); this.props.notificationCenter().postSystemNotification('Call me', {body: 'Web address copied to the clipboard', timeout: 2}); this.props.close(); } handleEmailButton(event) { const sipUri = this.props.callUrl.split('/').slice(-1)[0]; // hack! const emailMessage = `You can call me using a Web browser at ${this.props.callUrl} or a SIP client at ${sipUri} ` + 'or by using the freely available Sylk client app from http://sylkserver.com'; const subject = 'Call me, maybe?'; openComposer({ subject, body: emailMessage }) // Linking.canOpenURL(this.emailLink) // .then((supported) => { // if (!supported) { // } else { // return Linking.openURL(url); // } // }) // .catch((err) => { // this.props.notificationCenter().postSystemNotification('Call me', {body: 'Unable to open email app'}); // }); this.props.close(); } handleShareButton(event) { const sipUri = this.props.callUrl.split('/').slice(-1)[0]; // hack! let options= { subject: 'Call me, maybe?', message: `You can call me using a Web browser at ${this.props.callUrl} or a SIP client at ${sipUri} or by using the freely available Sylk WebRTC client app at http://sylkserver.com` } Share.open(options) .then((res) => { this.props.close(); }) .catch((err) => { this.props.close(); }); } render() { + const sipUri = this.props.callUrl.split('/').slice(-1)[0]; return ( Call me, maybe? - Share {this.props.callUrl} with others so they can call you + Others can call you using a SIP client at {sipUri} + + + Or by using a Web browser at + + + {this.props.callUrl} + + + Share these addresses with others ); } } CallMeMaybeModal.propTypes = { show : PropTypes.bool.isRequired, close : PropTypes.func.isRequired, callUrl : PropTypes.string.isRequired, notificationCenter : PropTypes.func.isRequired }; export default CallMeMaybeModal;