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_active !== false && |
||||
profile.active_subscription.is_valid !== 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 = () => { |
const handleOpenSubscriptionModal = () => { |
||||
setIsSubscriptionInfoOpen(true); |
setIsSubscriptionInfoOpen(true); |
||||
if (!profile) { |
if (!profile) { |
||||
@ -326,7 +348,7 @@ export function NavigationButton({ |
|||||
type="button" |
type="button" |
||||
onClick={() => { |
onClick={() => { |
||||
setIsDropdownOpen(false); |
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" |
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> |
</div> |
||||
)} |
)} |
||||
|
|
||||
<SupportSheet |
|
||||
|
{/* <SupportSheet |
||||
isOpen={isSupportOpen} |
isOpen={isSupportOpen} |
||||
onClose={() => setIsSupportOpen(false)} |
onClose={() => setIsSupportOpen(false)} |
||||
/> |
|
||||
|
/> */} |
||||
|
|
||||
{isRulesOpen && ( |
{isRulesOpen && ( |
||||
<InformationSheet |
<InformationSheet |
||||
@ -422,8 +444,8 @@ export function NavigationButton({ |
|||||
} |
} |
||||
} else if (icon === "close" || icon === "exit") { |
} else if (icon === "close" || icon === "exit") { |
||||
router.back(); |
router.back(); |
||||
} else if (icon === "support") { |
|
||||
setIsSupportOpen(true); |
|
||||
|
} else if (icon === "support" || icon === "consultation") { |
||||
|
handleDirectSupportContact(); |
||||
} else if (icon === "subscription") { |
} else if (icon === "subscription") { |
||||
handleOpenSubscriptionModal(); |
handleOpenSubscriptionModal(); |
||||
} |
} |
||||
@ -451,10 +473,10 @@ export function NavigationButton({ |
|||||
/> |
/> |
||||
) : null} |
) : null} |
||||
|
|
||||
<SupportSheet |
|
||||
|
{/* <SupportSheet |
||||
isOpen={isSupportOpen} |
isOpen={isSupportOpen} |
||||
onClose={() => setIsSupportOpen(false)} |
onClose={() => setIsSupportOpen(false)} |
||||
/> |
|
||||
|
/> */} |
||||
|
|
||||
{renderSubscriptionModal()} |
{renderSubscriptionModal()} |
||||
</> |
</> |
||||
|
|||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue