mirror of
https://github.com/supabase/supabase.git
synced 2026-10-08 02:45:07 +03:00
* 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>
31 lines
1019 B
TypeScript
31 lines
1019 B
TypeScript
import { useParams } from 'common'
|
|
import Link from 'next/link'
|
|
import { Menu } from 'ui'
|
|
import { BUCKET_TYPES, BUCKET_TYPE_KEYS, DEFAULT_BUCKET_TYPE } from './Storage.constants'
|
|
|
|
export const StorageMenuV2 = () => {
|
|
const { ref, bucketType } = useParams()
|
|
const selectedBucketType = bucketType || DEFAULT_BUCKET_TYPE
|
|
|
|
return (
|
|
<Menu type="pills" className="mt-6 flex flex-grow flex-col">
|
|
<div className="mx-3">
|
|
<Menu.Group title={<span className="uppercase font-mono">Bucket Types</span>} />
|
|
|
|
{BUCKET_TYPE_KEYS.map((bucketTypeKey) => {
|
|
const isSelected = selectedBucketType === bucketTypeKey
|
|
const config = BUCKET_TYPES[bucketTypeKey]
|
|
|
|
return (
|
|
<Link key={bucketTypeKey} href={`/project/${ref}/storage/${bucketTypeKey}`}>
|
|
<Menu.Item rounded active={isSelected}>
|
|
<p className="truncate">{config.displayName}</p>
|
|
</Menu.Item>
|
|
</Link>
|
|
)
|
|
})}
|
|
</div>
|
|
</Menu>
|
|
)
|
|
}
|