Skip to content

Commit

Permalink
Add ff
Browse files Browse the repository at this point in the history
  • Loading branch information
vhande committed Nov 6, 2024
1 parent 78b7db5 commit 87d1193
Showing 1 changed file with 42 additions and 30 deletions.
72 changes: 42 additions & 30 deletions src/pages/search/index.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ const Search = () => {
const tab = (query?.tab as Scope) ?? 'events-places';
const { udbMainDarkBlue } = colors;
const isClientSide = useIsClient();
const { publicRuntimeConfig } = getConfig();
const isOwnershipEnabled = publicRuntimeConfig.ownershipEnabled === 'true';

const handleSelectTab = async (tabKey: Scope) =>
router.push(
Expand Down Expand Up @@ -54,37 +56,47 @@ const Search = () => {
overflow-y: auto;
`}
>
<Tabs<Scope>
activeKey={tab}
onSelect={handleSelectTab}
activeBackgroundColor={`${udbMainDarkBlue}`}
customVariant={TabsCustomVariants.OUTLINED}
>
<Tabs.Tab
eventKey="events-places"
title={t('search.events_places')}
{isOwnershipEnabled && (
<Tabs<Scope>
activeKey={tab}
onSelect={handleSelectTab}
activeBackgroundColor={`${udbMainDarkBlue}`}
customVariant={TabsCustomVariants.OUTLINED}
>
{tab === 'events-places' && (
<TabContent>
<Stack flex={1}>
{isClientSide && (
<iframe
height={
iframeHeight
? `${iframeHeight}px`
: `${window.innerHeight}`
}
src={legacyPath}
></iframe>
)}
</Stack>
</TabContent>
)}
</Tabs.Tab>
<Tabs.Tab eventKey="organizers" title={t('search.organizers')}>
{tab === 'organizers' && <div>Hello</div>}
</Tabs.Tab>
</Tabs>
<Tabs.Tab
eventKey="events-places"
title={t('search.events_places')}
>
{tab === 'events-places' && (
<TabContent>
<Stack flex={1}>
{isClientSide && (
<iframe
height={
iframeHeight
? `${iframeHeight}px`
: `${window.innerHeight}`
}
src={legacyPath}
></iframe>
)}
</Stack>
</TabContent>
)}
</Tabs.Tab>
<Tabs.Tab eventKey="organizers" title={t('search.organizers')}>
{tab === 'organizers' && <div>Hello</div>}
</Tabs.Tab>
</Tabs>
)}
{!isOwnershipEnabled && isClientSide && (
<iframe
height={
iframeHeight ? `${iframeHeight}px` : `${window.innerHeight}`
}
src={legacyPath}
></iframe>
)}
</Stack>
</Page.Content>
</Page>
Expand Down

0 comments on commit 87d1193

Please sign in to comment.