Skip to content

Commit

Permalink
Add items flag that allows enabling the Browser tab.
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahSaso committed Sep 29, 2023
1 parent 4e48da3 commit f3fed96
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions packages/stateful/hooks/useDaoTabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,20 @@ import {
FiberSmartRecordOutlined,
HomeOutlined,
HowToVoteOutlined,
WebOutlined,
} from '@mui/icons-material'
import { ComponentType } from 'react'
import { useTranslation } from 'react-i18next'

import { useDaoInfoContext } from '@dao-dao/stateless'
import { DaoTabId, DaoTabWithComponent, WidgetLocation } from '@dao-dao/types'

import { ProposalsTab, SubDaosTab, TreasuryAndNftsTab } from '../components'
import {
BrowserTab,
ProposalsTab,
SubDaosTab,
TreasuryAndNftsTab,
} from '../components'
import { useVotingModuleAdapter } from '../voting-module-adapter'
import { useWidgets } from '../widgets'

Expand All @@ -25,6 +32,7 @@ export const useDaoTabs = ({
const {
components: { extraTabs },
} = useVotingModuleAdapter()
const { items } = useDaoInfoContext()

// Get widget tab components, if exist.
const loadingWidgets = useWidgets({
Expand Down Expand Up @@ -75,13 +83,17 @@ export const useDaoTabs = ({
Component: SubDaosTab,
Icon: FiberSmartRecordOutlined,
},
// TODO(iframe browser): once most apps have updated
// {
// id: DaoTabId.Browser,
// label: t('title.browser'),
// Component: BrowserTab,
// Icon: WebOutlined,
// },
// Experimental Browser tab must be enabled through the DAO.
...('browserEnabled' in items && items.browserEnabled === 'true'
? [
{
id: DaoTabId.Browser,
label: t('title.browser'),
Component: BrowserTab,
Icon: WebOutlined,
},
]
: []),
...(extraTabs?.map(({ labelI18nKey, ...tab }) => ({
label: t(labelI18nKey),
...tab,
Expand Down

0 comments on commit f3fed96

Please sign in to comment.