From 0d55ce9f06abbb6d65c939b516a60e06b73b5388 Mon Sep 17 00:00:00 2001 From: Lucas Oliveira Date: Wed, 25 Oct 2023 19:19:22 -0300 Subject: [PATCH] Added skeleton on store loading --- src/frontend/src/pages/StorePage/index.tsx | 128 +++++++++++---------- 1 file changed, 65 insertions(+), 63 deletions(-) diff --git a/src/frontend/src/pages/StorePage/index.tsx b/src/frontend/src/pages/StorePage/index.tsx index 920deb2de..0fa3a5ed8 100644 --- a/src/frontend/src/pages/StorePage/index.tsx +++ b/src/frontend/src/pages/StorePage/index.tsx @@ -3,6 +3,7 @@ import { Link, Search } from "lucide-react"; import { useContext, useEffect, useState } from "react"; import IconComponent from "../../components/genericIconComponent"; import Header from "../../components/headerComponent"; +import { SkeletonCardComponent } from "../../components/skeletonCardComponent"; import { Badge } from "../../components/ui/badge"; import { Button } from "../../components/ui/button"; import { Input } from "../../components/ui/input"; @@ -117,60 +118,58 @@ export default function StorePage(): JSX.Element { Search flows and components from the community. - {renderComponents && ( -
-
-
- Added Only -
-
- { - setInputText(e.target.value); - }} - onKeyDown={(e) => { - if (e.key === "Enter") { - handleSearch(inputText); - } - }} - value={inputText} - /> - -
-
- -
-
- -
+
+
+
+ Added Only
-
- {Array.from(new Set(searchData.map((i) => i.is_component))).map( +
+ { + setInputText(e.target.value); + }} + onKeyDown={(e) => { + if (e.key === "Enter") { + handleSearch(inputText); + } + }} + value={inputText} + /> + +
+
+ +
+
+ +
+
+
+ {renderComponents && + Array.from(new Set(searchData.map((i) => i.is_component))).map( (i, idx) => ( { @@ -200,9 +199,16 @@ export default function StorePage(): JSX.Element { ) )} -
-
- {searchData +
+
+ {loadingWithApiKey ? ( + <> + + + + + ) : ( + searchData .filter( (f) => Array.from(filteredCategories).length === 0 || @@ -210,14 +216,10 @@ export default function StorePage(): JSX.Element { ) .map((item, idx) => ( - ))} -
+ )) + )}
- )} - - {loadingWithApiKey && ( -
Loading...
- )} +
);