AllenYuan

Untitled

May 27th, 2020
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.26 KB | None | 0 0
  1. import React from 'react';
  2. import styled from 'styled-components';
  3. import { connect } from 'react-redux';
  4. import PropTypes from 'prop-types';
  5. import { IconOpenSource, IconStatsBars, IconWand } from '../Icons';
  6. import constants from '../constants';
  7.  
  8. // style for this component
  9. const StyledDiv = styled.div`
  10. margin: 50px auto 0;
  11. text-align: center;
  12. max-width: 1920px;
  13. padding-bottom: 30px;
  14. border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  15.  
  16. & .whyList {
  17. display: flex;
  18. justify-content: space-around;
  19.  
  20. @media only screen and (max-width: 768px) {
  21. flex-direction: column;
  22. }
  23.  
  24. & .whyElement {
  25. max-width: 25%;
  26. box-sizing: border-box;
  27. padding: 0 0.5rem;
  28.  
  29. @media only screen and (max-width: 768px) {
  30. max-width: 100%;
  31. margin-bottom: 30px;
  32. }
  33.  
  34. & svg {
  35. width: 85px;
  36. height: 85px;
  37. fill: ${constants.colorBlue};
  38. }
  39.  
  40. & .headline {
  41. font-size: 24px;
  42. line-height: 2;
  43. }
  44.  
  45. & .description {
  46. font-weight: ${constants.fontWeightLight};
  47. line-height: 1.5;
  48. color: rgb(190, 190, 190);
  49. }
  50. }
  51. }
  52. `;
  53.  
  54. // display the 'why' component
  55. const Why = ({ strings }) => (
  56. <StyledDiv>
  57. <div className="whyList">
  58. <div className="whyElement">
  59. <IconOpenSource />
  60. <div className="headline">
  61. {strings.home_opensource_title}
  62. </div>
  63. <div className="description">
  64. {strings.home_opensource_desc}
  65. </div>
  66. </div>
  67. <div className="whyElement">
  68. <IconStatsBars />
  69. <div className="headline">
  70. {strings.home_indepth_title}
  71. </div>
  72. <div className="description">
  73. {strings.home_indepth_desc}
  74. </div>
  75. </div>
  76. <div className="whyElement">
  77. <IconWand />
  78. <div className="headline">
  79. {strings.home_free_title}
  80. </div>
  81. <div className="description">
  82. {strings.home_free_desc}
  83. </div>
  84. </div>
  85. </div>
  86. </StyledDiv>
  87. );
  88.  
  89. Why.propTypes = {
  90. strings: PropTypes.shape({}),
  91. };
  92.  
  93. const mapStateToProps = state => ({
  94. strings: state.app.strings,
  95. });
  96.  
  97. export default connect(mapStateToProps)(Why);
Add Comment
Please, Sign In to add comment