Highlight.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. import React from 'react'
  2. import clsx from 'clsx'
  3. import styles from './highlight.module.css'
  4. export default function Highlight({ reversed, title, img, text, isDark }) {
  5. const left = <div className={clsx('col col--6', styles.featureImage, reversed ? styles.featureImageReversed : '')}>{img}</div>
  6. const right = (
  7. <div className={clsx('col col--6', styles.featureContent, reversed ? styles.featureContentReversed : '')}>
  8. <h3 className={styles.featureTitle}>{title}</h3>
  9. {text}
  10. </div>
  11. )
  12. return (
  13. <section className={clsx('highlightSection', isDark ? styles.darkSection + ' darkSection' : '')}>
  14. <div className="container">
  15. <div className="row">
  16. {reversed ? (
  17. <>
  18. {right}
  19. {left}
  20. </>
  21. ) : (
  22. <>
  23. {left}
  24. {right}
  25. </>
  26. )}
  27. </div>
  28. </div>
  29. </section>
  30. )
  31. }