All files / src/components Email.js

100% Statements 2/2
100% Branches 0/0
100% Functions 1/1
100% Lines 2/2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27                        1x             3x              
/**
 * @copyright   2016, Miles Johnson
 * @license     https://opensource.org/licenses/MIT
 * @flow
 */
 
import React, { PropTypes } from 'react';
import Link from './Link';
 
import type { EmailProps } from '../types';
 
export default function Email({ children, ...props }: EmailProps) {
  return (
    <Link {...props} href={`mailto:${children}`}>
      {children}
    </Link>
  );
}
 
Email.propTypes = {
  children: PropTypes.string.isRequired,
  emailParts: PropTypes.shape({
    username: PropTypes.string,
    host: PropTypes.string,
  }),
};