From 4cbe9ff6edd2d0a23d5fedb7a38b827bb8a3901f Mon Sep 17 00:00:00 2001 From: khalilcodes Date: Thu, 16 Jun 2022 16:45:42 +0300 Subject: [PATCH] [site/home][s]: add logic for images and improve card styles --- site/components/Home/Latest.js | 87 +++++++++++++++++++++++----------- 1 file changed, 60 insertions(+), 27 deletions(-) diff --git a/site/components/Home/Latest.js b/site/components/Home/Latest.js index d12c367..614e604 100644 --- a/site/components/Home/Latest.js +++ b/site/components/Home/Latest.js @@ -1,4 +1,20 @@ +// import { useState } from "react" +import Link from "next/link" +import { YOUTUBE_REGEX } from "../../lib/constants" +import { getYoutube } from "../../utils/getYoutube" + export function Latest({ posts }) { + // const initialValue = 6 + // const [ value, setValue ] = useState(initialValue) + // const initialPosts = posts && posts.slice(0, value) + + // const handleButton = () => { + // setValue(prev => + // initialPosts.length === posts.length + // ? initialValue + // : prev + 3) + // } + return (
@@ -11,37 +27,54 @@ export function Latest({ posts }) { Our latest articles and explorations.

-
- {posts && posts.map((post) => ( -
- {post.image ? -
- {post.title} -
- :
- } -
- + {/*
+ {!(posts.length === initialPosts.length && value === initialValue) && + + } +
*/}
)