From df5aeaef6cd557fb3a62905bd050a9e165dbd126 Mon Sep 17 00:00:00 2001 From: Mahmoud Emad Date: Tue, 13 May 2025 10:10:14 +0300 Subject: [PATCH] feat: Improve IPFS demo in Home component - Added a button to toggle the visibility of the IPFS demo. - Improved the layout and styling of the IPFS demo section. - Removed unnecessary alert in IPFS upload functionality. - Updated button component to correctly handle click events. --- sweb/src/components/Home.svelte | 62 +++++++++---------- sweb/src/components/IPFSDemo.svelte | 1 - .../lib/components/ui/button/button.svelte | 5 +- 3 files changed, 33 insertions(+), 35 deletions(-) diff --git a/sweb/src/components/Home.svelte b/sweb/src/components/Home.svelte index c21da03..c578844 100644 --- a/sweb/src/components/Home.svelte +++ b/sweb/src/components/Home.svelte @@ -10,45 +10,43 @@ // Flag to show IPFS demo let showIPFSDemo = false; + + function handleDemoButtonClick() { + console.log("Hello"); + showIPFSDemo = !showIPFSDemo; + }
- {#if contentPath} +
+

+ IPFS Integration +

+

+ Experience the power of decentralized content storage and retrieval + with IPFS. +

+ +
+ +
+
+ + {#if showIPFSDemo} +
+ +
+ {:else if contentPath && contentPath.trim() !== ""}
- {:else} - -
-
-

- IPFS Integration -

-

- Experience the power of decentralized content storage and - retrieval with IPFS. -

- -
- -
-
- - {#if showIPFSDemo} - - {/if} -
{/if}
diff --git a/sweb/src/components/IPFSDemo.svelte b/sweb/src/components/IPFSDemo.svelte index 5874753..0b0b2a1 100644 --- a/sweb/src/components/IPFSDemo.svelte +++ b/sweb/src/components/IPFSDemo.svelte @@ -87,7 +87,6 @@ variant="primary" on:click={() => { console.log("Upload button clicked directly"); - alert("Upload button clicked!"); uploadContent(); }} disabled={uploading || !content.trim()} diff --git a/sweb/src/lib/components/ui/button/button.svelte b/sweb/src/lib/components/ui/button/button.svelte index b7800bf..3dab614 100644 --- a/sweb/src/lib/components/ui/button/button.svelte +++ b/sweb/src/lib/components/ui/button/button.svelte @@ -1,11 +1,11 @@ +