From 81e7d79a2c6fe7d37709be98b92a7063d368b1f0 Mon Sep 17 00:00:00 2001 From: Cohan Carpentier Date: Mon, 7 Oct 2024 14:01:59 -0400 Subject: [PATCH] fix: better loading icon on buttons --- button.test.tsx | 4 ++-- button.tsx | 6 +++--- package.json | 4 ++-- stories/button.stories.tsx | 28 ++++++++++++++++++++++++---- 4 files changed, 31 insertions(+), 11 deletions(-) diff --git a/button.test.tsx b/button.test.tsx index 525319e..e5d5867 100644 --- a/button.test.tsx +++ b/button.test.tsx @@ -42,10 +42,10 @@ describe("Button", () => { expect(loaderElement).toBeInTheDocument(); }); - it("reanders Loader2Icon, but hidden when isLoading is false", () => { + it("renders Loader2Icon, but hidden when isLoading is false", () => { render( - + + ); } export function Loading() { - return ; + const [isLoading, setIsLoading] = useState(false); + const [isLoading2, setIsLoading2] = useState(false); + const [isLoading3, setIsLoading3] = useState(false); + + return ( +
+ + +
+ ); } export function Disabled() {