FeaturesItem.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. import React from 'react';
  2. import PropTypes from 'prop-types';
  3. import styled from 'styled-components';
  4. import { fadeIn } from '../../helpers/animations';
  5. const Block = styled.div`
  6. max-width: 25%;
  7. display: flex;
  8. flex-direction: column;
  9. align-items: center;
  10. padding: 0 24px;
  11. animation: ${fadeIn} 0.8s ease-out;
  12. :last-child {
  13. margin-right: 0;
  14. }
  15. @media only screen and (max-width: 1200px) {
  16. margin-bottom: 48px;
  17. }
  18. @media only screen and (max-width: 980px) {
  19. max-width: 50%;
  20. }
  21. @media only screen and (max-width: 760px) {
  22. max-width: 100%;
  23. }
  24. `;
  25. const IconBox = styled.div`
  26. width: 48px;
  27. height: 48px;
  28. display: flex;
  29. align-items: center;
  30. justify-content: center;
  31. border-radius: 100%;
  32. box-sizing: border-box;
  33. background-color: #2196f3;
  34. @media only screen and (max-width: 448px) {
  35. width: 40px;
  36. height: 40px;
  37. }
  38. `;
  39. const Icon = styled.img`
  40. display: inline-block;
  41. width: 16px;
  42. height: 16px;
  43. margin: 0;
  44. padding: 0;
  45. @media only screen and (max-width: 448px) {
  46. width: 14px;
  47. height: 14px;
  48. }
  49. `;
  50. const Title = styled.h3`
  51. margin: 16px;
  52. font-size: 15px;
  53. @media only screen and (max-width: 448px) {
  54. margin: 12px;
  55. font-size: 14px;
  56. }
  57. `;
  58. const Description = styled.p`
  59. margin: 0;
  60. font-size: 14px;
  61. font-weight: 300;
  62. text-align: center;
  63. @media only screen and (max-width: 448px) {
  64. font-size: 13px;
  65. }
  66. `;
  67. const FeaturesItem = ({ children, icon, title }) => (
  68. <Block>
  69. <IconBox>
  70. <Icon src={`/images/${icon}.svg`} />
  71. </IconBox>
  72. <Title>{title}</Title>
  73. <Description>{children}</Description>
  74. </Block>
  75. );
  76. FeaturesItem.propTypes = {
  77. children: PropTypes.node.isRequired,
  78. icon: PropTypes.string.isRequired,
  79. title: PropTypes.string.isRequired,
  80. };
  81. export default FeaturesItem;