diff --git a/src/components/Dashboard/Dashboard.jsx b/src/components/Dashboard/Dashboard.jsx index e69de29b..13ecc88d 100644 --- a/src/components/Dashboard/Dashboard.jsx +++ b/src/components/Dashboard/Dashboard.jsx @@ -0,0 +1,32 @@ +import React, { useState } from "react"; +import SideBar from "./SideBar"; +import PulseButtonSnippets from "../SnippetComponents/PulseButtonSnippets"; + +const Dashboard = () => { + // State to track which category is selected in the sidebar + const [activeTab, setActiveTab] = useState("Pulse Buttons"); + + return ( +
+ {/* Sidebar component - passing state setter to change tabs */} + + + {/* Main Content Area */} +
+
+ {/* FIXED: Removed the extra closing brace here */} +

+ {activeTab} +

+ + {/* Conditional Rendering Logic for your feature */} + {activeTab === "Pulse Buttons" && } + + {/* Add future conditional renders here */} +
+
+
+ ); +}; + +export default Dashboard; \ No newline at end of file diff --git a/src/components/SnippetComponents/PulseButtonSnippets.jsx b/src/components/SnippetComponents/PulseButtonSnippets.jsx new file mode 100644 index 00000000..2884ec18 --- /dev/null +++ b/src/components/SnippetComponents/PulseButtonSnippets.jsx @@ -0,0 +1,96 @@ +import React, { useState } from "react"; +import Modal from "../UI/Modal"; +import StringToReactComponent from "string-to-react-component"; +// Import buttonSnippets from the central snippet data file +import { buttonSnippets } from "./Snippets/Buttons"; +import FavoriteButton from "../../Pages/Favorites/FavoriteButton"; + +/** + * PulseButtonSnippets Component + * Follows the precise format of the existing button snippets while + * implementing the logic for the Shadow Pulse Button [1, 3]. + */ +function PulseButtonSnippets() { + const [showModal, setShowModal] = useState(false); + const [jsxCode, setJsxCode] = useState(""); + const [cssCode, setCssCode] = useState(""); + + const handleShowModal = (jsx, css) => { + setJsxCode(jsx); + setCssCode(css); + setShowModal(true); + }; + + return ( +
+ {/* + Mapping logic specifically for the Shadow Pulse Button to ensure + it aligns with the 'logic of the pulsebutton' you requested. + */} + {buttonSnippets + .filter((buttonObject) => buttonObject.label === "Shadow Pulse Button") + .map((buttonObject, index) => ( +
+ {/* Favorite Button - Absolute Positioned per your template */} +
+ +
+ + {/* Live Preview Rendering [3] */} + + {`(props) => (${buttonObject.jsxCode})`} + + +
+ + +
+
+ ))} + setShowModal(false)} + jsxCode={jsxCode} + cssCode={cssCode} + /> +
+ ); +} + +export default PulseButtonSnippets; \ No newline at end of file diff --git a/src/components/SnippetComponents/Snippets/Buttons.js b/src/components/SnippetComponents/Snippets/Buttons.js index 7510f2ad..b42b0e8f 100644 --- a/src/components/SnippetComponents/Snippets/Buttons.js +++ b/src/components/SnippetComponents/Snippets/Buttons.js @@ -1,4 +1,12 @@ export const buttonSnippets = [ + { + label: "Shadow Pulse Button", + tags: ['pulse', 'animation', 'tailwind'], + cssCode: + '', + jsxCode: + "", + }, { label: "Move Right", tags: ['hover', 'slide', 'transform'],