-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
fix #6127 updated the Support button toopen a menu that allows users to either access the [user guide](https://twenty.com/user-guide) or contact support through the chat. ![Screenshot (675)](https://github.com/user-attachments/assets/026e48ee-c397-44ae-bee7-e76698298a52) --------- Co-authored-by: Charles Bochet <[email protected]>
- Loading branch information
1 parent
6728e40
commit 9d51af3
Showing
7 changed files
with
72 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../components/SupportChatSkeletonLoader.tsx → ...omponents/SupportButtonSkeletonLoader.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
packages/twenty-front/src/modules/support/components/SupportDropdown.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { SupportButton } from '@/support/components/SupportButton'; | ||
import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown'; | ||
import { DropdownMenu } from '@/ui/layout/dropdown/components/DropdownMenu'; | ||
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer'; | ||
import { useDropdown } from '@/ui/layout/dropdown/hooks/useDropdown'; | ||
import { MenuItem } from '@/ui/navigation/menu-item/components/MenuItem'; | ||
import { IconHelpCircle, IconMessage } from 'twenty-ui'; | ||
|
||
export const SupportDropdown = () => { | ||
const dropdownId = `support-field-active-action-dropdown`; | ||
|
||
const { closeDropdown } = useDropdown(dropdownId); | ||
|
||
const handleTalkToUs = () => { | ||
window.FrontChat?.('show'); | ||
closeDropdown(); | ||
}; | ||
|
||
const handleUserGuide = () => { | ||
window.open('https://twenty.com/user-guide', '_blank'); | ||
closeDropdown(); | ||
}; | ||
|
||
return ( | ||
<Dropdown | ||
dropdownId={dropdownId} | ||
dropdownPlacement="top-start" | ||
dropdownOffset={{ x: 0, y: -28 }} | ||
clickableComponent={<SupportButton />} | ||
dropdownComponents={ | ||
<DropdownMenu width="160px"> | ||
<DropdownMenuItemsContainer> | ||
<MenuItem | ||
text="Talk to us" | ||
LeftIcon={IconMessage} | ||
onClick={handleTalkToUs} | ||
/> | ||
<MenuItem | ||
text="Documentation" | ||
LeftIcon={IconHelpCircle} | ||
onClick={handleUserGuide} | ||
/> | ||
</DropdownMenuItemsContainer> | ||
</DropdownMenu> | ||
} | ||
dropdownHotkeyScope={{ | ||
scope: dropdownId, | ||
}} | ||
/> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -116,6 +116,7 @@ export { | |
IconMailCog, | ||
IconMap, | ||
IconMaximize, | ||
IconMessage, | ||
IconMinus, | ||
IconMoneybag, | ||
IconMouse2, | ||
|