mirror of
https://github.com/simstudioai/sim.git
synced 2026-09-24 15:45:35 +08:00
feat(sidebar): add Slack Community link to help dropdown (#5858)
* feat(sidebar): add Slack Community link to help dropdown * chore(sidebar): use existing Slack community invite link
This commit is contained in:
@@ -39,6 +39,7 @@ import { MoreHorizontal, Pin } from 'lucide-react'
|
||||
import Link from 'next/link'
|
||||
import { useParams, usePathname, useRouter } from 'next/navigation'
|
||||
import { usePostHog } from 'posthog-js/react'
|
||||
import { SlackIcon } from '@/components/icons'
|
||||
import { useSession } from '@/lib/auth/auth-client'
|
||||
import { SIM_RESOURCES_DRAG_TYPE } from '@/lib/copilot/resource-types'
|
||||
import { isMacPlatform } from '@/lib/core/utils/platform'
|
||||
@@ -115,6 +116,9 @@ import { useSidebarStore } from '@/stores/sidebar/store'
|
||||
|
||||
const logger = createLogger('Sidebar')
|
||||
|
||||
const SLACK_COMMUNITY_URL =
|
||||
'https://join.slack.com/t/sim-ott9864/shared_invite/zt-43lp8tc5v-0qrrqHGBKUsvQlpoouH~TA'
|
||||
|
||||
export function SidebarTooltip({
|
||||
children,
|
||||
label,
|
||||
@@ -1170,6 +1174,11 @@ export const Sidebar = memo(function Sidebar({ isCollapsed }: SidebarProps) {
|
||||
captureEvent(posthog, 'docs_opened', { source: 'help_menu' })
|
||||
}, [posthog])
|
||||
|
||||
const handleOpenSlackCommunity = useCallback(() => {
|
||||
window.open(SLACK_COMMUNITY_URL, '_blank', 'noopener,noreferrer')
|
||||
captureEvent(posthog, 'slack_community_opened', { source: 'help_menu' })
|
||||
}, [posthog])
|
||||
|
||||
const handleChatRenameBlur = useCallback(
|
||||
() => void chatFlyoutRename.saveRename(),
|
||||
[chatFlyoutRename.saveRename]
|
||||
@@ -1670,6 +1679,10 @@ export const Sidebar = memo(function Sidebar({ isCollapsed }: SidebarProps) {
|
||||
<BookOpen className='h-[14px] w-[14px]' />
|
||||
Docs
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem onSelect={handleOpenSlackCommunity}>
|
||||
<SlackIcon className='size-[14px]' />
|
||||
Slack Community
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem onSelect={handleOpenHelpFromMenu}>
|
||||
<HelpCircle className='h-[14px] w-[14px]' />
|
||||
Report an issue
|
||||
|
||||
@@ -547,6 +547,10 @@ export interface PostHogEventMap {
|
||||
block_type?: string
|
||||
}
|
||||
|
||||
slack_community_opened: {
|
||||
source: 'help_menu'
|
||||
}
|
||||
|
||||
search_result_selected: {
|
||||
result_type:
|
||||
| 'block'
|
||||
|
||||
Reference in New Issue
Block a user