diff --git a/app/assets/styles/blink/_EditContactModal.scss b/app/assets/styles/blink/_EditContactModal.scss index d572827..dd4464a 100644 --- a/app/assets/styles/blink/_EditContactModal.scss +++ b/app/assets/styles/blink/_EditContactModal.scss @@ -1,56 +1,62 @@ .container { padding: 10px; margin: 00px; } .title { padding: 0px; font-size: 24px; text-align: center; } .pgp { font-size: 12px; } .lock { margin-top: 3px; margin-right: 3px; } .subtitle { padding: 0px; font-size: 18px; text-align: center; } .emailStatus { margin-left: 12px; font-size: 12px; color: blue; padding-bottom: 10px; } .key { font-size: 6px; text-align: center; margin-bottom: 20px; } .body { padding-top: 0px; font-size: 18px; text-align: center; } .button { margin: 10px; } .buttonRow { flex-direction: row; justify-content: center; padding-bottom: 20px; } +.link { + padding: 10px; + font-size: 12px; + text-align: center; + color: blue; +} diff --git a/app/components/EditContactModal.js b/app/components/EditContactModal.js index e15e434..753ec3b 100644 --- a/app/components/EditContactModal.js +++ b/app/components/EditContactModal.js @@ -1,249 +1,258 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import autoBind from 'auto-bind'; +import { Linking } from 'react-native'; import { View } from 'react-native'; import { Chip, Dialog, Portal, Text, Button, Surface, TextInput, Paragraph, Subheading } from 'react-native-paper'; import KeyboardAwareDialog from './KeyBoardAwareDialog'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; const DialogType = Platform.OS === 'ios' ? KeyboardAwareDialog : Dialog; import styles from '../assets/styles/blink/_EditContactModal.scss'; import utils from '../utils'; +function handleUpdate() { + Linking.openURL('http://delete.sylk.link'); +} + + class EditContactModal extends Component { constructor(props) { super(props); autoBind(this); this.state = { displayName: this.props.displayName, organization: this.props.organization, show: this.props.show, email: this.props.email, myself: this.props.myself, uri: this.props.uri, confirm: false } } UNSAFE_componentWillReceiveProps(nextProps) { this.setState({show: nextProps.show, displayName: nextProps.displayName, email: nextProps.email, uri: nextProps.uri, myself: nextProps.myself, organization: nextProps.organization }); } saveContact(event) { event.preventDefault(); this.props.saveContact(this.state.displayName, this.state.organization, this.state.email); this.setState({confirm: false}); this.props.close(); } deleteContact(event) { event.preventDefault(); if (!this.state.confirm) { this.setState({confirm: true}); return; } this.setState({confirm: false}); this.props.deleteContact(this.state.uri); this.props.close(); } validEmail() { if (!this.state.email) { return true; } let check = utils.isEmailAddress(this.state.email); return check } deletePublicKey(event) { event.preventDefault(); if (!this.state.confirm) { this.setState({confirm: true}); return; } this.setState({confirm: false}); this.props.deletePublicKey(this.state.uri); this.props.close(); } handleClipboardButton(event) { event.preventDefault(); console.log('Key copied to clipboard') utils.copyToClipboard(this.props.publicKey); this.props.close(); } onInputChange(value) { this.setState({displayName: value}); } onOrganizationChange(value) { this.setState({organization: value}); } onEmailChange(value) { this.setState({email: value}); } render() { if (this.props.publicKey) { let title = this.props.displayName || this.props.uri return ( {title} PGP Public Key {this.props.publicKey} ); } return ( {this.props.uri} { !this.state.myself ? : } { this.state.myself ? Used to recover a lost password : null} { !this.state.myself ? : null} + + + handleUpdate()} style={styles.link}>Delete acount on server... {true ? Messages are encrypted end-to-end : null} {true ? My device id: {this.props.myuuid} : null} ); } } EditContactModal.propTypes = { show : PropTypes.bool.isRequired, close : PropTypes.func.isRequired, uri : PropTypes.string, displayName : PropTypes.string, email : PropTypes.string, organization : PropTypes.string, publicKey : PropTypes.string, myself : PropTypes.bool, saveContact : PropTypes.func, deleteContact : PropTypes.func, deletePublicKey : PropTypes.func, myuuid : PropTypes.string }; export default EditContactModal;