sdy

update CategoryPresenter

1 -import React from "react"; 1 +import React, { useEffect } from "react";
2 import styled from "styled-components"; 2 import styled from "styled-components";
3 import { Link } from "react-router-dom"; 3 import { Link } from "react-router-dom";
4 import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; 4 import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
...@@ -62,9 +62,10 @@ const StyledLink = styled(Link)` ...@@ -62,9 +62,10 @@ const StyledLink = styled(Link)`
62 } 62 }
63 `; 63 `;
64 64
65 -export default ({ location, categories }) => { 65 +export default ({ location, categories, subscribeToNewCategory }) => {
66 const { pathname } = location; 66 const { pathname } = location;
67 let path; 67 let path;
68 + useEffect(() => subscribeToNewCategory(), []);
68 return ( 69 return (
69 <> 70 <>
70 <CategoryContainer> 71 <CategoryContainer>
......