diff --git a/package.json b/package.json index 91e4259e..14185e9f 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "@polkawallet/bridge": "0.1.3", "@reduxjs/toolkit": "^1.6.2", "@subsocial/api": "0.8.13", - "@subsocial/grill-widget": "^0.0.13", + "@subsocial/grill-widget": "^0.1.3", "@subsocial/resource-discussions": "0.0.4", "@subsocial/utils": "0.8.13", "@zeit/next-css": "^1.0.1", diff --git a/src/components/chat/ChatIframe.tsx b/src/components/chat/ChatIframe.tsx index aa5609aa..3749d42b 100644 --- a/src/components/chat/ChatIframe.tsx +++ b/src/components/chat/ChatIframe.tsx @@ -3,10 +3,8 @@ import { ComponentProps, useEffect, useState } from 'react' import grill, { GrillConfig, GrillEventListener } from '@subsocial/grill-widget' import { useSendEvent } from '../providers/AnalyticContext' import useWrapInRef from '../../hooks/useWrapInRef' -import { Resource } from '@subsocial/resource-discussions' import { ChanelTypeChannel, - ChanelTypeResource, GenerateGrillConfigParams, } from './types' import { useChatContext } from '../providers/ChatContext' @@ -14,12 +12,9 @@ import { isCreatorStakingPage } from '../utils' import { useRouter } from 'next/router' import { getCurrentWallet } from '../utils' -const creatorsHubId = '1218' - function generateGrillConfig ({ - hubId = 'polka', + hubId = 'featured', spaceId, - metadata, }: GenerateGrillConfigParams): GrillConfig { const settings = { enableInputAutofocus: true, @@ -29,27 +24,12 @@ function generateGrillConfig ({ const isCreatorStaking = isCreatorStakingPage() - // TODO: remove this hack and improve the config for using hub instead of channel - const hub = isCreatorStaking || spaceId ? { id: creatorsHubId } : { id: hubId } + const hub = { id: hubId } - const channel = spaceId - ? ({ - type: 'resource', - resource: new Resource({ - schema: 'chain', - chainType: 'substrate', - chainName: 'subsocial', - resourceType: 'creator', - resourceValue: { - id: spaceId, - }, - }), - metadata: metadata, - } as ChanelTypeResource) - : ({ + const channel = { type: 'channel', - id: '754', - } as ChanelTypeChannel) + id: '54461', + } as ChanelTypeChannel return { hub, diff --git a/yarn.lock b/yarn.lock index ea39c714..d179ac8f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5343,10 +5343,10 @@ "@polkadot/api" latest lodash.camelcase "^4.3.0" -"@subsocial/grill-widget@^0.0.13": - version "0.0.13" - resolved "https://registry.yarnpkg.com/@subsocial/grill-widget/-/grill-widget-0.0.13.tgz#b3001beb2c5eef140f36befff00a581892f7547f" - integrity sha512-16t1zgWC0nFP/iqhlYEVkRL+kzSqBfjTS2xhCPMNTzb51MjpVpGgZLTd77Jq3NU/iqnplyH690iKGzQIixHFkw== +"@subsocial/grill-widget@^0.1.3": + version "0.1.3" + resolved "https://registry.yarnpkg.com/@subsocial/grill-widget/-/grill-widget-0.1.3.tgz#8496d5761b686d6d846b4832b6cbce6c32f19809" + integrity sha512-t7J2wd10qaEPWsgP5v4ZP2DpC/WjaR1Cl59ee6VkGUWEUvjR2JcAJbjtUtzKsEvqpo1cXOXixqqU06FUHpLyRg== "@subsocial/resource-discussions@0.0.4": version "0.0.4"