FeaturesItem.tsx 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. import React, { FC } from "react";
  2. import styled from "styled-components";
  3. import { Flex } from "reflexbox/styled-components";
  4. import { fadeIn } from "../helpers/animations";
  5. import Icon from "./Icon";
  6. import { Icons } from "./Icon/Icon";
  7. interface Props {
  8. title: string;
  9. icon: Icons;
  10. }
  11. const Block = styled(Flex).attrs({
  12. maxWidth: ["100%", "100%", "50%", "25%"],
  13. flexDirection: "column",
  14. alignItems: "center",
  15. p: "0 24px",
  16. mb: [48, 48, 48, 0]
  17. })`
  18. animation: ${fadeIn} 0.8s ease-out;
  19. :last-child {
  20. margin-right: 0;
  21. }
  22. `;
  23. const IconBox = styled(Flex).attrs({
  24. width: [40, 40, 48],
  25. height: [40, 40, 48],
  26. alignItems: "center",
  27. justifyContent: "center"
  28. })`
  29. border-radius: 100%;
  30. box-sizing: border-box;
  31. background-color: #2196f3;
  32. `;
  33. const Title = styled.h3`
  34. margin: 16px;
  35. font-size: 15px;
  36. @media only screen and (max-width: 448px) {
  37. margin: 12px;
  38. font-size: 14px;
  39. }
  40. `;
  41. const Description = styled.p`
  42. margin: 0;
  43. font-size: 14px;
  44. font-weight: 300;
  45. text-align: center;
  46. @media only screen and (max-width: 448px) {
  47. font-size: 13px;
  48. }
  49. `;
  50. const FeaturesItem: FC<Props> = ({ children, icon, title }) => (
  51. <Block>
  52. <IconBox>
  53. <Icon name={icon} stroke="white" strokeWidth="2" />
  54. </IconBox>
  55. <Title>{title}</Title>
  56. <Description>{children}</Description>
  57. </Block>
  58. );
  59. export default FeaturesItem;