From e2e2fca0d61982e307e0880c0713b10a62775064 Mon Sep 17 00:00:00 2001 From: Pratham Vaidya Date: Wed, 21 Feb 2024 11:40:38 +0530 Subject: [PATCH] fix: subcategory issue #1 , added loading spinner animation --- src/components/CategoryTree.tsx | 3 +++ src/styles/App.scss | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/components/CategoryTree.tsx b/src/components/CategoryTree.tsx index 9916f21..03acbd0 100644 --- a/src/components/CategoryTree.tsx +++ b/src/components/CategoryTree.tsx @@ -50,6 +50,9 @@ export default function CategoryTree({ treeData }: { treeData: CategoryNode }) { ) ); + // Remove the first root element which already exists in tree + fetchedData.splice(0, 1); + return new Promise((resolve) => { if (element.children.length > 0) { resolve(); diff --git a/src/styles/App.scss b/src/styles/App.scss index 2ea489b..ed9139b 100644 --- a/src/styles/App.scss +++ b/src/styles/App.scss @@ -78,3 +78,16 @@ button { background-color: #e9e9e9; } } + +.loading-icon{ + animation: loading-spinner linear 0.9s infinite; +} + +@keyframes loading-spinner{ + 0%{ + transform: rotateZ(0deg); + } + 100%{ + transform: rotateZ(360deg); + } +} \ No newline at end of file