From 56f4d86f4c5773f2b52511053a2ef79dbae84417 Mon Sep 17 00:00:00 2001 From: Leon Xu Date: Mon, 23 Jan 2023 16:24:39 -0800 Subject: [PATCH] doc: add useState hooks and section tags --- src/pages/Home.jsx | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/src/pages/Home.jsx b/src/pages/Home.jsx index 164a5a1..ff3ab95 100644 --- a/src/pages/Home.jsx +++ b/src/pages/Home.jsx @@ -2,7 +2,44 @@ import React, { useState, useEffect } from "react"; import { Loader, Card, FormField } from "../components"; const Home = () => { - return
Home
; + const [loading, setLoading] = useState(false); + const [allPosts, setAllPosts] = useState(null); + const [searchText, setSearchText] = useState(""); + + return ( +
+
+

+ The Community Showcase +

+

+ Browse through a collection of imaginative and visually stunning + images generated by DALL-E AI +

+
+ +
+ +
+ +
+ {loading ? ( +
+ +
+ ) : ( + <> + {searchText && ( +

+ Showing results for{" "} + {searchText} +

+ )} + + )} +
+
+ ); }; export default Home;