Skip to content

Commit

Permalink
Move comments hub id into config
Browse files Browse the repository at this point in the history
  • Loading branch information
teodorus-nathaniel committed Sep 6, 2023
1 parent cc6642a commit e971e41
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/components/chat/ChatIframe.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Resource } from '@subsocial/resource-discussions'
import { summarize } from '@subsocial/utils'
import clsx from 'clsx'
import { ComponentProps, useEffect } from 'react'
import config from 'src/config'
import useWrapInRef from 'src/hooks/useWrapInRef'
import { useSendEvent } from 'src/providers/AnalyticContext'
import { useSetChatTotalMessageCount } from 'src/rtk/app/hooks'
Expand All @@ -13,8 +14,6 @@ export type ChatIframeProps = ComponentProps<'div'> & {
onUnreadCountChange?: (count: number) => void
}

const COMMENTS_HUB_ID = '1032'

export default function ChatIframe({ onUnreadCountChange, ...props }: ChatIframeProps) {
const entity = useAppSelector(state => state.chat.entity)
const sendEvent = useSendEvent()
Expand Down Expand Up @@ -62,7 +61,7 @@ function generateGrillConfig(entity: ChatEntity['entity']): GrillConfig | null {
const body = summarize(post.content?.body ?? '', { limit: 50 })
return {
hub: {
id: COMMENTS_HUB_ID,
id: config.commentsHubId,
},
theme: 'light',
rootFontSize: '1rem',
Expand Down
2 changes: 2 additions & 0 deletions src/config/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ export default {
// SEO-related settings:
seoSitemapLastmod: '2020-11-21',
seoSitemapPageSize: 100,

commentsHubId: '1032',
}

0 comments on commit e971e41

Please sign in to comment.