diff --git a/src/App.js b/src/App.js index 4f8ca12..5b49a96 100644 --- a/src/App.js +++ b/src/App.js @@ -14,17 +14,17 @@ import BlogDesign6 from "./components/Blogs/design6/BlogDesign6"; function App() { return (
- - - - + {/* */} + {/* */} + {/* */} + {/* */} - - - - - - + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} + {/* */}
); } diff --git a/src/components/counterDesign/CounterDesign.js b/src/components/counterDesign/CounterDesign.js index de403e7..3d1f681 100644 --- a/src/components/counterDesign/CounterDesign.js +++ b/src/components/counterDesign/CounterDesign.js @@ -1,4 +1,4 @@ -import React from "react"; +import React, { useState } from "react"; import "./CounterDesign.scss"; import blackDisLikeIcon from "../../assets/icons/black-dislike-icon.svg"; @@ -16,6 +16,8 @@ const CounterDesign = ({ counterDecreaseBtn, likeBtn, }) => { + const [count, setCount] = useState(0); + return (
@@ -35,20 +37,40 @@ const CounterDesign = ({
{likeBtn && (
- - + setCount(count + 1)} + /> + setCount(count - 1)} + />
)} {counterIncreaseBtn && ( - + setCount(count + 1)} + /> )}

- 561 + {count}{" "}

{counterDecreaseBtn && ( - + setCount(count - 1)} + /> )}
@@ -65,6 +87,6 @@ CounterDesign.defaultProps = { counterColor: "text-darkRedTextColor", // for icons likeBtn: true, - counterIncreaseBtn: false, - counterDecreaseBtn: false, + counterIncreaseBtn: true, + counterDecreaseBtn: true, };