1 changed files with 29 additions and 7 deletions
@ -86,6 +86,28 @@ export function NavigationButton({ |
|||
profile.active_subscription.is_active !== false && |
|||
profile.active_subscription.is_valid !== false; |
|||
|
|||
const handleDirectSupportContact = () => { |
|||
if (typeof window !== "undefined" && "HabibApp" in window) { |
|||
try { |
|||
const app = ( |
|||
window as Window & { |
|||
HabibApp?: { postMessage: (msg: string) => void }; |
|||
} |
|||
).HabibApp; |
|||
app?.postMessage( |
|||
JSON.stringify({ |
|||
action: "open_consultant_page", |
|||
data: { consultant: "[email protected]" }, |
|||
}), |
|||
); |
|||
} catch (err) { |
|||
console.error("Error calling HabibApp bridge", err); |
|||
} |
|||
} else if (typeof window !== "undefined") { |
|||
window.open("mailto:[email protected]", "_blank"); |
|||
} |
|||
}; |
|||
|
|||
const handleOpenSubscriptionModal = () => { |
|||
setIsSubscriptionInfoOpen(true); |
|||
if (!profile) { |
|||
@ -326,7 +348,7 @@ export function NavigationButton({ |
|||
type="button" |
|||
onClick={() => { |
|||
setIsDropdownOpen(false); |
|||
setIsSupportOpen(true); |
|||
handleDirectSupportContact(); |
|||
}} |
|||
className="flex w-full items-center gap-3 px-3.5 py-2.5 rounded-[12px] text-start font-medium text-[13.5px] text-[#1F2937] hover:bg-[#F3F4F6] active:bg-[#E5E7EB] transition-colors cursor-pointer border-0 bg-transparent" |
|||
> |
|||
@ -350,10 +372,10 @@ export function NavigationButton({ |
|||
</div> |
|||
)} |
|||
|
|||
<SupportSheet |
|||
{/* <SupportSheet |
|||
isOpen={isSupportOpen} |
|||
onClose={() => setIsSupportOpen(false)} |
|||
/> |
|||
/> */} |
|||
|
|||
{isRulesOpen && ( |
|||
<InformationSheet |
|||
@ -422,8 +444,8 @@ export function NavigationButton({ |
|||
} |
|||
} else if (icon === "close" || icon === "exit") { |
|||
router.back(); |
|||
} else if (icon === "support") { |
|||
setIsSupportOpen(true); |
|||
} else if (icon === "support" || icon === "consultation") { |
|||
handleDirectSupportContact(); |
|||
} else if (icon === "subscription") { |
|||
handleOpenSubscriptionModal(); |
|||
} |
|||
@ -451,10 +473,10 @@ export function NavigationButton({ |
|||
/> |
|||
) : null} |
|||
|
|||
<SupportSheet |
|||
{/* <SupportSheet |
|||
isOpen={isSupportOpen} |
|||
onClose={() => setIsSupportOpen(false)} |
|||
/> |
|||
/> */} |
|||
|
|||
{renderSubscriptionModal()} |
|||
</> |
|||
|
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue