All files / nav-sidebar/components FeedbackLink.jsx

100% Statements 5/5
100% Branches 0/0
100% Functions 1/1
100% Lines 5/5
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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44                      1x                       1x         1x 2x               1x            
import React from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
import { curiousBlue } from '@bufferapp/components/style/color';
 
import {
  Text,
  Link,
  MessageIcon,
} from '@bufferapp/components';
 
const InnerLink = styled.span`
  display: flex;
  align-items: flex-start;
  padding: 0.5rem;
  margin: 0 0.5rem;
  border-radius: 4px;
 
  &:hover > span {
    color: ${curiousBlue} !important;
  }
`;
 
const TextWrapper = styled.span`
  margin-left: .5rem;
  display: inline-flex;
`;
 
const FeedbackLink = ({ children, email }) => (
  <Link unstyled href={`mailto:${email}?subject=Analyze feedback`}>
    <InnerLink>
      <MessageIcon />
      <TextWrapper><Text size="small" color="shuttleGray">{children}</Text></TextWrapper>
    </InnerLink>
  </Link>
);
 
FeedbackLink.propTypes = {
  children: PropTypes.node.isRequired,
  email: PropTypes.node.isRequired,
};
 
export default FeedbackLink;