From 38516c0d8405fe111dbeef0e606ec56bb29c27dd Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Fri, 29 Nov 2024 22:32:30 +0530 Subject: [PATCH 1/3] feat: center loader --- src/components/organisms/ApiKey.tsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/components/organisms/ApiKey.tsx b/src/components/organisms/ApiKey.tsx index 675edb72..201947a9 100644 --- a/src/components/organisms/ApiKey.tsx +++ b/src/components/organisms/ApiKey.tsx @@ -92,7 +92,20 @@ const ApiKeyManager = () => { } }; - if (loading) return ; + if (loading) { + return ( + + + + ); + } return ( From a3c494ea28228c119928efbfcfe0f395058d334d Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Fri, 29 Nov 2024 22:33:02 +0530 Subject: [PATCH 2/3] feat: center loader vertically & horizontally --- src/components/organisms/ApiKey.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/organisms/ApiKey.tsx b/src/components/organisms/ApiKey.tsx index 201947a9..5b029d78 100644 --- a/src/components/organisms/ApiKey.tsx +++ b/src/components/organisms/ApiKey.tsx @@ -100,6 +100,7 @@ const ApiKeyManager = () => { justifyContent: 'center', alignItems: 'center', height: '100vh', + width: '100vw', }} > From dcacfbc47443593159bb4eb6adc00b895e876c21 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Fri, 29 Nov 2024 22:33:23 +0530 Subject: [PATCH 3/3] chore: lint --- src/components/organisms/ApiKey.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/organisms/ApiKey.tsx b/src/components/organisms/ApiKey.tsx index 5b029d78..2729581e 100644 --- a/src/components/organisms/ApiKey.tsx +++ b/src/components/organisms/ApiKey.tsx @@ -36,9 +36,9 @@ const ApiKeyManager = () => { const [copySuccess, setCopySuccess] = useState(false); const { notify } = useGlobalInfoStore(); - - + + useEffect(() => { const fetchApiKey = async () => { @@ -53,7 +53,7 @@ const ApiKeyManager = () => { }; fetchApiKey(); - + }, []); const generateApiKey = async () => { @@ -61,7 +61,7 @@ const ApiKeyManager = () => { try { const { data } = await axios.post(`${apiUrl}/auth/generate-api-key`); setApiKey(data.api_key); - + notify('success', `Generated API Key successfully`); } catch (error: any) { notify('error', `Failed to generate API Key - ${error.message}`);