diff --git a/src/assets/heart-icons/heart-icon-black.svg b/src/assets/heart-icons/heart-icon-black.svg new file mode 100644 index 0000000..912e1d9 --- /dev/null +++ b/src/assets/heart-icons/heart-icon-black.svg @@ -0,0 +1,20 @@ + + + + diff --git a/src/assets/heart-icons/heart-icon-red.svg b/src/assets/heart-icons/heart-icon-red.svg new file mode 100644 index 0000000..7eedfdc --- /dev/null +++ b/src/assets/heart-icons/heart-icon-red.svg @@ -0,0 +1,20 @@ + + + + diff --git a/src/assets/heart-icons/heart-icon-white.svg b/src/assets/heart-icons/heart-icon-white.svg new file mode 100644 index 0000000..7c01e7a --- /dev/null +++ b/src/assets/heart-icons/heart-icon-white.svg @@ -0,0 +1,20 @@ + + + + diff --git a/src/features/posts/ArticleHeartIcon.jsx b/src/features/posts/ArticleHeartIcon.jsx index 8916fca..8096d9d 100644 --- a/src/features/posts/ArticleHeartIcon.jsx +++ b/src/features/posts/ArticleHeartIcon.jsx @@ -1,4 +1,13 @@ +import HeartIconBlack from "../../assets/heart-icons/heart-icon-black.svg"; +import HeartIconWhite from "../../assets/heart-icons/heart-icon-white.svg"; +import HeartIconRed from "../../assets/heart-icons/heart-icon-red.svg"; +import { useState } from "react"; +import { useEffect } from "react"; +import { useSelector } from "react-redux"; + const ArticleHeartIcon = ({ number, click, isLiked, addedLikes, hasChangedLikes }) => { + const theme = useSelector(state => state.global.theme); + const likedStyle = { color: "var(--heartColor)" } @@ -10,7 +19,8 @@ const ArticleHeartIcon = ({ number, click, isLiked, addedLikes, hasChangedLikes return(
{number !== undefined ? number + addedLikes : "NaN"}