users.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /**
  2. * Copyright (c) 2017-present, Facebook, Inc.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. */
  7. const React = require('react');
  8. const {Container} = require('../../core/CompLibrary.js');
  9. const siteConfig = require(process.cwd() + '/siteConfig.js');
  10. class Users extends React.Component {
  11. render() {
  12. if ((siteConfig.users || []).length === 0) {
  13. return null;
  14. }
  15. const editUrl = siteConfig.repoUrl + '/edit/master/website/siteConfig.js';
  16. const showcase = siteConfig.users.map((user, i) => {
  17. return (
  18. <a href={user.infoLink} key={i}>
  19. <div className="imgbox">
  20. <img src={user.image} alt={user.caption} title={user.caption} />
  21. </div>
  22. <p>{user.caption}</p>
  23. </a>
  24. );
  25. });
  26. return (
  27. <div className="mainContainer">
  28. <Container padding={['bottom', 'top']}>
  29. <div className="showcaseSection">
  30. <div className="prose">
  31. <h1>Who is Using KaTeX?</h1>
  32. <p>KaTeX is used by many projects:</p>
  33. </div>
  34. <div className="logos">{showcase}</div>
  35. <p>Are you using KaTeX?</p>
  36. <a href={editUrl} className="button">
  37. Add your project
  38. </a>
  39. </div>
  40. </Container>
  41. </div>
  42. );
  43. }
  44. }
  45. module.exports = Users;