diff --git a/studio/components/to-be-cleaned/Storage/CreateBucketModal.js b/studio/components/to-be-cleaned/Storage/CreateBucketModal.js index 7349b91e260..3412111e709 100644 --- a/studio/components/to-be-cleaned/Storage/CreateBucketModal.js +++ b/studio/components/to-be-cleaned/Storage/CreateBucketModal.js @@ -1,7 +1,13 @@ -import { useEffect, useState } from 'react' +import { FC, useEffect, useState } from 'react' import { Modal, Alert, Button, Input, Space, Typography, Toggle } from '@supabase/ui' -const CreateBucketModal = ({ +interface Props { + visible : boolean + onSelectCancel: () => {} + onSelectSave: () => {} +} + +const CreateBucketModal: FC = ({ visible = false, onSelectCancel = () => {}, onSelectSave = () => {}, diff --git a/studio/components/to-be-cleaned/Storage/StorageSidebar.js b/studio/components/to-be-cleaned/Storage/StorageSidebar.js deleted file mode 100644 index 1623eed2074..00000000000 --- a/studio/components/to-be-cleaned/Storage/StorageSidebar.js +++ /dev/null @@ -1,191 +0,0 @@ -import { - Badge, - Button, - Dropdown, - Space, - Menu, - IconLoader, - IconPlus, - IconMoreVertical, - Typography, -} from '@supabase/ui' -import Link from 'next/link' -import { useRouter } from 'next/router' -import { STORAGE_ROW_STATUS } from './Storage.constants' -import Flag from 'components/ui/Flag/Flag' - -// [Joshen] I think this file is no longer in use, double check before removing (replaced by StorageMenu.tsx) - -const BucketRow = ({ - bucket = {}, - projectRef = '', - isSelected = false, - onSelectBucket = () => {}, - onSelectDeleteBucket = () => {}, - onSelectToggleBucketPublic = () => {}, -}) => { - const bucketOptions = [ - { - name: 'Delete bucket', - onClick: () => onSelectDeleteBucket(bucket), - }, - { - name: bucket.public ? 'Make private' : 'Make public', - onClick: () => onSelectToggleBucketPublic(bucket), - }, - ] - return ( -
- onSelectBucket(bucket)}> -
- {/* Need to investigate, why links here are reopning the entire page */} - - -
- {bucket.name} - {bucket.public && Public} -
-
- - - {bucket.status === STORAGE_ROW_STATUS.LOADING && ( - - )} - {bucket.status === STORAGE_ROW_STATUS.READY && ( - ( - - {option.name} - - )), - ]} - > - - - - - )} -
-
-
- ) -} - -const StorageSidebar = ({ - loaded = false, - buckets = [], - onSelectCreateBucket = () => {}, - onSelectDeleteBucket = () => {}, - onSelectToggleBucketPublic = () => {}, -}) => { - const router = useRouter() - const { ref, bucketId } = router.query - - return ( - - -
- - - -
-
- -
- {!loaded ? ( -
- - - - Loading buckets -
- ) : ( - <> - {buckets.length === 0 && ( - -

No buckets available

-
- )} - {buckets.map((bucket, idx) => { - const isSelected = bucketId === bucket.id - return ( - - ) - })} - - )} -
-
-
- - -
-
-
- ) -} - -export default StorageSidebar diff --git a/studio/components/to-be-cleaned/Storage/StorageUsage/StorageUsage.tsx b/studio/components/to-be-cleaned/Storage/StorageUsage/StorageUsage.tsx index f92a4b0a06e..2aa478925af 100644 --- a/studio/components/to-be-cleaned/Storage/StorageUsage/StorageUsage.tsx +++ b/studio/components/to-be-cleaned/Storage/StorageUsage/StorageUsage.tsx @@ -1,7 +1,7 @@ import { FC } from 'react' import SVG from 'react-inlinesvg' -const StorageUsage: FC = () => { +const StorageUsage: FC = () => { return (