From 0e3bf92d68c093122938112dbcc53c30a403325d Mon Sep 17 00:00:00 2001 From: Alaguraj0361 Date: Wed, 17 Sep 2025 22:38:35 +0530 Subject: [PATCH] social media icons updated --- components/ContactFloat.js | 80 ++++++++++++++++++++++++++++++++++--- components/layout/Layout.js | 2 +- 2 files changed, 76 insertions(+), 6 deletions(-) diff --git a/components/ContactFloat.js b/components/ContactFloat.js index a3237bc..bad9ba8 100644 --- a/components/ContactFloat.js +++ b/components/ContactFloat.js @@ -6,6 +6,7 @@ import axios from "axios"; export default function ContactFloat() { const [open, setOpen] = useState(false); const [showChat, setShowChat] = useState(false); + const [showSocial, setShowSocial] = useState(false); // 👈 NEW: toggle social icons /** Contact actions */ const extraIcons = [ @@ -24,6 +25,26 @@ export default function ContactFloat() { src: "/assets/images/chat.png", label: "Chat", }, + { + action: () => setShowSocial((prev) => !prev), // 👈 NEW: share toggle + src: "/assets/images/share.png", + label: "Share", + }, + ]; + + /** Social media list shown on Share click */ + const socialIcons = [ + + { + href: "https://www.instagram.com/elrapharehab/", + iconClass: "icon-4", + label: "Instagram", + }, + { + href: "https://www.facebook.com/ELRaphaRehabCenter/", + iconClass: "icon-7", + label: "Facebook", + }, ]; return ( @@ -103,7 +124,17 @@ export default function ContactFloat() { type="button" aria-label={open ? "Close" : "Contact Us"} className="contact-icon-outer toggle-btn" - onClick={() => setOpen((prev) => !prev)} + onClick={() => { + setOpen((prev) => { + const newState = !prev; + if (!newState) { + // 🔹 when closing the main button, also hide Chat & Social + setShowChat(false); + setShowSocial(false); + } + return newState; + }); + }} style={{ position: "fixed", bottom: "71px", @@ -112,7 +143,6 @@ export default function ContactFloat() { background: "#102548", borderRadius: "50%", padding: "15px", - // boxShadow: "0 4px 12px #102548", border: "none", zIndex: 9999, }} @@ -129,10 +159,50 @@ export default function ContactFloat() { - {/* Chat Form Sidebar */} - {showChat && ( - setShowChat(false)} /> + {/* 👉 Right side floating Social Icons (only when Share clicked) */} + {showSocial && ( +
+ {socialIcons.map((icon, i) => ( + + + + ))} +
)} + + {/* Chat Form Sidebar */} + {showChat && setShowChat(false)} />} ); } diff --git a/components/layout/Layout.js b/components/layout/Layout.js index 48abe61..69b3f46 100644 --- a/components/layout/Layout.js +++ b/components/layout/Layout.js @@ -69,7 +69,7 @@ export default function Layout({ headerStyle, footerStyle, headTitle, breadcrumb {footerStyle === 2 && } - + {/* */} );