Guest User

Untitled

a guest
Dec 17th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. export function visBrands() {
  2. clearTimeout(closeBrandsTimer);
  3. return dispatch => {
  4. visBrandsTimer = setTimeout(()=>{
  5. dispatch({
  6. type: VIS_BRANDS,
  7. })}, openDelay
  8. );
  9. }
  10. }
  11.  
  12. export function closeBrands() {
  13. clearTimeout(visBrandsTimer);
  14. return dispatch => {
  15. closeBrandsTimer = setTimeout(()=>{
  16. dispatch({
  17. type: CLOSE_BRANDS,
  18. })}, closeDelay
  19. );
  20. }
  21. }
  22.  
  23. import React from 'react';
  24. import styles from './Brands.css';
  25. import {brandsList} from '../../../data/brandsList';
  26.  
  27. const Brands = ({visBrands, closeBrands}) => {
  28. const brands = brandsList.map((brand) => {
  29. return (<div key={brand.id} className={styles.list}>
  30. {brand.title}
  31. </div>)
  32. });
  33. return(
  34. <div onMouseEnter={visBrands} onMouseLeave={closeBrands}
  35. className={styles.wrapBrands}>
  36. <div className={styles.Brands}>
  37. {brands}
  38. <div className={styles.allBrand}>Показать все бренды</div>
  39. </div>
  40. </div>
  41. )
  42. };
  43.  
  44. export default Brands;
Add Comment
Please, Sign In to add comment