Skip to content

Commit

Permalink
Removed the likes from the article preview (codu-code#1186)
Browse files Browse the repository at this point in the history
  • Loading branch information
NiallJoeMaher authored Oct 28, 2024
1 parent 8d1e300 commit 60267e5
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions components/ArticlePreview/ArticlePreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { Temporal } from "@js-temporal/polyfill";
import {
BookmarkIcon,
EllipsisHorizontalIcon,
HeartIcon,
} from "@heroicons/react/20/solid";
import {
Menu,
Expand Down Expand Up @@ -56,16 +55,15 @@ const ArticlePreview: NextPage<Props> = ({
menuOptions,
showBookmark = true,
bookmarkedInitialState = false,
likes,
}) => {
const { data: session } = useSession();
const [bookmarked, setIsBookmarked] = useState(bookmarkedInitialState);
const howManySavedToShow = 3;
const { data: bookmarksData, refetch } = api.post.myBookmarks.useQuery(

const { refetch } = api.post.myBookmarks.useQuery(
{ limit: howManySavedToShow },
{ enabled: !!session },
);
const bookmarks = bookmarksData?.bookmarks;
const dateTime = Temporal.Instant.from(new Date(date).toISOString());
const readableDate = dateTime.toLocaleString(["en-IE"], {
year: "numeric",
Expand Down Expand Up @@ -128,15 +126,6 @@ const ArticlePreview: NextPage<Props> = ({
<>
<span aria-hidden="true">&middot;</span>
<span>{readTime} min read</span>
{likes && (
<>
<span aria-hidden="true">&middot;</span>
<span data-likes={likes}>{likes}</span>
<HeartIcon
className={`relative top-[1px] h-3.5 w-3.5 fill-red-400`}
/>
</>
)}
</>
)}
<div className="flex items-center justify-start"></div>
Expand Down

0 comments on commit 60267e5

Please sign in to comment.