Skip to content

Commit

Permalink
feat: always show intercom on desktop by default (hidden on mobile)
Browse files Browse the repository at this point in the history
  • Loading branch information
SomayChauhan committed Apr 5, 2024
1 parent 86a7824 commit d14a7b0
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions packages/features/shell/Shell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ const Layout = (props: LayoutProps) => {
return (activeBanners?.length ?? 0) * TOP_BANNER_HEIGHT;
}, [banners]);

const [helpOpen, setHelpOpen] = useState(false);
useFormbricks();

return (
Expand Down Expand Up @@ -282,6 +283,29 @@ const Layout = (props: LayoutProps) => {
<MainContainer {...props} />
</div>
</div>
<div className="fixed bottom-12 right-12 hidden md:flex">
<Dropdown open={helpOpen}>
<DropdownMenuTrigger asChild onClick={() => setHelpOpen((prev) => !prev)}>
<Button className="">Intercom</Button>
</DropdownMenuTrigger>
<DropdownMenuPortal>
<FreshChatProvider>
<DropdownMenuContent
align="start"
onInteractOutside={() => {
setHelpOpen(false);
}}
className="group m-2 overflow-hidden rounded-md">
<HelpMenuItem
onHelpItemSelect={() => {
setHelpOpen(false);
}}
/>
</DropdownMenuContent>
</FreshChatProvider>
</DropdownMenuPortal>
</Dropdown>
</div>
</div>
</>
);
Expand Down

0 comments on commit d14a7b0

Please sign in to comment.