Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

chore: update Storage Modals

Jonathan Summers-Muircf58f19a76ed
diff --git a/studio/components/layouts/StorageLayout/StorageMenu.tsx b/studio/components/layouts/StorageLayout/StorageMenu.tsx
index a1e64d1f055..8a8740d3b92 100644
--- a/studio/components/layouts/StorageLayout/StorageMenu.tsx
+++ b/studio/components/layouts/StorageLayout/StorageMenu.tsx
@@ -69,7 +69,9 @@ const StorageMenu: FC<Props> = () => {
<>
{buckets.length === 0 && (
<div className="px-2">
- <Alert title="No buckets available">There are no tables in this schema</Alert>
+ <Alert title="No buckets available">
+ Buckets that you create will appear here
+ </Alert>
</div>
)}
{buckets.map((bucket: any, idx: number) => {
@@ -92,18 +94,17 @@ const StorageMenu: FC<Props> = () => {
<div className="">
<Menu.Group title="Settings" />
- <div className="dash-product-menu space-y-1">
- <Link href={`/project/${projectRef}/storage/policies`}>
- <Menu.Item rounded active={page === 'policies'}>
- <Typography.Text className="truncate">Policies</Typography.Text>
- </Menu.Item>
- </Link>
- <Link href={`/project/${projectRef}/storage/usage`}>
- <Menu.Item rounded active={page === 'usage'}>
- <Typography.Text className="truncate">Usage</Typography.Text>
- </Menu.Item>
- </Link>
- </div>
+
+ <Link href={`/project/${projectRef}/storage/policies`}>
+ <Menu.Item rounded active={page === 'policies'}>
+ <Typography.Text className="truncate">Policies</Typography.Text>
+ </Menu.Item>
+ </Link>
+ <Link href={`/project/${projectRef}/storage/usage`}>
+ <Menu.Item rounded active={page === 'usage'}>
+ <Typography.Text className="truncate">Usage</Typography.Text>
+ </Menu.Item>
+ </Link>
</div>
</div>
</Menu>
diff --git a/studio/components/to-be-cleaned/Storage/CreateBucketModal.js b/studio/components/to-be-cleaned/Storage/CreateBucketModal.js
index 05121646f25..7349b91e260 100644
--- a/studio/components/to-be-cleaned/Storage/CreateBucketModal.js
+++ b/studio/components/to-be-cleaned/Storage/CreateBucketModal.js
@@ -45,22 +45,22 @@ const CreateBucketModal = ({
return (
<Modal
visible={visible}
- title="Create new bucket"
- size="large"
+ header="Create storage bucket"
+ size="medium"
onCancel={onSelectCancel}
customFooter={
- <Space>
- <Button type="secondary" onClick={onSelectCancel}>
+ <div className="flex items-center gap-2">
+ <Button type="default" onClick={onSelectCancel}>
Cancel
</Button>
<Button type="primary" loading={saving} onClick={onCreateBucket}>
{saving ? 'Creating bucket' : 'Create bucket'}
</Button>
- </Space>
+ </div>
}
>
- <div className="space-y-6 w-full pb-3">
- <form className="space-y-6">
+ <form className="space-y-6 py-4">
+ <Modal.Content>
<div className="flex items-center relative">
<Input
autoFocus
@@ -71,7 +71,7 @@ const CreateBucketModal = ({
Only lowercase letters, numbers, dots, and hyphens
</Typography.Text>
}
- layout="horizontal"
+ layout="vertical"
error={error}
type="text"
className="w-full"
@@ -80,24 +80,33 @@ const CreateBucketModal = ({
onChange={(event) => setBucketName(event.target.value)}
/>
</div>
+ </Modal.Content>
+ <Modal.Seperator />
+ <Modal.Content>
<div className="space-y-4">
<Toggle
name="isPublic"
- label="Make bucket public"
- layout="horizontal"
+ label="Public bucket"
+ descriptionText="Anyone can read any object without any authorization"
+ layout="flex"
size="medium"
onChange={() => setIsPublic(!isPublic)}
/>
{isPublic && (
- <Alert title="Warning: Public bucket" variant="warning" withIcon>
- Users can read objects in public buckets without any authorization. RLS policies are
- still required other operations such as object uploads and deletes.
+ <Alert title="Public buckets are not protected" variant="warning" withIcon>
+ <p className="mb-2">
+ Users can read objects in public buckets without any authorization.
+ </p>
+ <p>
+ Row level security (RLS) policies are still required for other operations such as
+ object uploads and deletes.
+ </p>
</Alert>
)}
</div>
- <button className="hidden" type="submit" onClick={onCreateBucket} />
- </form>
- </div>
+ </Modal.Content>
+ <button className="hidden" type="submit" onClick={onCreateBucket} />
+ </form>
</Modal>
)
}
diff --git a/studio/components/to-be-cleaned/Storage/StorageExplorer/ConfirmDeleteModal.js b/studio/components/to-be-cleaned/Storage/StorageExplorer/ConfirmDeleteModal.js
index 3c50072e302..3e251fc8d62 100644
--- a/studio/components/to-be-cleaned/Storage/StorageExplorer/ConfirmDeleteModal.js
+++ b/studio/components/to-be-cleaned/Storage/StorageExplorer/ConfirmDeleteModal.js
@@ -1,5 +1,5 @@
import { useEffect, useState } from 'react'
-import { Modal, Button, Space } from '@supabase/ui'
+import { Modal, Button, Space, Alert } from '@supabase/ui'
const ConfirmDeleteModal = ({
visible = false,
@@ -35,20 +35,28 @@ const ConfirmDeleteModal = ({
return (
<Modal
visible={visible}
- title={title}
- description={`${description} This action cannot be undone.`}
+ header={title}
size="small"
+ onCancel={onSelectCancel}
customFooter={
- <Space>
- <Button type="secondary" onClick={onSelectCancel}>
+ <div className="flex items-center gap-2">
+ <Button type="default" onClick={onSelectCancel}>
Cancel
</Button>
<Button type="primary" danger loading={deleting} onClick={onConfirmDelete}>
{deleting ? 'Deleting' : 'Delete'}
</Button>
- </Space>
+ </div>
}
- />
+ >
+ <Modal.Content>
+ <div className="my-4">
+ <Alert withIcon variant="danger" title={`This action cannot be undone.`}>
+ {description}
+ </Alert>
+ </div>
+ </Modal.Content>
+ </Modal>
)
}
diff --git a/studio/components/to-be-cleaned/Storage/StorageExplorer/MoveItemsModal.js b/studio/components/to-be-cleaned/Storage/StorageExplorer/MoveItemsModal.js
index 0a6163bc5ad..6a299d44c5e 100644
--- a/studio/components/to-be-cleaned/Storage/StorageExplorer/MoveItemsModal.js
+++ b/studio/components/to-be-cleaned/Storage/StorageExplorer/MoveItemsModal.js
@@ -40,41 +40,39 @@ const MoveItemsModal = ({
return (
<Modal
visible={visible}
- title={title}
+ header={title}
description={description}
- size="large"
+ size="medium"
+ onCancel={onSelectCancel}
customFooter={
- <Space>
- <Button type="secondary" onClick={onSelectCancel}>
+ <div className="flex items-center gap-2">
+ <Button type="default" onClick={onSelectCancel}>
Cancel
</Button>
<Button type="primary" loading={moving} onClick={onConfirmMove}>
{moving ? 'Moving files' : 'Move files'}
</Button>
- </Space>
+ </div>
}
>
- <div className="space-y-4 w-full pb-3">
- <form>
- <p className="mb-2">
- <Typography.Text>Path to new directory in {bucketName}:</Typography.Text>
- </p>
+ <Modal.Content>
+ <form className="my-4">
<div className="flex items-center relative">
<Input
autoFocus
+ label={`Path to new directory in ${bucketName}`}
type="text"
className="w-full"
placeholder="e.g folder1/subfolder2"
value={newPath}
+ descriptionText="Leave blank to move items to the root of the bucket"
onChange={(event) => setNewPath(event.target.value)}
/>
</div>
- <p className="opacity-50 mt-2">
- <Typography.Text>Leave blank to move items to the root of the bucket</Typography.Text>
- </p>
+
<button className="hidden" type="submit" onClick={onConfirmMove} />
</form>
- </div>
+ </Modal.Content>
</Modal>
)
}
diff --git a/studio/components/to-be-cleaned/Storage/StorageExplorer/PreviewPane.js b/studio/components/to-be-cleaned/Storage/StorageExplorer/PreviewPane.js
index 10ed9370862..75d47ae4889 100644
--- a/studio/components/to-be-cleaned/Storage/StorageExplorer/PreviewPane.js
+++ b/studio/components/to-be-cleaned/Storage/StorageExplorer/PreviewPane.js
@@ -1,6 +1,5 @@
import {
Button,
- Space,
IconX,
IconLoader,
IconClipboard,
@@ -26,10 +25,8 @@ const PreviewFile = ({ mimeType, previewUrl }) => {
}
if (previewUrl === 'loading') {
return (
- <div className="w-full h-full flex items-center justify-center">
- <Typography.Text>
- <IconLoader size={16} strokeWidth={2} className="animate-spin" />
- </Typography.Text>
+ <div className="w-full h-full flex items-center justify-center text-scale-900">
+ <IconLoader size={14} strokeWidth={2} className="animate-spin" />
</div>
)
}
@@ -62,7 +59,9 @@ const PreviewFile = ({ mimeType, previewUrl }) => {
<div className="w-full h-full flex items-center justify-center px-10">
<audio key={previewUrl} controls style={{ width: 'inherit' }}>
<source src={previewUrl} type="audio/mpeg" />
- <Typography.Text>Your browser does not support the audio element.</Typography.Text>
+ <p className="text-scale-1100 text-sm">
+ Your browser does not support the audio element.
+ </p>
</audio>
</div>
)
@@ -72,7 +71,7 @@ const PreviewFile = ({ mimeType, previewUrl }) => {
<div className="w-full h-full flex items-center justify-center">
<video key={previewUrl} controls style={{ maxHeight: '100%' }}>
<source src={previewUrl} type="video/mp4" />
- <Typography.Text>Your browser does not support the video tag.</Typography.Text>
+ <p className="text-scale-1100 text-sm">Your browser does not support the video tag.</p>
</video>
</div>
)
@@ -119,15 +118,13 @@ const PreviewPane = ({
style={{ width }}
>
{/* Preview Header */}
- <div className="w-full flex justify-end">
- <Typography.Text type="secondary">
- <IconX
- className="cursor-pointer"
- size={16}
- strokeWidth={2}
- onClick={onClosePreviewPane}
- />
- </Typography.Text>
+ <div className="w-full flex justify-end text-scale-900 hover:text-scale-1200 transition-colors">
+ <IconX
+ className="cursor-pointer"
+ size={14}
+ strokeWidth={2}
+ onClick={onClosePreviewPane}
+ />
</div>
{/* Preview Thumbnail*/}
@@ -141,17 +138,13 @@ const PreviewPane = ({
{/* Preview Information */}
<div className="space-y-1">
<div className="flex items-center">
- <Typography.Text>
- <p className="font-bold mr-2">{file.name}</p>
- </Typography.Text>
+ <h5 className="text-scale-1200 text-base font-bold mr-2">{file.name}</h5>
</div>
{mimeType && (
- <Typography.Text type="secondary">
- <p className="text-sm">
- {mimeType}
- {size && <span> - {size}</span>}
- </p>
- </Typography.Text>
+ <p className="text-sm text-scale-1100">
+ {mimeType}
+ {size && <span> - {size}</span>}
+ </p>
)}
</div>
@@ -159,46 +152,39 @@ const PreviewPane = ({
<div className="space-y-2">
<div>
<Typography.Text>
- <Typography.Text type="secondary">
- <p className="text-sm mb-1">Added on</p>
- </Typography.Text>
- <p className="text-sm">{createdAt}</p>
+ <label className="text-xs text-scale-900 mb-1">Added on</label>
+ <p className="text-sm text-scale-1100">{createdAt}</p>
</Typography.Text>
</div>
<div>
<Typography.Text>
- <Typography.Text type="secondary">
- <p className="text-sm mb-1">Last modified</p>
- </Typography.Text>
- <p className="text-sm">{updatedAt}</p>
+ <label className="text-xs text-scale-900 mb-1">Last modified</label>
+ <p className="text-sm text-scale-1100">{updatedAt}</p>
</Typography.Text>
</div>
</div>
{/* Actions */}
- <div className="space-x-2 border-b pb-4 border-panel-border-light dark:border-panel-border-dark">
- <Space>
- <Button
- type="default"
- icon={<IconDownload size={16} strokeWidth={2} />}
- onClick={() => onDownloadFile(file)}
- >
- Download
- </Button>
- <Button
- type="default"
- icon={<IconClipboard size={16} strokeWidth={2} />}
- onClick={() => onCopyFileURL(file)}
- >
- Copy URL
- </Button>
- </Space>
+ <div className="flex space-x-2 border-b pb-4 border-panel-border-light dark:border-panel-border-dark">
+ <Button
+ type="secondary"
+ icon={<IconDownload size={16} strokeWidth={2} />}
+ onClick={() => onDownloadFile(file)}
+ >
+ Download
+ </Button>
+ <Button
+ type="default"
+ icon={<IconClipboard size={16} strokeWidth={2} />}
+ onClick={() => onCopyFileURL(file)}
+ >
+ Copy URL
+ </Button>
</div>
<Button
- type="text"
+ type="default"
shadow={false}
size="tiny"
- danger
icon={<IconTrash2 size={16} strokeWidth={2} />}
onClick={() => onSelectFileDelete(file)}
>