Files
supabase/apps/studio/components/layouts/StorageLayout/StorageLayout.tsx
T
Danny WhiteandJoshen Lim f596989ed4 chore: feature flag for new Storage UI (#39093)
* feat: bucket type page and corresponding sidebar

* feat: handle /storage URL redirection based on feature flag

* fix: default sidebar selection

* Use feature flag for feature preview, and have new UI behind feature preview instead

* Remove hardcode

* Minor clean ups

* chore: improve feature preview description

* chore: more descriptive name for general file storage type

* fix: preview image

* Minor nits

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-10-01 12:16:20 +10:00

30 lines
896 B
TypeScript

import { ReactNode } from 'react'
import { useIsNewStorageUIEnabled } from 'components/interfaces/App/FeaturePreview/FeaturePreviewContext'
import { StorageMenu } from 'components/interfaces/Storage/StorageMenu'
import { StorageMenuV2 } from 'components/interfaces/Storage/StorageMenuV2'
import { withAuth } from 'hooks/misc/withAuth'
import ProjectLayout from '../ProjectLayout/ProjectLayout'
export interface StorageLayoutProps {
title: string
children: ReactNode
}
const StorageLayout = ({ title, children }: StorageLayoutProps) => {
const isStorageV2 = useIsNewStorageUIEnabled()
return (
<ProjectLayout
stickySidebarBottom={isStorageV2 ? false : true}
title={title || 'Storage'}
product="Storage"
productMenu={isStorageV2 ? <StorageMenuV2 /> : <StorageMenu />}
>
{children}
</ProjectLayout>
)
}
export default withAuth(StorageLayout)