Skip to content

Commit

Permalink
Fix invaild count
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorKowalczyk committed Sep 23, 2022
1 parent b790af0 commit 2bac4c4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/photography/ImagesList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { BlurPreview } from "@components/elements/BlurImage";

export function ListElement({ title, description, slug, publishedAt, index, preview, count }) {
const prepared_preview = JSON.parse(preview.replaceAll("'", '"'));

return (
<Link href={`/photography/${slug}`}>
<a className="w-full">
Expand All @@ -26,7 +27,7 @@ export function ListElement({ title, description, slug, publishedAt, index, prev
{prepared_preview.map((image, index) => (
<BlurPreview key={`${index}-image-prev`} image={image} />
))}
{count - prepared_preview.length > 0 && <p className="z-10 flex h-10 w-10 items-center justify-center rounded-full border-2 border-[#edeeef] bg-[#edeeef] font-poppins text-xs font-medium text-gray-600 duration-200 group-hover:border-[#f6f6f7] group-hover:bg-[#f0eff0] motion-reduce:transition-none dark:border-[#343c4d] dark:bg-[#2b3342] dark:text-gray-300 dark:group-hover:border-[#4a5367] dark:group-hover:bg-[#343c4d]">+{count - preview.length}</p>}
{count - prepared_preview.length > 0 && <p className="z-10 flex h-10 w-10 items-center justify-center rounded-full border-2 border-[#edeeef] bg-[#edeeef] font-poppins text-xs font-medium text-gray-600 duration-200 group-hover:border-[#f6f6f7] group-hover:bg-[#f0eff0] motion-reduce:transition-none dark:border-[#343c4d] dark:bg-[#2b3342] dark:text-gray-300 dark:group-hover:border-[#4a5367] dark:group-hover:bg-[#343c4d]">+{count - prepared_preview.length}</p>}
</div>
)}
<p className="inline-flex text-sm font-semibold text-[#1491ff]">Show more</p>
Expand Down

0 comments on commit 2bac4c4

Please sign in to comment.