card.jsx 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import React from 'react'
  2. function TwitterLink ({ url }) {
  3. if (!url) {
  4. return null
  5. }
  6. return (
  7. <a href={ url } className="twitterProfile">
  8. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 273.5 222.3" className="octicon"><path d="M273.5 26.3a109.77 109.77 0 0 1-32.2 8.8 56.07 56.07 0 0 0 24.7-31 113.39 113.39 0 0 1-35.7 13.6 56.1 56.1 0 0 0-97 38.4 54 54 0 0 0 1.5 12.8A159.68 159.68 0 0 1 19.1 10.3a56.12 56.12 0 0 0 17.4 74.9 56.06 56.06 0 0 1-25.4-7v.7a56.11 56.11 0 0 0 45 55 55.65 55.65 0 0 1-14.8 2 62.39 62.39 0 0 1-10.6-1 56.24 56.24 0 0 0 52.4 39 112.87 112.87 0 0 1-69.7 24 119 119 0 0 1-13.4-.8 158.83 158.83 0 0 0 86 25.2c103.2 0 159.6-85.5 159.6-159.6 0-2.4-.1-4.9-.2-7.3a114.25 114.25 0 0 0 28.1-29.1" fill="currentColor"></path></svg>
  9. </a>
  10. )
  11. }
  12. function GitHubLink ({ url }) {
  13. if (!url) {
  14. return null
  15. }
  16. return (
  17. <a href={url}
  18. className="githubProfile"
  19. target="_blank"
  20. rel="noopener noreferrer"
  21. aria-label="GitHub profile"
  22. >
  23. </a>
  24. )
  25. }
  26. export default function Card ({
  27. name,
  28. avatar,
  29. github,
  30. twitter,
  31. children
  32. }) {
  33. return (
  34. <div className="avatar teamProfile">
  35. <img
  36. className="avatar__photo avatar__photo--lg"
  37. src={ avatar }
  38. />
  39. <div className="avatar__intro">
  40. <h4 className="avatar__name">
  41. { name }
  42. <GitHubLink url={github && `https://github.com/${github}`} />
  43. <TwitterLink url={twitter && `https://twitter.com/${twitter}`} />
  44. </h4>
  45. <small className="avatar__subtitle">{ children }</small>
  46. </div>
  47. </div>
  48. )
  49. }