createContactLink(props) {
    let link

    // Combine email header parameters for use with email
    const combineHeaders = (params = {}) => {
      return Object.keys(params)
        .map(key => `${key}=${encodeURIComponent(params[key])}`)
        .join('&')
    }

    if (props.email) {
      link = `mailto:${props.email}`

      if (props.headers) {
        link += `?${combineHeaders(props.headers)}`
      }
    } else if (props.tel) {
      link = `tel:${props.tel}`
    } else if (props.sms) {
      link = `sms:${props.sms}`
    } else if (props.facetime) {
      link = `facetime:${props.facetime}`
    } else {
      link = props.children
    }

    return link
  }
// Convert contact information to contact URL scheme
Convert contact information to contact URL scheme
Convert contact information to contact URL scheme
createContactLink(props) {
    let link
    const combineHeaders = (params = {}) => {
      return Object.keys(params)
        .map(key => `${key}=${encodeURIComponent(params[key])}`)
        .join('&')
    }
    if (props.email) {
      link = `mailto:${props.email}`
      if (props.headers) {
        link += `?${combineHeaders(props.headers)}`
      }
    } else if (props.tel) {
      link = `tel:${props.tel}`
    } else if (props.sms) {
      link = `sms:${props.sms}`
    } else if (props.facetime) {
      link = `facetime:${props.facetime}`
    } else {
      link = props.children
    }
    return link
  }
createContactLink ( props ) { let link const combineHeaders = ( params = { } ) => { return Object . keys ( params ) . map ( key => ` ${ key } ${ encodeURIComponent ( params [ key ] ) } ` ) . join ( '&' ) } if ( props . email ) { link = ` ${ props . email } ` if ( props . headers ) { link += ` ${ combineHeaders ( props . headers ) } ` } } else if ( props . tel ) { link = ` ${ props . tel } ` } else if ( props . sms ) { link = ` ${ props . sms } ` } else if ( props . facetime ) { link = ` ${ props . facetime } ` } else { link = props . children } return link }
Convert contact information to contact URL scheme
Convert contact information to contact URL scheme
// Combine email header parameters for use with email