diff --git a/src/App.jsx b/src/App.jsx index eae2495..419597b 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,54 +1,21 @@ -import React, { useState, useEffect } from "react"; +import React from "react"; import Post from "./components/Post"; -import ActionButtons from "./components/ActionButtons"; -import CommentForm from "./components/CommentForm"; -import CommentsModal from "./components/CommentsModal"; const App = () => { - // State declarations - const [likes, setLikes] = useState(0); - const [comments, setComments] = useState([]); - const [newComment, setNewComment] = useState(""); - const [showComments, setShowComments] = useState(false); - - // Persist likes and comments in localStorage - useEffect(() => { - localStorage.setItem("likes", likes); - }, [likes]); - - useEffect(() => { - localStorage.setItem("comments", JSON.stringify(comments)); - }, [comments]); - - // Handlers - const handleLike = () => setLikes((prev) => prev + 1); - - const handleSubmit = (e) => { - e.preventDefault(); - if (newComment.trim()) { - setComments((prev) => [...prev, { text: newComment }]); - setNewComment(""); + const posts = [ + { + id: 1, + user: "John Doe", + time: "2 hours ago", + content: "This is a sample post content. Implementing concepts of Likes and Comments.", + image: "/images/Blog.webp", } - }; - + ]; return (
{user}
+{time}
+John Doe
-2 hours ago
+{content}
+ {image && } +- This is a sample post content. Implementing concepts of Likes and Comments. -
- -